Skip to content

Commit a523f87

Browse files
committed
Add a pkgmove tool
Signed-off-by: Michał Górny <[email protected]>
1 parent 691b510 commit a523f87

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

README.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ and running pkgdiff-mg_ to compare archives. Typical usage::
108108

109109
pkgbump foo-1.0.ebuild foo-1.1.ebuild
110110

111+
pkgmove
112+
-------
113+
Dependencies: git
114+
Optional dependencies: gpyutils >= 0.12 (gpy-impl)
115+
116+
Performs a package move. Moves the package directory if the old name
117+
still exists. Updates all entries in ebuilds, eclasses and profiles.
118+
Adds a profiles/updates entry.
119+
120+
WARNING: edits are done using greedy sed. Double-check the results.
121+
122+
Example use::
123+
124+
pkgmove dev-util/cmake-fedora dev-build/cmake-fedora
125+
pkgmove dev-util/cmake dev-build/cmake
126+
111127
mkpatchset
112128
----------
113129
Dependencies: git, scp

pkgmove

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -x
4+
5+
scriptdir=${BASH_SOURCE%/*}
6+
from=${1}
7+
to=${2}
8+
9+
[[ ${from} && ${to} ]]
10+
11+
if [[ -d ${from} ]]; then
12+
git mv "${from}" "${to}"
13+
fi
14+
15+
find profiles/updates -type f -exec sed -i -e "\@^move ${from} @d" {} +
16+
git grep -l "${from}" :!profiles/updates |
17+
xargs -r sed -i -e "s@${from}@${to}@g"
18+
echo "move ${from} ${to}" >> profiles/updates/$(date "+%qQ-%Y")
19+
20+
modified=( $(git diff --name-only HEAD) )
21+
"${scriptdir}"/copybump "${modified[@]}"
22+
if type -P gpy-impl &>/dev/null; then
23+
git grep -l "^PYTHON_COMPAT" "${modified[@]}" |
24+
xargs -r gpy-impl -@dead || :
25+
fi

0 commit comments

Comments
 (0)