# to be sourced # Default values dryrun=echo moveupdate_allowed_group='mga-qa' moveupdate_mailto='sysadmin-reports@ml.mageia.org' requestuser="${SUDO_USER:-$USER}" moveupdate_mailfrom="$requestuser " distribdir='/distrib/bootstrap/distrib' finaldistribdir='/distrib/mirror/distrib' distrosections='core nonfree tainted' distrosubsections='release updates updates_testing backports backports_testing' distroreleases='1 2 3 4' arches='i586 x86_64' mirror_rsync_options="--dry-run -v --delete -alH" [ -f /etc/mgatools.conf ] && . /etc/mgatools.conf function isingroup() { grp="$1" for group in `groups`; do [ "$grp" = "$group" ] && return 0 done return 1 } function inlist() { k="$1" list="$2" for e in $list; do [ "$k" = "$e" ] && return 0 done return 1 } function valid_release() { [ "cauldron" = "$1" ] && return 0 inlist "$1" "$distroreleases" && return 0 echo "Invalid release '$1'" >&2 return 1 } function valid_section() { inlist "$1" "$distrosections" && return 0 echo "Invalid section '$1'" >&2 return 1 } function valid_subsection() { inlist "$1" "$distrosubsections" && return 0 echo "Invalid subsection '$1'" >&2 return 1 } function update_hdlist() { repository="$1" fdeps="$repository/../../media_info/file-deps" test -f "$fdeps" && ofdeps="--file-deps $fdeps" $dryrun /usr/bin/genhdlist2 -v --versioned --allow-empty-media $ofdeps "$repository" } function update_distro_hdlist() { if [ "$1" = "--nocheck" ]; then shift else valid_release "$1" && valid_section "$2" && valid_subsection "$3" || return 1 fi release="$1" section="$2" subsection="$3" for arch in $arches; do update_hdlist "$distribdir/$release/$arch/media/$section/$subsection" update_hdlist "$distribdir/$release/$arch/media/debug/$section/$subsection" done update_hdlist "$distribdir/$release/SRPMS/$section/$subsection" } function update_common_MD5SUM() { release="$1" for arch in $arches; do pushd "$distribdir/$release/$arch/media/media_info" $dryrun /bin/sh -c "/usr/bin/md5sum hdlist_* synthesis.* >MD5SUM" popd done } function mirror_repository() { release="$1" /usr/bin/rsync $mirror_rsync_options "$distribdir/$release/" "$finaldistribdir/$release/" }