]> git.donarmstrong.com Git - neurodebian.git/blobdiff - debian/neurodebian.postinst
Merge branch 'master' of git://git.debian.org/pkg-exppsy/neurodebian
[neurodebian.git] / debian / neurodebian.postinst
diff --git a/debian/neurodebian.postinst b/debian/neurodebian.postinst
new file mode 100755 (executable)
index 0000000..97cbc86
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+
+case "$1" in
+    configure)
+               # obtain all the options and call nd-configurerepo
+               opts="--do-not-update"
+               db_get neurodebian/release; [ "$RET" = "auto" ] || opts+=" -r '$RET'"
+               db_get neurodebian/mirror;  nd_mirror="${RET##* }" # get just a url if it came together with alias
+               db_get neurodebian/flavor;  nd_flavor="$RET"
+               db_get neurodebian/components; nd_components="${RET// /}"
+
+               db_get neurodebian/overwrite;  [ "$RET" = "true" ] && opts+=" --overwrite" || :
+               db_get neurodebian/suffix;     [ "$RET" = "" ]     || opts+=" --suffix='$RET'" || :
+
+               eval nd-configurerepo -m "$nd_mirror" -c "$nd_components" $opts
+    ;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+        # nothing to do
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#