From b20033f3f63706b6fd6cc92168eb58ff1e97d58d Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 28 Jul 2014 14:50:01 +0100 Subject: Changes made on live clone on valstar as at 28th July 2014 --- MD5SUM | 0 mga-move-backports-nosync | 112 ++++++++++++++++++++++++++++++++++++++ mga-move-backports-sync-mail | 99 ++++++++++++++++++++++++++++++++++ mga-move-cauldron-nosync | 125 +++++++++++++++++++++++++++++++++++++++++++ mga-move-update | 91 ------------------------------- mga-move-update-nosync | 114 +++++++++++++++++++++++++++++++++++++++ mgatools.conf | 2 +- update_hdlists | 36 +++++++++++++ update_hdlists_any | 30 +++++++++++ update_hdlists_backports | 37 +++++++++++++ update_hdlists_cauldron | 30 +++++++++++ 11 files changed, 584 insertions(+), 92 deletions(-) create mode 100644 MD5SUM create mode 100755 mga-move-backports-nosync create mode 100755 mga-move-backports-sync-mail create mode 100755 mga-move-cauldron-nosync delete mode 100644 mga-move-update create mode 100755 mga-move-update-nosync create mode 100755 update_hdlists create mode 100755 update_hdlists_any create mode 100755 update_hdlists_backports create mode 100755 update_hdlists_cauldron diff --git a/MD5SUM b/MD5SUM new file mode 100644 index 0000000..e69de29 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)
" + 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:
" + 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:
" +echo "$srcpkg
" +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)
" + fi + done +} + + +echo "" +echo "moving binary and source rpms:" +mailcontent=$(mktemp) +for arch in $arches +do + echo "" + echo "$arch:
" + 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:
" +echo "$srcpkg
" +echo "" +$dryrun mv -v -f "$distribdir/$distrorelease/SRPMS/$section/backports_testing/$srcpkg" "$distribdir/$distrorelease/SRPMS/$section/backports/" >> "$output" + +$ +mutt -e 'set from="Mageia Backports "' \ + -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)
" + fi + done +} + +echo "" +echo "moving old binary and source rpms to shedbot/old:" +mailcontent=$(mktemp) +for arch in $arches +do + echo "" + echo "$arch:
" + 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:
" +echo "$oldsrcpkg
" +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:
" + 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:
" +echo "$srcpkg
" +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 deleted file mode 100644 index 353b1c3..0000000 --- a/mga-move-update +++ /dev/null @@ -1,91 +0,0 @@ -#!/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/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 -} - -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 -} - -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 -$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 -fi -rm -f "$mailcontent" - diff --git a/mga-move-update-nosync b/mga-move-update-nosync new file mode 100755 index 0000000..ad0782c --- /dev/null +++ b/mga-move-update-nosync @@ -0,0 +1,114 @@ +#!/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/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 + +# 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" + 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)" + 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 +#} + +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" +# +# (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 " 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 -- cgit v1.2.1