Add check for valid Debian suite name
authorMichael Prokop <mika@grml.org>
Sun, 2 Aug 2009 23:23:15 +0000 (01:23 +0200)
committerMichael Prokop <mika@grml.org>
Sun, 2 Aug 2009 23:30:19 +0000 (01:30 +0200)
debian/changelog
grml-live

index f558a97..2d7710c 100644 (file)
@@ -17,6 +17,8 @@ grml-live (0.9.20) UNRELEASED; urgency=low
       to be that important for grml).
     - Drop windowlab (see #410618).
     - Drop workbone (see #429178).
+  * Add check for valid Debian suite name to avoid breakage of sources.list
+    if someone calls grml-live with a typo in the -s option.
 
  -- Michael Prokop <mika@grml.org>  Mon, 03 Aug 2009 01:28:48 +0200
 
index 0e2a49d..716fc35 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -378,6 +378,15 @@ if [ -n "$SUITE" ] ; then
    # /usr/share/debootstrap/scripts/unstable does not exist, instead use 'sid':
    case $SUITE in
       unstable) SUITE='sid' ;;
+      # make sure that we *NEVER* write any broken suite name to sources.list,
+      # otherwise we won't be able to adjust it one next (correct) execution
+      stable)   ;;
+      testing)  ;;
+      etch)     ;;
+      lenny)    ;;
+      squeeze)  ;;
+      sid)      ;;
+      *) echo "Sorry, $SUITE is not a valid Debian suite, exiting.">&2; bailout 1 ;;
    esac
 
    DIST=" etch\| stable\| lenny\| squeeze\| testing\| sid\| unstable"