]> git.donarmstrong.com Git - neurodebian.git/blob - debian/neurodebian.postinst
0e3a3f535a17b6ecdef90e3fecb7e03f71789c3c
[neurodebian.git] / debian / neurodebian.postinst
1 #!/bin/bash
2
3 set -e
4
5 . /usr/share/debconf/confmodule
6
7
8 case "$1" in
9     configure)
10                 db_get neurodebian/enable
11                 if [ "$RET" = "true" ]; then
12                         # obtain all the options and call nd-configurerepo
13                         opts="--do-not-update"
14                         db_get neurodebian/release; [ "$RET" = "auto" ] || opts+=" -r '$RET'"
15                         db_get neurodebian/mirror;      nd_mirror="${RET##* }" # get just a url if it came together with alias
16                         db_get neurodebian/flavor;      nd_flavor="$RET"
17                         db_get neurodebian/components; nd_components="${RET// /}"
18
19                         db_get neurodebian/overwrite;  [ "$RET" = "true" ] && opts+=" --overwrite" || :
20                         db_get neurodebian/suffix;         [ "$RET" = "" ]         || opts+=" --suffix='$RET'" || :
21
22                         eval nd-configurerepo -m "$nd_mirror" -c "$nd_components" $opts
23                 else
24                         # removing neurodebian APT configs
25                         rm -f /etc/apt/sources.list.d/neurodebian.sources*.list
26                 fi
27         ;;
28         abort-upgrade|abort-remove|abort-deconfigure)
29                 # nothing to do
30         ;;
31
32         *)
33                 echo "postinst called with unknown argument \`$1'" >&2
34                 exit 1
35         ;;
36 esac
37
38 #DEBHELPER#