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