git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/createrepo/bin/createrepo-lirionde
diff options
context:
space:
mode:
Diffstat (limited to 'createrepo/bin/createrepo-lirionde')
-rwxr-xr-xcreaterepo/bin/createrepo-lirionde48
1 files changed, 48 insertions, 0 deletions
diff --git a/createrepo/bin/createrepo-lirionde b/createrepo/bin/createrepo-lirionde
new file mode 100755
index 0000000..e1356db
--- /dev/null
+++ b/createrepo/bin/createrepo-lirionde
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+declare -a REPOS
+
+REPOSDEF=( 'all' 'el' 'suse' )
+
+function hayulp {
+ printf 'USAGE: %b [ -r repo [ -r repo ... ] ]\n' "$(basename "$0")"
+ printf '\n'
+ (
+ printf -- '-r,\n'
+ printf -- '--repos;Repo to be published.\n'
+ printf ';Specify multiple times for multiple repositores.\n'
+ printf ';Default: all, el, suse\n'
+ )|column -ts\;
+}
+
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ "-r"|"--repo")
+ REPOS+=( "$2" )
+ shift # past argument
+ shift # past value
+ ;;
+ "-"*)
+ hayulp
+ printf '\nUnknown option: %b\n' "$1" >&2
+ exit 101
+ ;;
+ *)
+ hayulp
+ printf '\nWrong syntax.\n' "$1" >&2
+ exit 101
+ ;;
+ esac
+done
+
+if [ "${#REPOS[@]}" -lt 1 ]; then
+ REPOS=( "${REPOSDEF[@]}" )
+ # if we can't be sure that indexes are sequential ints:
+ # for idx in "${!REPOSDEF[@]}"; do REPOS["$idx"]="${REPOSDEF[$idx]}"; done
+fi
+
+for repo in "${REPOS[@]}"; do
+ faketime "$(date -I) 13:37:08" createrepo_c --update "/var/cache/rpm/$repo" &&\
+ rm -vf "/var/cache/rpm/${repo}/repodata/repomd.xml.asc" &&\
+ faketime "$(date -I) 13:37:08" gpg --local-user 0x5421594BF1AB46F4 --detach-sign --armour "/var/cache/rpm/${repo}/repodata/repomd.xml"
+done