summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-01-07 19:48:32 +0100
committerDaniel Baumann <daniel@debian.org>2012-01-07 19:59:55 +0100
commite3c9db7a2ba4f9a53f95dd5a2095d3085dfc055c (patch)
tree217ea7c5a44e1f56416ab28a05a74ec169cbab71
parentac004b56d239e88caa3edd986db8a24e7727a458 (diff)
downloadvyos-live-build-e3c9db7a2ba4f9a53f95dd5a2095d3085dfc055c.tar.gz
vyos-live-build-e3c9db7a2ba4f9a53f95dd5a2095d3085dfc055c.zip
Fix unconditional overwriting of /etc/apt/preferences.d/progress.pref in progress mode.
-rwxr-xr-xscripts/build/lb_chroot_apt41
1 files changed, 22 insertions, 19 deletions
diff --git a/scripts/build/lb_chroot_apt b/scripts/build/lb_chroot_apt
index 81990b12f..565cb0a64 100755
--- a/scripts/build/lb_chroot_apt
+++ b/scripts/build/lb_chroot_apt
@@ -148,29 +148,31 @@ case "${1}" in
case "${LB_MODE}" in
progress)
- echo "# /etc/apt/preferences.d/progress.pref" > chroot/etc/apt/preferences.d/progress.pref
-
- case "${LB_DISTRIBUTION}" in
- *-backports)
- _DISTRIBUTIONS="$(echo ${LB_DISTRIBUTION} | sed -e 's|-backports||') ${LB_DISTRIBUTION}"
- ;;
-
- *)
- _DISTRIBUTIONS="${LB_DISTRIBUTION}"
- ;;
- esac
-
- if [ "${LB_SECURITY}" = "true" ]
+ if [ ! -e chroot/etc/apt/preferences.d/progress.pref ]
then
+ echo "# /etc/apt/preferences.d/progress.pref" > chroot/etc/apt/preferences.d/progress.pref
+
case "${LB_DISTRIBUTION}" in
- artax)
- _DISTRIBUTION="${_DISTRIBUTION} ${LB_DISTRIBUTION}-security"
+ *-backports)
+ _DISTRIBUTIONS="$(echo ${LB_DISTRIBUTION} | sed -e 's|-backports||') ${LB_DISTRIBUTION}"
+ ;;
+
+ *)
+ _DISTRIBUTIONS="${LB_DISTRIBUTION}"
;;
esac
- fi
- for _DISTRIBUTION in ${_DISTRIBUTIONS}
- do
+ if [ "${LB_SECURITY}" = "true" ]
+ then
+ case "${LB_DISTRIBUTION}" in
+ artax)
+ _DISTRIBUTION="${_DISTRIBUTION} ${LB_DISTRIBUTION}-security"
+ ;;
+ esac
+ fi
+
+ for _DISTRIBUTION in ${_DISTRIBUTIONS}
+ do
cat >> chroot/etc/apt/preferences.d/progress.pref << EOF
@@ -179,7 +181,8 @@ Pin: release n=${_DISTRIBUTION}
Pin-Priority: 999
EOF
- done
+ done
+ fi
;;
esac