diff options
author | Colin Guthrie <colin@mageia.org> | 2014-07-28 14:50:01 +0100 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-07-28 14:50:01 +0100 |
commit | b20033f3f63706b6fd6cc92168eb58ff1e97d58d (patch) | |
tree | df7724e6e454038ee40193d665bc93fe583e38e9 | |
parent | f532a717bedc0282204b3dd48871e810bb0cb79f (diff) | |
download | mgatools-b20033f3f63706b6fd6cc92168eb58ff1e97d58d.tar mgatools-b20033f3f63706b6fd6cc92168eb58ff1e97d58d.tar.gz mgatools-b20033f3f63706b6fd6cc92168eb58ff1e97d58d.tar.bz2 mgatools-b20033f3f63706b6fd6cc92168eb58ff1e97d58d.tar.xz mgatools-b20033f3f63706b6fd6cc92168eb58ff1e97d58d.zip |
Changes made on live clone on valstar as at 28th July 2014topic/valstar
-rw-r--r-- | MD5SUM | 0 | ||||
-rwxr-xr-x | mga-move-backports-nosync | 112 | ||||
-rwxr-xr-x | mga-move-backports-sync-mail | 99 | ||||
-rwxr-xr-x | mga-move-cauldron-nosync | 125 | ||||
-rwxr-xr-x[-rw-r--r--] | mga-move-update-nosync (renamed from mga-move-update) | 57 | ||||
-rw-r--r-- | mgatools.conf | 2 | ||||
-rwxr-xr-x | update_hdlists | 36 | ||||
-rwxr-xr-x | update_hdlists_any | 30 | ||||
-rwxr-xr-x | update_hdlists_backports | 37 | ||||
-rwxr-xr-x | update_hdlists_cauldron | 30 |
10 files changed, 510 insertions, 18 deletions
diff --git a/mga-move-backports-nosync b/mga-move-backports-nosync new file mode 100755 index 0000000..773a2fc --- /dev/null +++ b/mga-move-backports-nosync @@ -0,0 +1,112 @@ +#!/bin/sh + +. /usr/share/mgatools/functions + +if [ $# != 3 ] +then + echo 'Usage: mga-move-update distrorelease section srcname' >&2 + exit 1 +fi + +distrorelease="$1" +section="$2" +srcname="$3" + +if ! inlist "$distrorelease" "$distroreleases" +then + echo "Incorrect distrorelease $distrorelease" >&2 + exit 1 +fi + +if ! inlist "$section" "$distrosections" +then + echo "Incorrect section $section" >&2 + exit 1 +fi + +for file in "$distribdir/$distrorelease/SRPMS/$section/backports_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/backports_testing repository." >&2 + exit 2 +fi + +# safety check +echo " This SRPM (and matching binarys) will be moved from backports_testing to backports: $srcpkg" >&2 + +read -p " Are you sure ? " yn >&2 + +case $yn in + [Yy]* ) continue;; + * ) exit;; +esac + +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" + echo "$(basename $file)<br/>" + fi + done +} + +#function post() +#{ +# for arch in $arches +# do +# update_hdlist "$distribdir/$distrorelease/$arch/media/$section/backports_testing" +# update_hdlist "$distribdir/$distrorelease/$arch/media/$section/backports" +# update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/backports_testing" +# update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/backports" +# done +# update_hdlist "$distribdir/$distrorelease/SRPMS/$section/backports_testing" +# update_hdlist "$distribdir/$distrorelease/SRPMS/$section/backports" +# update_common_MD5SUM $distrorelease +# mirror_repository $distrorelease +#} + +echo "" +echo "moving binary and source rpms:" +mailcontent=$(mktemp) +for arch in $arches +do + echo "" + echo "$arch:<br/>" + movepkg "$distribdir/$distrorelease/$arch/media/$section/backports_testing" "$distribdir/$distrorelease/$arch/media/$section/backports/" "$srcpkg" "$mailcontent" + movepkg "$distribdir/$distrorelease/$arch/media/debug/$section/backports_testing" "$distribdir/$distrorelease/$arch/media/debug/$section/backports/" "$srcpkg" "$mailcontent" +done +echo "" +echo "SRPMS:<br/>" +echo "$srcpkg<br/>" +echo "" +$dryrun mv -v -f "$distribdir/$distrorelease/SRPMS/$section/backports_testing/$srcpkg" "$distribdir/$distrorelease/SRPMS/$section/backports/" >> "$output" + +if [ -n "$dryrun" ] +then + cat "$mailcontent" +else + /usr/bin/mailx -s "mga-move-update $distrorelease $section $srcname" -S "from=moveupdate_mailfrom" "$moveupdate_mailto" < "$mailcontent" +# +# (tmb) dont do post before all rpms are moved, call update_hdlists manually +# post +fi +rm -f "$mailcontent" diff --git a/mga-move-backports-sync-mail b/mga-move-backports-sync-mail new file mode 100755 index 0000000..a91c06d --- /dev/null +++ b/mga-move-backports-sync-mail @@ -0,0 +1,99 @@ +#!/bin/sh + +. /usr/share/mgatools/functions + +if [ $# != 4 ] +then + echo 'Usage: mga-move-backports-sync-mail distrorelease section srcname bugnumber' >&2 + exit 1 +fi + +distrorelease="$1" +section="$2" +srcname="$3" +bugnumber="$4" + +export SIG="https://bugs.mageia.org/show_bug.cgi?id=$4" + + +if ! inlist "$distrorelease" "$distroreleases" +then + echo "Incorrect distrorelease $distrorelease" >&2 + exit 1 +fi + +if ! inlist "$section" "$distrosections" +then + echo "Incorrect section $section" >&2 + exit 1 +fi + +for file in "$distribdir/$distrorelease/SRPMS/$section/backports_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/backports_testing repository." >&2 + exit 2 +fi + +# safety check +echo " This SRPM (and matching binarys) will be moved from backports_testing to backports: $srcpkg" >&2 + +read -p " Are you sure ? " yn >&2 + +case $yn in + [Yy]* ) continue;; + * ) exit;; +esac + +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" + echo "$(basename $file)<br/>" + fi + done +} + + +echo "" +echo "moving binary and source rpms:" +mailcontent=$(mktemp) +for arch in $arches +do + echo "" + echo "$arch:<br/>" + movepkg "$distribdir/$distrorelease/$arch/media/$section/backports_testing" "$distribdir/$distrorelease/$arch/media/$section/backports/" "$srcpkg" "$mailcontent" + movepkg "$distribdir/$distrorelease/$arch/media/debug/$section/backports_testing" "$distribdir/$distrorelease/$arch/media/debug/$section/backports/" "$srcpkg" "$mailcontent" +done +echo "" +echo "SRPMS:<br/>" +echo "$srcpkg<br/>" +echo "" +$dryrun mv -v -f "$distribdir/$distrorelease/SRPMS/$section/backports_testing/$srcpkg" "$distribdir/$distrorelease/SRPMS/$section/backports/" >> "$output" + +$ +mutt -e 'set from="Mageia Backports <buildsystem-daemon@mageia.org>"' \ + -e 'set signature="echo $SIG|"' \ + -e 'set sig_dashes=no' \ + backports-announce@ml.mageia.org -s "Package backport: Mga $1/$2: $3" \ + -i $mailcontent +rm -f "$mailcontent" diff --git a/mga-move-cauldron-nosync b/mga-move-cauldron-nosync new file mode 100755 index 0000000..3920c5f --- /dev/null +++ b/mga-move-cauldron-nosync @@ -0,0 +1,125 @@ +#!/bin/sh + +. /usr/share/mgatools/functions + +if [ $# != 2 ] +then + echo 'Usage: mga-move-cauldron-nosync section srcname' >&2 + exit 1 +fi + +section="$1" +srcname="$2" + + +if ! inlist "$section" "$distrosections" +then + echo "Incorrect section $section" >&2 + exit 1 +fi + +# old package +for file in "$distribdir/cauldron/SRPMS/$section/release/"*.rpm +do + fname=$(rpm -qp --qf '%{NAME}' "$file") + if [ a"$fname" = a"$srcname" ] + then + oldsrcpkg=$(basename "$file") + break + fi +done + +if [ -z $oldsrcpkg ] +then + echo "The package $srcname could not be found in cauldron/$section/release repository." >&2 +fi + +# new package +for file in "$distribdir/cauldron/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 cauldron/$section/updates_testing repository." >&2 +fi + +# safety check +echo " This SRPM (and matching binarys) will be removed from release to old: $oldsrcpkg" >&2 + +echo " This SRPM (and matching binarys) will be moved from updates_testing to release: $srcpkg" >&2 + +read -p " Are you sure ? " yn >&2 + +case $yn in + [Yy]* ) continue;; + * ) exit;; +esac + +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" + echo "$(basename $file)<br/>" + fi + done +} + +echo "" +echo "moving old binary and source rpms to shedbot/old:" +mailcontent=$(mktemp) +for arch in $arches +do + echo "" + echo "$arch:<br/>" + movepkg "$distribdir/cauldron/$arch/media/$section/release" "/var/lib/schedbot/old/" "$oldsrcpkg" "$mailcontent" + movepkg "$distribdir/cauldron/$arch/media/debug/$section/release" "/var/lib/schedbot/old/" "$oldsrcpkg" "$mailcontent" +done +echo "" +echo "SRPMS:<br/>" +echo "$oldsrcpkg<br/>" +echo "" +$dryrun mv -v -f "$distribdir/cauldron/SRPMS/$section/updates_testing/$srcpkg" "$distribdir/cauldron/SRPMS/$section/release/" >> "$output" + +echo "" +echo "moving binary and source rpms:" +mailcontent=$(mktemp) +for arch in $arches +do + echo "" + echo "$arch:<br/>" + movepkg "$distribdir/cauldron/$arch/media/$section/updates_testing" "$distribdir/cauldron/$arch/media/$section/release/" "$srcpkg" "$mailcontent" + movepkg "$distribdir/cauldron/$arch/media/debug/$section/updates_testing" "$distribdir/cauldron/$arch/media/debug/$section/release/" "$srcpkg" "$mailcontent" +done +echo "" +echo "SRPMS:<br/>" +echo "$srcpkg<br/>" +echo "" +$dryrun mv -v -f "$distribdir/cauldron/SRPMS/$section/updates_testing/$srcpkg" "$distribdir/cauldron/SRPMS/$section/release/" >> "$output" + +if [ -n "$dryrun" ] +then + cat "$mailcontent" +else + /usr/bin/mailx -s "mga-move-update cauldron $section $srcname" -S "from=moveupdate_mailfrom" "$moveupdate_mailto" < "$mailcontent" +# +# (tmb) dont do post before all rpms are moved, call update_hdlists manually +# post +fi +rm -f "$mailcontent" diff --git a/mga-move-update b/mga-move-update-nosync index 353b1c3..ad0782c 100644..100755 --- a/mga-move-update +++ b/mga-move-update-nosync @@ -40,6 +40,18 @@ then exit 2 fi +# safety check +echo " This SRPM (and matching binarys) will be moved from updates_testing to updates:" >&2 +echo " " >&2 +echo " $srcpkg" >&2 +echo " " >&2 +read -p " Are you sure ? " yn >&2 + +case $yn in + [Yy]* ) continue;; + * ) exit;; +esac + function movepkg() { srcdir="$1" @@ -48,44 +60,55 @@ function movepkg() 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" + echo "$(basename $file)" fi done } -function post() -{ - for arch in $arches - do - update_hdlist "$distribdir/$distrorelease/$arch/media/$section/updates_testing" - update_hdlist "$distribdir/$distrorelease/$arch/media/$section/updates" - update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/updates_testing" - update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/updates" - done - update_hdlist "$distribdir/$distrorelease/SRPMS/$section/updates_testing" - update_hdlist "$distribdir/$distrorelease/SRPMS/$section/updates" - update_common_MD5SUM $distrorelease - mirror_repository $distrorelease -} +#function post() +#{ +# for arch in $arches +# do +# update_hdlist "$distribdir/$distrorelease/$arch/media/$section/updates_testing" +# update_hdlist "$distribdir/$distrorelease/$arch/media/$section/updates" +# update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/updates_testing" +# update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/updates" +# done +# update_hdlist "$distribdir/$distrorelease/SRPMS/$section/updates_testing" +# update_hdlist "$distribdir/$distrorelease/SRPMS/$section/updates" +# update_common_MD5SUM $distrorelease +# mirror_repository $distrorelease +#} +echo "" +echo "moving binary and source rpms:" mailcontent=$(mktemp) for arch in $arches do + echo "" + echo "$arch:" 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 +echo "" +echo "SRPMS:" +echo "$srcpkg" +echo "" $dryrun mv -v -f "$distribdir/$distrorelease/SRPMS/$section/updates_testing/$srcpkg" "$distribdir/$distrorelease/SRPMS/$section/updates/" >> "$output" if [ -n "$dryrun" ] then cat "$mailcontent" else - /usr/bin/mailx -s "mga-move-update $distrorelease $section $srcname" -S "from=moveupdate_mailfrom" "$moveupdate_mailto" < "$mailcontent" - post + /usr/bin/mailx -s "mga-move-update $distrorelease $section $srcname" -S "from=$moveupdate_mailfrom" "$moveupdate_mailto" < "$mailcontent" +# +# (tmb) dont do post before all rpms are moved, call update_hdlists manually +# post fi rm -f "$mailcontent" - diff --git a/mgatools.conf b/mgatools.conf index 6467b35..86964b8 100644 --- a/mgatools.conf +++ b/mgatools.conf @@ -10,7 +10,7 @@ fi moveupdate_mailfrom="$requestuser <root@mageia.org>" distribdir=/distrib/bootstrap/distrib finaldistribdir=/distrib/mirror/distrib -distroreleases='1' +distroreleases='1 2 3' distrosections='core nonfree tainted' arches='i586 x86_64' mirror_rsync_options="--dry-run --delete -alH" diff --git a/update_hdlists b/update_hdlists new file mode 100755 index 0000000..e046a22 --- /dev/null +++ b/update_hdlists @@ -0,0 +1,36 @@ +#!/bin/sh + +. /usr/share/mgatools/functions + +if [ $# != 2 ] +then + echo 'Usage: update_hdlists distrorelease section' >&2 + exit 1 +fi + +distrorelease="$1" +section="$2" + +#if ! inlist "$distrorelease" "$distroreleases" +#then +# echo "Incorrect distrorelease $distrorelease" >&2 +# exit 1 +#fi + +if ! inlist "$section" "$distrosections" +then + echo "Incorrect section $section" >&2 + exit 1 +fi + +for arch in $arches + do + update_hdlist "$distribdir/$distrorelease/$arch/media/$section/updates_testing" + update_hdlist "$distribdir/$distrorelease/$arch/media/$section/updates" + update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/updates_testing" + update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/updates" + done + update_hdlist "$distribdir/$distrorelease/SRPMS/$section/updates_testing" + update_hdlist "$distribdir/$distrorelease/SRPMS/$section/updates" + update_common_MD5SUM $distrorelease + mirror_repository $distrorelease diff --git a/update_hdlists_any b/update_hdlists_any new file mode 100755 index 0000000..4687c07 --- /dev/null +++ b/update_hdlists_any @@ -0,0 +1,30 @@ +#!/bin/sh + +. /usr/share/mgatools/functions + +if [ $# != 3 ] +then + echo 'Usage: update_hdlists_any distro media section' >&2 + exit 1 +fi + +distro="$1" +media="$2" +section="$3" + + +if ! inlist "$media" "$distrosections" +then + echo "Incorrect section $media" >&2 + exit 1 +fi + +for arch in $arches + do + update_hdlist "$distribdir/$distro/$arch/media/$media/$section" + update_hdlist "$distribdir/$distro/$arch/media/debug/$media/$section" + done + + update_hdlist "$distribdir/$distro/SRPMS/$media/$section" + update_common_MD5SUM $distro + mirror_repository $distro diff --git a/update_hdlists_backports b/update_hdlists_backports new file mode 100755 index 0000000..c9a17cb --- /dev/null +++ b/update_hdlists_backports @@ -0,0 +1,37 @@ +#!/bin/sh + +. /usr/share/mgatools/functions + +if [ $# != 2 ] +then + echo 'Usage: update_hdlists_backports distrorelease section' >&2 + exit 1 +fi + +distrorelease="$1" +section="$2" + +#if ! inlist "$distrorelease" "$distroreleases" +#then +# echo "Incorrect distrorelease $distrorelease" >&2 +# exit 1 +#fi + +if ! inlist "$section" "$distrosections" +then + echo "Incorrect section $section" >&2 + exit 1 +fi + +for arch in $arches + do + update_hdlist "$distribdir/$distrorelease/$arch/media/$section/backports_testing" + update_hdlist "$distribdir/$distrorelease/$arch/media/$section/backports" + update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/backports_testing" + update_hdlist "$distribdir/$distrorelease/$arch/media/debug/$section/backports" + done + + update_hdlist "$distribdir/$distrorelease/SRPMS/$section/backports_testing" + update_hdlist "$distribdir/$distrorelease/SRPMS/$section/backports" + update_common_MD5SUM $distrorelease + mirror_repository $distrorelease diff --git a/update_hdlists_cauldron b/update_hdlists_cauldron new file mode 100755 index 0000000..6c2241f --- /dev/null +++ b/update_hdlists_cauldron @@ -0,0 +1,30 @@ +#!/bin/sh + +. /usr/share/mgatools/functions + +if [ $# != 1 ] +then + echo 'Usage: update_hdlists_cauldron section' >&2 + exit 1 +fi + +section="$1" + +if ! inlist "$section" "$distrosections" +then + echo "Incorrect section $section" >&2 + exit 1 +fi + +for arch in $arches + do + update_hdlist "$distribdir/cauldron/$arch/media/$section/updates_testing" + update_hdlist "$distribdir/cauldron/$arch/media/$section/release" + update_hdlist "$distribdir/cauldron/$arch/media/debug/$section/updates_testing" + update_hdlist "$distribdir/cauldron/$arch/media/debug/$section/release" + done + + update_hdlist "$distribdir/cauldron/SRPMS/$section/updates_testing" + update_hdlist "$distribdir/cauldron/SRPMS/$section/release" + update_common_MD5SUM cauldron + mirror_repository cauldron |