[packages/rpm-build-tools/netns-with-lo-addr] builder: ignore errors from setting ip for lo
atler
atler at pld-linux.org
Mon Oct 27 13:47:20 CET 2025
commit 7279465c7092f524ea4125429675b1785c89c686
Author: Jan Palus <atler at pld-linux.org>
Date: Mon Oct 27 13:35:55 2025 +0100
builder: ignore errors from setting ip for lo
in case ie ipv6 is disabled. bring up lo only if any address was set.
builder.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/builder.sh b/builder.sh
index b79c7cf..4c0fece 100755
--- a/builder.sh
+++ b/builder.sh
@@ -153,7 +153,7 @@ REVERT_BROKEN_UPGRADE="yes"
IP=/sbin/ip
# disable network for rpm build tool, autodetect if it works (doesn't work in chroot and in vserver guest)
-unshare --user --net --map-current-user true 2> /dev/null && NONETWORK="unshare --user --net --map-root-user $SHELL -c 'test -x $IP && $IP a add 127.0.0.1/8 dev lo && $IP a add ::1/128 dev lo noprefixroute && $IP l set lo up; exec unshare --map-user $(id -un) $SHELL'" || NONETWORK=""
+unshare --user --net --map-current-user true 2> /dev/null && NONETWORK="unshare --user --net --map-root-user $SHELL -c 'if test -x $IP; then $IP a add 127.0.0.1/8 dev lo 2> /dev/null && addr=1; $IP a add ::1/128 dev lo noprefixroute 2> /dev/null && addr=1; test -n \"\$addr\" && $IP l set lo up; unset addr; fi; exec unshare --map-user $(id -un) $SHELL'" || NONETWORK=""
if rpm --specsrpm 2>/dev/null; then
FETCH_BUILD_REQUIRES_RPMSPECSRPM="yes"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/f18ba53fe461a697d3615418eaf1545e6f65b4ca
More information about the pld-cvs-commit
mailing list