Gentoo Archives: gentoo-dev

From: David Seifert <soap@g.o>
To: gentoo-dev@l.g.o
Cc: David Seifert <soap@g.o>
Subject: [gentoo-dev] [PATCH 17/22] subversion.eclass: remove EAPI 6
Date: Tue, 14 Mar 2023 20:03:44
Message-Id: 20230314195826.35239-17-soap@gentoo.org
In Reply to: [gentoo-dev] [PATCH 01/22] apache-module.eclass: remove EAPI 5 by David Seifert
1 Signed-off-by: David Seifert <soap@g.o>
2 ---
3 eclass/subversion.eclass | 44 ++++++++++++++++++++--------------------
4 1 file changed, 22 insertions(+), 22 deletions(-)
5
6 diff --git a/eclass/subversion.eclass b/eclass/subversion.eclass
7 index 349878618427..48ee15105adc 100644
8 --- a/eclass/subversion.eclass
9 +++ b/eclass/subversion.eclass
10 @@ -1,4 +1,4 @@
11 -# Copyright 1999-2022 Gentoo Authors
12 +# Copyright 1999-2023 Gentoo Authors
13 # Distributed under the terms of the GNU General Public License v2
14
15 # @ECLASS: subversion.eclass
16 @@ -6,28 +6,26 @@
17 # Akinori Hattori <hattya@g.o>
18 # @AUTHOR:
19 # Original Author: Akinori Hattori <hattya@g.o>
20 -# @SUPPORTED_EAPIS: 6 7 8
21 +# @SUPPORTED_EAPIS: 7 8
22 # @BLURB: Fetch software sources from subversion repositories
23 # @DESCRIPTION:
24 # The subversion eclass provides functions to fetch software sources
25 # from subversion repositories.
26
27 case ${EAPI} in
28 - 6|7|8) inherit estack ;;
29 - *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;;
30 + 7|8) inherit estack ;;
31 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
32 esac
33
34 +if [[ -z ${_SUBVERSION_ECLASS} ]]; then
35 +_SUBVERSION_ECLASS=1
36 +
37 PROPERTIES+=" live"
38
39 -DEPEND="
40 +BDEPEND="
41 dev-vcs/subversion[http(+)]
42 net-misc/rsync"
43
44 -case ${EAPI} in
45 - 6) ;;
46 - *) BDEPEND="${DEPEND}"; DEPEND="" ;;
47 -esac
48 -
49 # @ECLASS_VARIABLE: ESVN_STORE_DIR
50 # @USER_VARIABLE
51 # @DESCRIPTION:
52 @@ -177,7 +175,7 @@ subversion_fetch() {
53 die "${ECLASS}: ESVN_REPO_URI (or specified URI) is empty."
54 fi
55
56 - [[ -n "${ESVN_REVISION}" ]] && revision="${ESVN_REVISION}"
57 + [[ -n ${ESVN_REVISION} ]] && revision="${ESVN_REVISION}"
58
59 # check for the scheme
60 local scheme="${repo_uri%%:*}"
61 @@ -196,7 +194,7 @@ subversion_fetch() {
62 addread "/etc/subversion"
63 addwrite "${ESVN_STORE_DIR}"
64
65 - if [[ -n "${ESVN_UMASK}" ]]; then
66 + if [[ -n ${ESVN_UMASK} ]]; then
67 eumask_push "${ESVN_UMASK}"
68 fi
69
70 @@ -210,9 +208,9 @@ subversion_fetch() {
71 local wc_path="$(subversion__get_wc_path "${repo_uri}")"
72 local options="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion"
73
74 - [[ -n "${revision}" ]] && options="${options} -r ${revision}"
75 + [[ -n ${revision} ]] && options="${options} -r ${revision}"
76
77 - if [[ "${ESVN_OPTIONS}" = *-r* ]]; then
78 + if [[ ${ESVN_OPTIONS} == *-r* ]]; then
79 ewarn "\${ESVN_OPTIONS} contains -r, this usage is unsupported. Please"
80 ewarn "see \${ESVN_REPO_URI}"
81 fi
82 @@ -237,7 +235,7 @@ subversion_fetch() {
83
84 mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ECLASS}: can't mkdir ${ESVN_PROJECT}."
85 cd "${ESVN_PROJECT}" || die "${ECLASS}: can't chdir to ${ESVN_PROJECT}"
86 - if [[ -n "${ESVN_USER}" ]]; then
87 + if [[ -n ${ESVN_USER} ]]; then
88 ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
89 else
90 ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
91 @@ -276,13 +274,13 @@ subversion_fetch() {
92 einfo " new UUID: $(subversion__svn_info "${repo_uri}" "Repository UUID")"
93 einfo " repository: ${repo_uri}${revision:+@}${revision}"
94
95 - rm -fr "${ESVN_PROJECT}" || die
96 + rm -rf "${ESVN_PROJECT}" || die
97
98 debug-print "${FUNCNAME}: ${ESVN_FETCH_CMD} ${options} ${repo_uri}"
99
100 mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ECLASS}: can't mkdir ${ESVN_PROJECT}."
101 cd "${ESVN_PROJECT}" || die "${ECLASS}: can't chdir to ${ESVN_PROJECT}"
102 - if [[ -n "${ESVN_USER}" ]]; then
103 + if [[ -n ${ESVN_USER} ]]; then
104 ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
105 else
106 ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
107 @@ -295,7 +293,7 @@ subversion_fetch() {
108 debug-print "${FUNCNAME}: ${ESVN_SWITCH_CMD} ${options} ${repo_uri}"
109
110 cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
111 - if [[ -n "${ESVN_USER}" ]]; then
112 + if [[ -n ${ESVN_USER} ]]; then
113 ${ESVN_SWITCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" ${repo_uri} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
114 else
115 ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
116 @@ -308,7 +306,7 @@ subversion_fetch() {
117 debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}"
118
119 cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
120 - if [[ -n "${ESVN_USER}" ]]; then
121 + if [[ -n ${ESVN_USER} ]]; then
122 ${ESVN_UPDATE_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
123 else
124 ${ESVN_UPDATE_CMD} ${options} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
125 @@ -320,7 +318,7 @@ subversion_fetch() {
126 fi
127 fi
128
129 - if [[ -n "${ESVN_UMASK}" ]]; then
130 + if [[ -n ${ESVN_UMASK} ]]; then
131 eumask_pop
132 fi
133
134 @@ -384,7 +382,7 @@ subversion_src_unpack() {
135 subversion_pkg_preinst() {
136 local pkgdate=$(date "+%Y%m%d %H:%M:%S")
137 if [[ -n ${ESCM_LOGDIR} ]]; then
138 - local dir="${EROOT%/}${ESCM_LOGDIR}/${CATEGORY}"
139 + local dir="${EROOT}${ESCM_LOGDIR}/${CATEGORY}"
140 if [[ ! -d ${dir} ]]; then
141 mkdir -p "${dir}" || eerror "Failed to create '${dir}' for logging svn revision"
142 fi
143 @@ -450,7 +448,7 @@ subversion__get_peg_revision() {
144
145 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
146 # repo_uri has peg revision?
147 - if [[ ${repo_uri} = *@* ]]; then
148 + if [[ ${repo_uri} == *@* ]]; then
149 peg_rev="${repo_uri##*@}"
150 debug-print "${FUNCNAME}: peg_rev = ${peg_rev}"
151 else
152 @@ -460,4 +458,6 @@ subversion__get_peg_revision() {
153 echo "${peg_rev}"
154 }
155
156 +fi
157 +
158 EXPORT_FUNCTIONS src_unpack pkg_preinst
159 --
160 2.40.0