Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-05-17 11:21:57 +0200
committerErich Eckner <git@eckner.net>2017-05-17 11:21:57 +0200
commitca36b4abdb65eddcc6facca5da2d6fc4b33348ab (patch)
treea5a80271e95671d34eb169fa89c5eebea96da0b3
parent41df00bbbc035c4900702488d3875159e23ce49c (diff)
bin/return-assignment: add exit codes
-rwxr-xr-xbin/return-assignment13
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index 7893c14..3468f49 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -7,6 +7,11 @@
# or on failure via:
# "$0 $package $revision $mod_revision $repository ERROR"
+# exit codes:
+# 0: ok
+# 1: outdated package
+# 2: signature error
+
# TODO:
# use lock file(s)
# remove old version(s) of newly compiled packages
@@ -66,22 +71,22 @@ signature_errors="$(
sed 's|\.sig$||' | \
sort | \
uniq -c | \
- grep '^\s*2\s' | \
+ grep -v '^\s*2\s' | \
awk '{print $2}'
)"
if [ -n "${signature_errors}" ]; then
>&2 echo 'The following packages lack a signature or vice versa:'
>&2 echo "${signature_errors}"
- exit 1
+ exit 2
fi
# move packages
packages=(*.pkg.tar.xz)
mkdir -p "${master_mirror_directory}/i486/$4-staging/"
-mv "*.pkg.tar.xz{,.sig}" "${master_mirror_directory}/i486/$4-staging/"
+mv *.pkg.tar.xz{,.sig} "${master_mirror_directory}/i486/$4-staging/"
-pushd "${master_mirror_directory}/i486" > /dev/null
+pushd "${master_mirror_directory}/i486/$4-staging" > /dev/null
repo-add -v -s -k "${repo_key}" "$4-staging.db.tar.gz" "${packages[@]}"
popd > /dev/null