aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pbuilder-modules')
-rw-r--r--pbuilder-modules40
1 files changed, 40 insertions, 0 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index 2a5a1fe..51becbb 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -696,6 +696,46 @@ function add_additional_aptkeyrings() {
done
}
+function binNMU() {
+ if [ "$BIN_NMU" == "no" ]; then
+ return
+ fi
+ if [ -z "$BINNMU_MESSAGE" ]; then
+ echo "No changelog message provided for binNMU entry."
+ exit 1
+ fi
+ if [ -z "$BINNMU_VERSION" ]; then
+ echo "No version provided for binNMU entry, fall back to 1."
+ BINNMU_VERSION=1
+ fi
+ local cl=$(ls $BUILDPLACE/tmp/buildd/*/debian/changelog)
+ local tmpcl=$cl.pbuildertmp
+ if [ ! -f $cl ]; then
+ echo "Cannot open debian/changelog for binNMU version handling."
+ exit 1
+ fi
+ mv $cl $tmpcl
+ local package=$(head -n1 $tmpcl | cut -d" " -f1)
+ local version=$(head -n1 $tmpcl | sed 's/.*(\(.*\)).*/\1/')
+ local arch=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH)
+ local changedby=$(cat $tmpcl | sed -n '0,/ -- /s/ -- \(.* <.*>\).*/\1/p')
+ local date=$(date -R)
+ if [ -z "$BINNMU_MAINTAINER" ]; then
+ echo "No maintainer provided for binNMU entry, fall back to last uploader."
+ BINNMU_MAINTAINER=$changedby
+ fi
+ DEBBUILDOPTS="${DEBBUILDOPTS} -m\"$BINNMU_MAINTAINER\" -e\"$BINNMU_MAINTAINER\""
+ echo "$package ($version+b$BINNMU_VERSION) $DISTRIBUTION; urgency=low" > $cl
+ echo >> $cl
+ echo " * Binary-only non-maintainer upload for $arch; no source changes." >> $cl
+ echo " * $BINNMU_MESSAGE" >> $cl
+ echo >> $cl
+ echo " -- $BINNMU_MAINTAINER $date" >> $cl
+ echo >> $cl
+ cat $tmpcl >> $cl
+ rm $tmpcl
+}
+
#Setting environmental variables that are really required:
#required for some packages to install...
export LANG=C