diff options
author | mail_redacted_for_web | 2025-03-23 07:41:49 +0100 |
---|---|---|
committer | mail_redacted_for_web | 2025-03-23 07:41:49 +0100 |
commit | d191e029e5151581beeb1ddd625cfc93f62ae44d (patch) | |
tree | 863cb66f3b6ed46670053252c610988aaf8fce4c | |
parent | fd4c7d2dd302cd64cec57c74536d4dbcada2941d (diff) | |
download | packages.lirion.de-d191e029e5151581beeb1ddd625cfc93f62ae44d.tar.bz2 |
InComm of createrepo script0.6.0
-rw-r--r-- | createrepo/Makefile | 24 | ||||
-rwxr-xr-x | createrepo/bin/createrepo-lirionde | 48 |
2 files changed, 72 insertions, 0 deletions
diff --git a/createrepo/Makefile b/createrepo/Makefile new file mode 100644 index 0000000..abe6d73 --- /dev/null +++ b/createrepo/Makefile @@ -0,0 +1,24 @@ +all: + + +install: copy-bin + + +copy-etc: mkdir-etc + @printf '/etc config file not implemented yes.\n' + @#if [ ! -e /etc/aptly-lirionde/aptly.conf ]; then \ + install -vpm0644 -oroot -groot -t /etc/lirion/aptly.conf ./etc/aptly-lirionde.conf; \ + else printf '/etc/lirion/aptly.conf existing, skipping.\n'; \ + fi + +mkdir-etc: + @printf '/etc config file not implemented yet.\n' + @#install -dvm0755 -oroot -groot /etc/lirion + + + +copy-bin: + @install -vpm0755 -oroot -groot -t /usr/bin bin/createrepo-lirionde + + +.PHONY: mkdir-etc copy-etc copy-bin 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 |