Changing preseeding of script names such that the exact filename (consisting of full...
authorDaniel Baumann <daniel@debian.org>
Fri, 18 Jan 2013 17:06:02 +0000 (18:06 +0100)
committerDaniel Baumann <daniel@debian.org>
Fri, 18 Jan 2013 17:06:02 +0000 (18:06 +0100)
bin/live-debconfig
scripts/debconfig/multiselect
scripts/debconfig/multiselect.templates

index a9eb91b..f6432e1 100755 (executable)
@@ -34,12 +34,12 @@ Cmdline ()
 
                        --debconfig)
                                # Run all scripts
-                               _SCRIPTS="$(ls /lib/live/debconfig/????-* | grep -v '\.templates$')"
+                               _SCRIPTS="$(cd /lib/live/debconfig && ls ????-* | grep -v '\.templates$')"
                                ;;
 
                        --nodebconfig=*)
                                # Don't run requested scripts
-                               _SCRIPTS="$(ls /lib/live/debconfig/????-* | grep -v '\.templates$')"
+                               _SCRIPTS="$(cd /lib/live/debconfig && ls ????-* | grep -v '\.templates$')"
                                LIVE_NODEBCONFIGS="${_PARAMETER#*nodebconfig=}"
                                ;;
 
@@ -68,7 +68,7 @@ Cmdline ()
        then
                for _DEBCONFIG in $(echo ${LIVE_DEBCONFIGS} | sed -e 's|,| |g')
                do
-                       _SCRIPTS="${_SCRIPTS} $(ls /lib/live/debconfig/????-${_DEBCONFIG} 2> /dev/null || true)"
+                       _SCRIPTS="${_SCRIPTS} ${_DEBCONFIG}"
                done
        fi
 
@@ -77,7 +77,7 @@ Cmdline ()
        then
                for _NODEBCONFIG in $(echo ${LIVE_NODEBCONFIGS} | sed -e 's|,| |g')
                do
-                       _SCRIPTS="$(echo ${_SCRIPTS} | sed -e "s|$(ls /lib/live/debconfig/????-${_NODEBCONFIG} 2> /dev/null || echo nodebconfig)||")"
+                       _SCRIPTS="$(echo ${_SCRIPTS} | sed -e "s|${_NODEBCONFIG}||")"
                done
        fi
 }
@@ -162,9 +162,13 @@ Main ()
 
        for _SCRIPT in ${_SCRIPTS}
        do
-               [ "${LIVE_DEBUG}" = "true" ] && echo "[$(date +'%F %T')] live-debconfig: ${_SCRIPT}" >> /var/log/live/debconfig.log
-
-               ${_SCRIPT}
+               if ls /lib/live/debconfig/????-${_SCRIPT} > /dev/null
+               then
+                       [ "${LIVE_DEBUG}" = "true" ] && echo "[$(date +'%F %T')] live-debconfig: ${_SCRIPT}" >> /var/log/live/debconfig.log
+                       /lib/live/debconfig/????-${_SCRIPT}
+               else
+                       echo "W: ${_SCRIPT} - no such script in /lib/live/debconfig, skipping."
+               fi
        done
 }
 
index a26c782..4a56185 100755 (executable)
@@ -17,13 +17,11 @@ export DEBCONF_SYSTEMRC
 
 _CMDLINE="${@}"
 
-_SCRIPTS="$(for _SCRIPT in $(ls /lib/live/debconfig/????-* | grep -v '\.templates$' | sed -e 's|[0-9][0-9][0-9][0-9]-||g' | sort); do echo -n "$(basename ${_SCRIPT}), "; done | sed -e 's|, $||')"
-_SCRIPTS_C="$(for _SCRIPT in $(echo ${_SCRIPTS} | sed -e 's|,| |g'); do echo -n "$(ls /lib/live/debconfig/????-${_SCRIPT}), "; done | sed -e 's|, $||')"
+_SCRIPTS="$(cd /lib/live/debconfig && for _SCRIPT in $(ls ????-* | grep -v '\.templates$' | sed -e 's|[0-9][0-9][0-9][0-9]-||g' | sort); do echo -n "${_SCRIPT}, "; done | sed -e 's|, $||')"
 
 if [ -n "${_SCRIPTS}" ]
 then
        db_subst live-debconfig/scripts CHOICES "${_SCRIPTS}"
-       db_subst live-debconfig/scripts CHOICES_C "${_SCRIPTS_C}"
 
        case "${_CMDLINE}" in
                nodebconfig)
index 5293976..32e430d 100644 (file)
@@ -6,6 +6,5 @@ Template: live-debconfig/scripts
 Type: multiselect
 Default:
 Choices: ${CHOICES}
-Choices-C: ${CHOICES_C}
 Description: live-debconfig: Scripts?
  Which scripts should be run to configure the current system?