aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-11-15 14:57:45 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-11-15 15:01:07 +0000
commitf711827cef4628a8caed03e3d8bb2b6b825345ce (patch)
tree847f26c2bea82fc59499548c83f6af855be5fb2a
parent71b10936ac3430564ef9fed06b3f39b7fd6dd1a1 (diff)
downloadpbuilder-f711827cef4628a8caed03e3d8bb2b6b825345ce.tar
pbuilder-f711827cef4628a8caed03e3d8bb2b6b825345ce.tar.gz
modules: copy /etc/resolv.conf from the host only when USENETWORK=yes
Closes: #753944
-rw-r--r--pbuilder-modules6
1 files changed, 5 insertions, 1 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index d842687..93916bb 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -468,7 +468,11 @@ function copy_local_configuration () {
if [ -n "$CONFDIR" ] && [ -d "$CONFDIR" ]; then
log.i "copying files from $CONFDIR (if possible) instead of using the system ones"
fi
- for a in hosts hostname resolv.conf mailname; do
+ local tocopy=(hosts hostname mailname)
+ if [ "$USENETWORK" = "yes" ]; then
+ local tocopy[${#tocopy[@]}]=resolv.conf
+ fi
+ for a in "${tocopy[@]}"; do
if [ -n "$CONFDIR" ] && [ -f "$CONFDIR/$a" ]; then
rm -f "$BUILDPLACE/etc/$a"
cp "$( readlink -f "$CONFDIR/$a" )" "$BUILDPLACE/etc/$a"