Only add --allow-releaseinfo-change if apt is new enough
[apt-update.git] / apt-dist-upgrade
index fd11ce2..7413c3f 100755 (executable)
@@ -21,12 +21,17 @@ export LANGUAGE LANG LC_ALL LC_CTYPE
 
 for CHROOT in $CHROOTS
 do
-  if [ $CHROOT = / ] ; then
-      CHR=""
-  else
-      CHR="chroot $CHROOT"
-  fi
-  echo "Running apt-get dist-upgrade in $CHROOT"
-  $CHR apt-get $@ dist-upgrade
-  $CHR apt-get clean
+    case $CHROOT in
+       /)
+           CHR="";;
+       /*)
+           CHR="chroot $CHROOT";;
+       *)
+           CHR="schroot -c $CHROOT --";;
+    esac
+    echo "Running apt-get dist-upgrade in $CHROOT"
+    $CHR apt-get $@ dist-upgrade
+    $CHR apt-get clean
+    echo "Finished dist-upgrade in $CHROOT"
+    echo "======================================"
 done