Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o, dilfridge@g.o
Cc: "Andreas K. Huettel (dilfridge)" <dilfridge@g.o>
Subject: Re: [gentoo-dev] [PATCH 09/15] perl-module.eclass: Use DIST_ prefix instead of MODULE_ prefix in EAPI=6 for control variables.
Date: Sat, 12 Dec 2015 12:02:22
Message-Id: 6EECC416-8F0B-4192-B3E7-F275B0F89665@gentoo.org
In Reply to: [gentoo-dev] [PATCH 09/15] perl-module.eclass: Use DIST_ prefix instead of MODULE_ prefix in EAPI=6 for control variables. by dilfridge@gentoo.org
1 Dnia 11 grudnia 2015 22:03:05 CET, dilfridge@g.o napisał(a):
2 >From: "Andreas K. Huettel (dilfridge)" <dilfridge@g.o>
3 >
4 >This is more consistent with upstream terminology and avoids clashes in
5 >case of kernel modules.
6 >---
7 >eclass/perl-module.eclass | 52
8 >+++++++++++++++++++++++++++--------------------
9 > 1 file changed, 30 insertions(+), 22 deletions(-)
10 >
11 >diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
12 >index 82707fe..efcc47c 100644
13 >--- a/eclass/perl-module.eclass
14 >+++ b/eclass/perl-module.eclass
15 >@@ -114,30 +114,31 @@ esac
16 >
17 > LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
18 >
19 >-# @ECLASS-VARIABLE: MODULE_NAME
20 >+# @ECLASS-VARIABLE: DIST_NAME
21 > # @DESCRIPTION:
22 ># (EAPI=6) This variable provides a way to override PN for the
23 >calculation of S,
24 > # SRC_URI, and HOMEPAGE. Defaults to PN.
25 >
26 >-# @ECLASS-VARIABLE: MODULE_VERSION
27 >+# @ECLASS-VARIABLE: DIST_VERSION
28 > # @DESCRIPTION:
29 >-# This variable provides a way to override PV for the calculation of S
30 >and SRC_URI.
31 >+# (EAPI=6) This variable provides a way to override PV for the
32 >calculation of S and SRC_URI.
33 ># Use it to provide the non-normalized, upstream version number.
34 >Defaults to PV.
35 >+# Named MODULE_VERSION in EAPI=5.
36 >
37 >-# @ECLASS-VARIABLE: MODULE_A_EXT
38 >+# @ECLASS-VARIABLE: DIST_A_EXT
39 > # @DESCRIPTION:
40 >-# This variable provides a way to override the distfile extension for
41 >the calculation of
42 >-# SRC_URI. Defaults to tar.gz
43 >+# (EAPI=6) This variable provides a way to override the distfile
44 >extension for the calculation of
45 >+# SRC_URI. Defaults to tar.gz. Named MODULE_A_EXT in EAPI=5.
46 >
47 >-# @ECLASS-VARIABLE: MODULE_A
48 >+# @ECLASS-VARIABLE: DIST_A
49 > # @DESCRIPTION:
50 >-# This variable provides a way to override the distfile name for the
51 >calculation of
52 >-# SRC_URI. Defaults to
53 >${MODULE_NAME}-${MODULE_VERSION}.${MODULE_A_EXT}
54 >+# (EAPI=6) This variable provides a way to override the distfile name
55 >for the calculation of
56 >+# SRC_URI. Defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT}
57 >Named MODULE_A in EAPI=5.
58 >
59 >-# @ECLASS-VARIABLE: MODULE_AUTHOR
60 >+# @ECLASS-VARIABLE: DIST_AUTHOR
61 > # @DESCRIPTION:
62 >-# This variable sets the module author name for the calculation of
63 >-# SRC_URI.
64 >+# (EAPI=6) This variable sets the module author name for the
65 >calculation of
66 >+# SRC_URI. Named MODULE_AUTHOR in EAPI=5.
67 >
68 > if [[ ${EAPI:-0} = 5 ]] ; then
69 > if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
70 >@@ -146,19 +147,26 @@ if [[ ${EAPI:-0} = 5 ]] ; then
71 > fi
72 > MODULE_NAME=${MY_PN:-${PN}}
73 > MODULE_P=${MY_P:-${P}}
74 >+
75 >+ [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
76 >+ MODULE_A="${MODULE_P}.${MODULE_A_EXT:-tar.gz}"
77 >+ [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
78 >+ SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
79 >+ [[ -z "${HOMEPAGE}" ]] && \
80 >+ HOMEPAGE="http://search.cpan.org/dist/${MODULE_NAME}/"
81 > else
82 >- MODULE_NAME=${MODULE_NAME:-${PN}}
83 >- MODULE_P=${MODULE_NAME}-${MODULE_VERSION:-${PV}}
84 >- S=${WORKDIR}/${MODULE_P}
85 >+ DIST_NAME=${DIST_NAME:-${PN}}
86 >+ DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
87 >+ S=${WORKDIR}/${DIST_P}
88 >+
89 >+ [[ -z "${SRC_URI}" && -z "${DIST_A}" ]] && \
90 >+ DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}"
91 >+ [[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] && \
92 >+ SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
93 >+ [[ -z "${HOMEPAGE}" ]] && \
94 >+ HOMEPAGE="http://search.cpan.org/dist/${DIST_NAME}/"
95 > fi
96 >
97 >-[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
98 >- MODULE_A="${MODULE_P}.${MODULE_A_EXT:-tar.gz}"
99 >-[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
100 >- SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
101 >-[[ -z "${HOMEPAGE}" ]] && \
102 >- HOMEPAGE="http://search.cpan.org/dist/${MODULE_NAME}/"
103 >-
104 > SRC_PREP="no"
105 > SRC_TEST="skip"
106 > PREFER_BUILDPL="yes"
107
108 Now that's confusing history. You introduce new variables, document them all, then suddenly rename then. Wouldn't it be better to rename old ones first and introduce new ones directly with correct names?
109 --
110 Sent from my Android device with K-9 Mail. Please excuse my brevity.

Replies