summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-07-28 23:23:06 +0100
committerColin Guthrie <colin@mageia.org>2014-07-29 01:42:38 +0100
commit29a5fca67c79bb7bfc7e7b3002d1be4eee607203 (patch)
tree8eb639703b8bc1c6e405800f7849171038d21f0e /functions
parent5acc38d8ff13f871d5b6de3a80a05bf349f1aee8 (diff)
downloadmgatools-29a5fca67c79bb7bfc7e7b3002d1be4eee607203.tar
mgatools-29a5fca67c79bb7bfc7e7b3002d1be4eee607203.tar.gz
mgatools-29a5fca67c79bb7bfc7e7b3002d1be4eee607203.tar.bz2
mgatools-29a5fca67c79bb7bfc7e7b3002d1be4eee607203.tar.xz
mgatools-29a5fca67c79bb7bfc7e7b3002d1be4eee607203.zip
Add some utility scripts to update hdlists.
These are the same scripts that were present on the live server and have thus proven useful. That said, common code has been factored out and centralised and the syntax has been neatened up.
Diffstat (limited to 'functions')
-rw-r--r--functions40
1 files changed, 40 insertions, 0 deletions
diff --git a/functions b/functions
index 53bec75..441eb0a 100644
--- a/functions
+++ b/functions
@@ -35,6 +35,28 @@ function inlist()
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"
@@ -43,6 +65,24 @@ function update_hdlist()
/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()
{
distrorelease="$1"