[packages/rpm-build-tools] remove commit grouping
glen
glen at pld-linux.org
Tue Aug 21 22:20:25 CEST 2012
commit 06258291bad724592432af60969839e4f98a4434
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Aug 21 23:19:18 2012 +0300
remove commit grouping
- it is no longer possible to commit several packages at once like in cvs
- somehow the grouping logic skipped some packages when doing mass
updates, this way it's stright forward and such bugs not possible
relup.sh | 54 ++++++++++++++++++++++++------------------------------
1 file changed, 24 insertions(+), 30 deletions(-)
---
diff --git a/relup.sh b/relup.sh
index 76f735e..a60c9be 100755
--- a/relup.sh
+++ b/relup.sh
@@ -123,24 +123,32 @@ while true; do
shift
done
-tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
topdir=$(rpm -E '%{_topdir}')
-# round 1: get packages and update .spec files
-# batches changes for each release
-# TODO: drop this, in git need to commit and push each package separately, no
-# way to group changes as in CVS
+n="$(echo -e '\nn')"
+n="${n%%n}"
+
cd "$topdir"
for pkg in "$@"; do
+ # pkg: package %{name}
pkg=$(package_name "$pkg")
+
+ # spec: package/package.spec
spec=$(rpm -D "name $pkg" -E '%{_specdir}/%{name}.spec')
spec=${spec#$topdir/}
+ # pkgdir: package/
+ pkgdir=${spec%/*}
+
+ # start real work
echo "$pkg ..."
+ # get package
if [ "$update" = "1" ]; then
./builder -g -ns "$spec"
fi
+
+ # update .spec files
rel=$(get_release "$spec")
if [ "$inc" = 1 ]; then
if [[ $rel = *%* ]]; then
@@ -151,31 +159,17 @@ for pkg in "$@"; do
newrel=$(bump_release ${rel})
set_release "$spec" $rel $newrel
fi
-
- # refetch release
- rel=$(get_release "$spec")
fi
- echo "$spec" >> "$tmpd/$rel"
-done
-# round 2: commit the changes
-n="$(echo -e '\nn')"
-n="${n%%n}"
-for rel in $(ls "$tmpd" 2>/dev/null); do
- packages=$(cat "$tmpd/$rel")
- for pkg in $packages; do
- pkgdir=${pkg%/*}
- spec=${pkg##*/}
- msg=""
- [ -n "$message" ] && msg="$msg- $message$n"
- msg="$msg- release ${rel%%%*} (by relup.sh)"
- echo git commit -m "$msg" $spec
- if [ "$test" != 1 ]; then
- cd $pkgdir
- git commit -m "$msg" $spec
- git push
- cd ..
- fi
- done
+ # commit the changes
+ msg=""
+ [ -n "$message" ] && msg="$msg- $message$n"
+ msg="$msg- release ${rel%%%*} (by relup.sh)"
+ echo git commit -m "$msg" $spec
+ if [ "$test" != 1 ]; then
+ cd $pkgdir
+ git commit -m "$msg" $spec
+ git push
+ cd ..
+ fi
done
-rm -rf $tmpd
More information about the pld-cvs-commit
mailing list