summaryrefslogtreecommitdiffstats
path: root/mga-move-update
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-06-21 15:28:07 +0000
committerNicolas Vigier <boklm@mageia.org>2011-06-21 15:28:07 +0000
commita0e2c8c32b8aa768d40dae508aa8828bee60cfbb (patch)
tree04dc7c519a2bdd174290b6afbd8661b4ff7bb816 /mga-move-update
parentcf6e5a56e2b4d230e20b21845a78589e547b0e04 (diff)
downloadmgatools-a0e2c8c32b8aa768d40dae508aa8828bee60cfbb.tar
mgatools-a0e2c8c32b8aa768d40dae508aa8828bee60cfbb.tar.gz
mgatools-a0e2c8c32b8aa768d40dae508aa8828bee60cfbb.tar.bz2
mgatools-a0e2c8c32b8aa768d40dae508aa8828bee60cfbb.tar.xz
mgatools-a0e2c8c32b8aa768d40dae508aa8828bee60cfbb.zip
add script to move update from updates_testing to updates repository
Diffstat (limited to 'mga-move-update')
-rw-r--r--mga-move-update64
1 files changed, 64 insertions, 0 deletions
diff --git a/mga-move-update b/mga-move-update
new file mode 100644
index 0000000..3d5e3d9
--- /dev/null
+++ b/mga-move-update
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+. /usr/share/mgatools/functions
+moveupdate_allowed_group=mga-qa
+
+dryrun=echo
+
+if ! isingroup "$allowed_group"
+then
+ echo "You are not in group $allowed_group"
+ exit 1
+fi
+
+distrorelease="$1"
+section="$2"
+srcname="$3"
+if test -z $distrorelease || test -z $section || test -z $srcname
+then
+ echo 'Missing argument' >&2
+ exit 1
+fi
+
+for file in "$distribdir/$distrorelease/SRPMS/$section/updates_testing/"*.rpm
+do
+ fname=$(rpm -qp --qf '%{NAME}' "$file")
+ if [ a"$fname" = a"$srcname" ]
+ then
+ srcpkg=$(basename "$file")
+ break
+ fi
+done
+
+if [ -z $srcpkg ]
+then
+ echo "The package $srcname could not be found in $distrorelease/$section/updates_testing repository." >&2
+ exit 2
+fi
+
+function movepkg()
+{
+ srcdir="$1"
+ destdir="$2"
+ srcpkg="$3"
+ output="$4"
+
+ for file in "$srcdir/"*.rpm
+ do
+ fname=$(rpm -qp --qf '%{SOURCERPM}' "$file")
+ if [ a"$fname" = a"$srcpkg" ]
+ then
+ $dryrun mv -v -f "$file" "$destdir" >> "$output"
+ fi
+ done
+}
+
+mailcontent=$(mktemp)
+for arch in $arches
+do
+ movepkg "$distribdir/$distrorelease/$arch/media/$section/updates_testing" "$distribdir/$distrorelease/$arch/media/$section/updates/" "$srcpkg" "$mailcontent"
+ movepkg "$distribdir/$distrorelease/$arch/media/debug/$section/updates_testing" "$distribdir/$distrorelease/$arch/media/debug/$section/updates/" "$srcpkg" "$mailcontent"
+done
+
+rm -f "$mailcontent"
+