-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbump-boto
More file actions
executable file
·42 lines (34 loc) · 904 Bytes
/
bump-boto
File metadata and controls
executable file
·42 lines (34 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# bump botocore, boto3 and awscli
# (c) 2022-2024 Michał Górny <mgorny@gentoo.org>
# SPDX-License-Identifier: GPL-2.0-or-later
set -e
scriptdir=${BASH_SOURCE%/*}
cd "$(git rev-parse --show-toplevel)"
INCREMENT=${1#+}
if ! [[ ${INCREMENT} ]]; then
echo "Usage: ${0} <increment>" >&2
exit 1
fi
bump_pkg() {
local pkg=${1}
(
cd "${pkg}"
local ebuilds
mapfile -t ebuilds < <(printf '%s\n' *.ebuild | sort -V)
local newest=${ebuilds[-1]}
if [[ ${newest} == *9999* ]]; then
newest=${ebuilds[-2]}
fi
newest=${newest%.ebuild}
local oldv=${newest##*.}
local newv=$(( oldv + INCREMENT ))
newest=${newest%.*}
"${scriptdir}"/pkgbump "${newest}.${oldv}.ebuild" "${newest}.${newv}.ebuild"
${EDITOR:-vim} "${newest}.${newv}.ebuild"
"${scriptdir}"/pkgcommit . -sS --bump
)
}
bump_pkg dev-python/botocore
bump_pkg dev-python/boto3
bump_pkg app-admin/awscli