diff options
Diffstat (limited to 'pbuilder-modules')
-rw-r--r-- | pbuilder-modules | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/pbuilder-modules b/pbuilder-modules index 51becbb..886aa57 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -701,39 +701,39 @@ function binNMU() { return fi if [ -z "$BINNMU_MESSAGE" ]; then - echo "No changelog message provided for binNMU entry." + log.e "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." + log.w "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." + local cl=$(ls "$BUILDPLACE"/"$BUILDDIR"/*/debian/changelog) + local tmpcl=$(mktemp pbuilder.tmpchangelog.XXXXXXXXXXX) + if [ ! -f "$cl" ]; then + log.e "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') + mv "$cl" "$tmpcl" + local package=$(dpkg-parsechangelog -l "$tmpcl" -c 1 --show-field Source) + local version=$(dpkg-parsechangelog -l "$tmpcl" -c 1 --show-field Version) + local arch=$("$CHROOTEXEC" dpkg-architecture -qDEB_HOST_ARCH) local date=$(date -R) if [ -z "$BINNMU_MAINTAINER" ]; then - echo "No maintainer provided for binNMU entry, fall back to last uploader." - BINNMU_MAINTAINER=$changedby + log.w "No maintainer provided for binNMU entry, fall back to last uploader." + BINNMU_MAINTAINER=$(dpkg-parsechangelog -l $tmpcl -c 1 --show-field Maintainer) 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 + cat > "$cl" << EOF +$package ($version+b$BINNMU_VERSION) $DISTRIBUTION; urgency=low + * Binary-only non-maintainer upload for $arch; no source changes. + * $BINNMU_MESSAGE + + -- $BINNMU_MAINTAINER $date + +EOF + cat "$tmpcl" >> "$cl" + rm "$tmpcl" } #Setting environmental variables that are really required: |