X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=debian%2Fneurodebian.config;fp=debian%2Fneurodebian.config;h=ef8878606725ed85f2dd55bea90aa0cd56165d7e;hb=441723d6edfc6b868be27bfa4ad63dc7a2fefdb8;hp=ea6f62816a5d6f7d075b84751f2b5f5f7b9ea58b;hpb=6c6fa9cd3bd627a60f165682f96af3cc06d9ccc9;p=neurodebian.git diff --git a/debian/neurodebian.config b/debian/neurodebian.config index ea6f628..ef88786 100755 --- a/debian/neurodebian.config +++ b/debian/neurodebian.config @@ -28,9 +28,23 @@ neurodebian_releases="auto" # This implements a simple state machine so the back button can be handled. # taken from debconf demo example STATE=1 -while [ "$STATE" != 0 -a "$STATE" != 8 ]; do +while [ "$STATE" != 0 -a "$STATE" -lt 9 ]; do case $STATE in - 1) + 1) + # allow to be overridden by environment variable as discussed with + # ftpmaster + if [ ! -z "${NEURODEBIAN_ENABLE:-}" ]; then + case "${NEURODEBIAN_ENABLE}" in + true|yes|YES|1) enable=true;; + false|no|NO|0) enable=false;; + *) echo "ERROR: Non-supported value $NEURODEBIAN_ENABLE of NEURODEBIAN_ENABLE env variable. Use yes or no" >&2; + exit 1;; + esac + db_set neurodebian/enable $enable + fi + db_input high neurodebian/enable || true + ;; + 2) neurodebian_releases="$(ND_IFS=', ' nd-configurerepo --print-releases)" debian_release="$(ND_IFS=', ' nd-configurerepo --print-release)" if [ -z "$debian_release" ]; then # just a failover @@ -41,7 +55,7 @@ while [ "$STATE" != 0 -a "$STATE" != 8 ]; do db_subst neurodebian/release release "$debian_release" db_input medium neurodebian/release || true ;; - 2) + 3) neurodebian_mirrors="$(ND_IFS=', ' nd-configurerepo --print-mirrors)" debug "mirrors: $neurodebian_mirrors" db_subst neurodebian/mirror mirrors "$neurodebian_mirrors" @@ -49,24 +63,36 @@ while [ "$STATE" != 0 -a "$STATE" != 8 ]; do mirror_selection_ret="$RET" debug "mirror select return: <$mirror_selection_ret>" ;; - 3) neurodebian_flavor="$(ND_IFS=', ' nd-configurerepo --print-flavor)" + 4) neurodebian_flavor="$(ND_IFS=', ' nd-configurerepo --print-flavor)" db_subst neurodebian/flavor flavor "$neurodebian_flavor" db_input medium neurodebian/flavor || true ;; - 4) db_input medium neurodebian/components || true ;; - 5) db_input low neurodebian/overwrite || true ;; + 5) db_input medium neurodebian/components || true ;; 6) db_input low neurodebian/suffix || true ;; - 7) db_input medium neurodebian/run-update-note || true ;; + 7) db_input low neurodebian/overwrite || true ;; + 8) db_input medium neurodebian/run-update-note || true ;; esac if db_go; then + case $STATE in + 1) + db_get neurodebian/enable # get new value + if [ "$RET" = "false" ]; then + # no need to proceed with further questions + if ls /etc/apt/sources.list.d/neurodebian.sources*.list &>/dev/null; then + # we have configuration present -- display a note about apt-get update + STATE=8 + else + STATE=100 # just go out -- nothing to do, nothing to inform about + fi + continue + fi;; # Ubuntus managed to remove netselect "to accompany apt-netselect" # https://bugs.launchpad.net/ubuntu/+source/netselect/+bug/337377 # So for now remove this mandatory demanding of netselect for "best", and # rely on logic in nd-configurerepo to select default mirror (currently origin) # as the 'best' # -# case $STATE in -# 2) +# 3) # db_metaget neurodebian/mirror value # selected_mirror="$RET" # # TODOs: @@ -85,7 +111,7 @@ while [ "$STATE" != 0 -a "$STATE" != 8 ]; do # continue; # fi # fi -# esac + esac STATE=$(($STATE + 1)) else STATE=$(($STATE - 1))