[pkg-dhcp-commits] [SCM] ISC DHCP packaging for Debian branch, master, updated. debian/4.1.1-P1-16.1-44-g361ccd8
Andrew Pollock
apollock at debian.org
Mon Aug 29 05:17:49 UTC 2011
The following commit has been merged in the master branch:
commit 471f3590a5a1c771b5895bafc3636679e58a96f4
Author: Andrew Pollock <apollock at debian.org>
Date: Sun Aug 28 22:10:33 2011 -0700
Eliminate sed error message
If no interfaces are supplied to the isc-dhcp-server/interfaces question,
the postinst causes an error from sed:
sed: -e expression #1, char 49: invalid reference \1 on `s' command's RHS
Just don't bother doing any of the substitutions if there's nothing to
substitute it with.
Also quote a variable and eliminate some backticks.
diff --git a/debian/isc-dhcp-server.postinst b/debian/isc-dhcp-server.postinst
index cd326d5..ab0b984 100644
--- a/debian/isc-dhcp-server.postinst
+++ b/debian/isc-dhcp-server.postinst
@@ -24,7 +24,7 @@ esac
# Handle debconf
. /usr/share/debconf/confmodule
-INITCONFFILE=/etc/default/isc-dhcp-server
+INITCONFFILE="/etc/default/isc-dhcp-server"
# We generate several files during the postinst, and we don't want
# them to be readable only by root.
@@ -63,11 +63,13 @@ EOFMAGICNUMBER1234
db_get isc-dhcp-server/interfaces || true
INTERFACES="${RET}"
-TMPFILE=`mktemp -q ${INITCONFFILE}.new.XXXXXX`
-sed -e "s,^[[:space:]]*INTERFACES[[:space:]]*=.*,INTERFACES=\"${INTERFACES}\"," \
- <${INITCONFFILE} >${TMPFILE}
-cp ${TMPFILE} ${INITCONFFILE}
-rm ${TMPFILE}
+if [ -n "$INTERFACES" ]; then
+ TMPFILE="$(mktemp -q ${INITCONFFILE}.new.XXXXXX)"
+ sed -e "s,^[[:space:]]*INTERFACES[[:space:]]*=.*,INTERFACES=\"${INTERFACES}\"," \
+ <${INITCONFFILE} >${TMPFILE}
+ cp ${TMPFILE} ${INITCONFFILE}
+ rm ${TMPFILE}
+fi
# ------------------------- Debconf questions end ---------------------
db_stop
--
ISC DHCP packaging for Debian
More information about the pkg-dhcp-commits
mailing list