Skip to content

Commit 534c15e

Browse files
committed
pkg{bump,pkgdiff-mg}: Set PKGBUMPING to PVR
Set PKGBUMPING to PVR, to avoid removing Manifest entries for other ebuild versions than the one being bumped. Thanks to Arsen for the suggestion. Signed-off-by: Michał Górny <[email protected]>
1 parent 6620661 commit 534c15e

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ plan on using it multiple times.
7979

8080
pkgdiff-mg
8181
----------
82-
Dependencies: portage
82+
Dependencies: portage, pkgcore
8383

8484
Calls ``ebuild(1)`` to extract archives for two specified ebuilds,
8585
and then diffs the result. Does not handle ebuilds unpacking multiple
@@ -98,7 +98,7 @@ only the build system files::
9898

9999
pkgbump
100100
-------
101-
Dependencies: portage, gentoolkit (ekeyword), git
101+
Dependencies: portage, gentoolkit (ekeyword), git, pkgcore
102102

103103
Copies ebuild for a version bump, dropping keywords, updating Manifest
104104
and running pkgdiff-mg_ to compare archives. Typical usage::

pkgbump

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#!/usr/bin/env bash
22

3+
for arg; do
4+
if [[ ${arg} != *.ebuild ]]; then
5+
echo "Incorrect filename: ${arg}"
6+
exit 1
7+
fi
8+
9+
filename=${arg##*/}
10+
version=$(patom -F '%{fullver}' "=category/${arg%.ebuild}")
11+
if [[ -z ${version} ]]; then
12+
echo "Incorrect filename: ${arg}"
13+
exit 1
14+
fi
15+
done
16+
317
set -e -x
418

519
scriptdir=${BASH_SOURCE%/*}
@@ -10,7 +24,7 @@ if grep -q "^PYTHON_COMPAT" "${2}" && type -P gpy-impl &>/dev/null; then
1024
gpy-impl "${2}" -python3_{8..9} || :
1125
fi
1226
# tell ebuilds we don't want everything
13-
export PKGBUMPING=1
27+
export PKGBUMPING=${version}
1428
GENTOO_MIRRORS= ebuild "${2}" manifest
1529
[[ ! -f Manifest ]] || git add Manifest
1630
git add "${2}"

pkgdiff-mg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@ cat1=$(get_category "${1}")
3131
cat2=$(get_category "${2}")
3232
fn1=${1##*/}
3333
fn2=${2##*/}
34+
ver1=$(patom -F '%{fullver}' "=${cat1}/${fn1%.ebuild}")
35+
ver2=$(patom -F '%{fullver}' "=${cat2}/${fn2%.ebuild}")
3436

3537
export PORTAGE_TMPDIR="${TMPDIR:-/tmp}"/mgorny-dev-scripts
3638
export USE="${USE} test"
3739
# use noauto to skip pkg_setup
3840
export FEATURES="${FEATURES} noauto"
3941
# tell ebuilds we don't want everything
40-
export PKGBUMPING=1
4142
mkdir -p "${PORTAGE_TMPDIR}"
42-
ebuild "${1}" unpack
43-
ebuild "${2}" unpack
43+
PKGBUMPING=${ver1} ebuild "${1}" unpack
44+
PKGBUMPING=${ver2} ebuild "${2}" unpack
4445
s1=$(sed -nr 's/^declare -x S="(.*)"/\1/p' "${PORTAGE_TMPDIR}"/portage/${cat1}/${fn1%.ebuild}/temp/environment)
4546
s2=$(sed -nr 's/^declare -x S="(.*)"/\1/p' "${PORTAGE_TMPDIR}"/portage/${cat2}/${fn2%.ebuild}/temp/environment)
4647

0 commit comments

Comments
 (0)