aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-11-21 19:43:17 +0000
committerNicolas Vigier <boklm@mageia.org>2011-11-21 19:43:17 +0000
commit33b0276c95e85218c381b5c4edc66f787e1f72ce (patch)
treef5a625d31de3e6c6304bd086b0d7e9bc729fcbb4
parentc452ccaf0e65a9184d5ff63c027a6eb7f4fb6524 (diff)
downloadrepoctl-33b0276c95e85218c381b5c4edc66f787e1f72ce.tar
repoctl-33b0276c95e85218c381b5c4edc66f787e1f72ce.tar.gz
repoctl-33b0276c95e85218c381b5c4edc66f787e1f72ce.tar.bz2
repoctl-33b0276c95e85218c381b5c4edc66f787e1f72ce.tar.xz
repoctl-33b0276c95e85218c381b5c4edc66f787e1f72ce.zip
add genhdlists command
-rwxr-xr-xrepoctl61
1 files changed, 61 insertions, 0 deletions
diff --git a/repoctl b/repoctl
index 75c7eb8..5ceba28 100755
--- a/repoctl
+++ b/repoctl
@@ -71,6 +71,18 @@ repository at the same time. It is however possible to lock all
repositories of a distribution using getdistrolock/rmdistrolock.
EOF
+ ;;
+ genhdlists)
+ cat <<EOF
+Usage: genhdlists [--needed] [--srcrepo distribution/section/sectionrepo]
+
+Options:
+ --srcrepo : rebuild hdilsts from selected repository
+ --needed : rebuild hdlists for all repositories that have been updated
+ without hdlists rebuild.
+
+EOF
+ ;;
esac
}
@@ -247,6 +259,51 @@ function repolock()
$command "${srcrepo[0]}" "${srcrepo[1]}" "${srcrepo[2]}"
}
+function genhdlists()
+{
+ args=$(getopt -o h -l srcrepo:,help,needed -- "$@")
+ [ $? -ne 0 ] && usage_cmd genhdlists && exit 1
+ eval set -- "$args"
+ [ $# -lt 1 ] && exit 1
+ while [ $# -gt 0 ]
+ do
+ case $1 in
+ -h|--help)
+ usage_cmd genhdlists
+ exit 0
+ ;;
+ --srcrepo)
+ IFS='/' read -ra srcrepo <<< "$2"
+ shift;shift;;
+ --needed)
+ local needed=1
+ shift;;
+ --)
+ shift;break;;
+ -*)
+ usage
+ exit 1
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ if [ -z "$srcrepo$needed" ]
+ then
+ usage_cmd genhdlists
+ exit 1
+ fi
+ if [ -n "$srcrepo" ]
+ then
+ update_hdlists "${srcrepo[0]}" "${srcrepo[1]}" "${srcrepo[2]}"
+ fi
+ if [ -n "$needed" ]
+ then
+ update_hdlists_if_needed
+ fi
+}
+
function usage()
{
cat <<EOF
@@ -291,6 +348,10 @@ case "$1" in
shift
repolock --rm $@
;;
+ genhdlists)
+ shift
+ genhdlists $@
+ ;;
*)
usage
exit 1