Skip to content

Commit 16288d7

Browse files
committed
bump-boto: Handle any versions of boto components
Signed-off-by: Michał Górny <[email protected]>
1 parent 52ceab3 commit 16288d7

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

bump-boto

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,27 @@ if ! [[ ${OLDV} && ${NEWV} ]]; then
1313
exit 1
1414
fi
1515

16-
BOTOCORE_EBUILDS=( dev-python/botocore/*.ebuild )
17-
NEWEST_BOTOCORE=${BOTOCORE_EBUILDS[-1]}
18-
if [[ ${NEWEST_BOTOCORE} == *9999* ]]; then
19-
NEWEST_BOTOCORE=${BOTOCORE_EBUILDS[-2]}
20-
fi
21-
NEWEST_BOTOCORE=${NEWEST_BOTOCORE%.*.ebuild}
22-
23-
BOTOCORE_MINOR=${NEWEST_BOTOCORE##*.}
24-
BOTO3_MINOR=$(( BOTOCORE_MINOR - 3 ))
25-
AWSCLI_MINOR=$(( BOTOCORE_MINOR - 2 ))
26-
2716
bump_pkg() {
2817
local pkg=${1}
29-
local pn=${pkg#*/}
30-
local oldv=${2}.${3}
31-
local newv=${2}.${4}
18+
local oldv=${2}
19+
local newv=${3}
3220

3321
(
3422
cd "${pkg}"
35-
"${scriptdir}"/pkgbump "${pn}-${oldv}.ebuild" "${pn}-${newv}.ebuild"
36-
${EDITOR:-vim} "${pn}-${newv}.ebuild"
37-
"${scriptdir}"/pkgcommit . -sS -m "Bump to ${newv}"
23+
24+
local ebuilds=( *.ebuild )
25+
local newest=${ebuilds[-1]}
26+
if [[ ${newest} == *9999* ]]; then
27+
newest=${ebuilds[-2]}
28+
fi
29+
newest=${newest%.*.ebuild}
30+
31+
"${scriptdir}"/pkgbump "${newest}.${oldv}.ebuild" "${newest}.${newv}.ebuild"
32+
${EDITOR:-vim} "${newest}.${newv}.ebuild"
33+
"${scriptdir}"/pkgcommit . -sS -m "Bump to ${newest##*-}.${newv}"
3834
)
3935
}
4036

41-
bump_pkg dev-python/botocore 1.${BOTOCORE_MINOR} ${OLDV} ${NEWV}
42-
bump_pkg dev-python/boto3 1.${BOTO3_MINOR} ${OLDV} ${NEWV}
43-
bump_pkg app-admin/awscli 1.${AWSCLI_MINOR} ${OLDV} ${NEWV}
37+
bump_pkg dev-python/botocore ${OLDV} ${NEWV}
38+
bump_pkg dev-python/boto3 ${OLDV} ${NEWV}
39+
bump_pkg app-admin/awscli ${OLDV} ${NEWV}

0 commit comments

Comments
 (0)