diff options
Diffstat (limited to '')
-rwxr-xr-x | bin/reprepro_add.sh | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/bin/reprepro_add.sh b/bin/reprepro_add.sh new file mode 100755 index 0000000..2fe3c89 --- /dev/null +++ b/bin/reprepro_add.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +set -e + +HOSTNAME="$(hostname -f)" + +Irk () +{ + MESSAGE="${1}" + + for CHANNEL in progress-linux bfh-linux-systems + do + irk irc://irc.oftc.net:7000/${CHANNEL} ${MESSAGE} + done +} + +case "$(basename ${PWD})" in + *_arm64) + _ARCH="arm64" + ;; + + *_armel) + _ARCH="armel" + ;; + + *_armhf) + _ARCH="armhf" + ;; + + *_amd64) + _ARCH="amd64" + ;; + + *_i386) + _ARCH="i386" + ;; + + *_all) + _ARCH="all" + ;; +esac + +#_DIST="$(cd ../../../ && echo $(basename ${PWD}))" +_DIST="$(grep -m1 '^Distribution: ' *.changes | awk '{ print $2 }')" + +_PACKAGE="$(basename *.changes .changes | awk -F_ '{ print $1 }')" + +# HACK +_POOL="/srv/${HOSTNAME}/packages" + +if ls *.dsc > /dev/null 2>&1 +then + echo "### Removing ${_PACKAGE} sources..." + + # Remove source and binary upload + reprepro -b ${_POOL} removesrc ${_DIST} $(basename *.changes .changes | awk -F_ '{ print $1 }') || true +else + echo "### Removing ${_PACKAGE} binary..." + + # Remove binary upload + reprepro -b ${_POOL} --architecture ${_ARCH} remove ${_DIST} $(basename *.changes .changes | awk -F_ '{ print $1 }') || true +fi + +echo "### Including ${_PACKAGE} upload..." +reprepro -b ${_POOL} ${_REPREPRO_OPTIONS} include ${_DIST} *.changes + +if [ "${1}" != "quiet" ] +then + _SOURCE="$(grep -m1 '^Source: ' *.changes | awk '{ print $2 }')" + _VERSION="$(grep -m1 '^Version: ' *.changes | awk '{ print $2 }')" + _URGENCY="$(grep -m1 '^Urgency: ' *.changes | awk '{ print $2 }')" + _DISTRIBUTION="$(grep -m1 '^Distribution: ' *.changes | awk '{ print $2 }')" + _ARCHITECTURE="$(grep -m1 '^Architecture: ' *.changes | awk '{ $1=""; print $0 }' | sed -e 's|^ ||')" + + Irk "\x0300archive-master:\x03 \x0303${_SOURCE}\x03 \x0310${_VERSION}\x03 uploaded with urgency \x0307${_URGENCY}\x03 to \x0312${_DISTRIBUTION}\x03 (${_ARCHITECTURE}) \x0305http://sources.progress-linux.org/gitweb/?p=releases/${_DISTRIBUTION}/packages/${_SOURCE}.git\x03" +fi |