]> piware.de Git - bin.git/blobdiff - build-debian-toolbox
build-debian-toolbox: Enable apt sources by default
[bin.git] / build-debian-toolbox
index 813e8d37d9e0aca033871e40e27f0a8140a5419f..f1e7f8eab90f07c5c31f3ad3307d54c9b6873442 100755 (executable)
@@ -14,8 +14,13 @@ podman exec -it $RELEASE sh -exc '
 # go-faster apt/dpkg
 echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/unsafe-io
 
-# location based redirector gets it wrong with company VPN; also add deb-src
-sed -i "s/deb.debian.org/ftp.de.debian.org/; /^deb\b/ { p; s/^deb/deb-src/ }" /etc/apt/sources.list
+# otherwise installing systemd fails
+umount /var/log/journal
+
+# enable sources
+if [ -e /etc/apt/sources.list.d/debian.sources ]; then
+    sed -i "/^Types:/ s/deb$/deb deb-src/" /etc/apt/sources.list.d/debian.sources
+fi
 
 apt-get update
 apt-get install -y libnss-myhostname sudo eatmydata libcap2-bin
@@ -25,9 +30,6 @@ sed -i "s/nullok_secure/nullok/" /etc/pam.d/common-auth
 '
 
 toolbox run --container $RELEASE sh -exc '
-# otherwise installing systemd fails
-sudo umount /var/log/journal
-
 # useful hostname
 . /etc/os-release
 echo "${ID}-${VERSION_ID:-sid}" | sudo tee /etc/hostname