Merge changes into post-tag revision debian
authorPaul Crowley <paul@lshift.net>
Wed, 02 Dec 2009 17:46:28 +0000
branchdebian
changeset 228 f98f716b2ae8
parent 210 77dfeac3d8bf (current diff)
parent 224 caf9cb61f856 (diff)
child 229 3a28047ec6dc
Merge changes into post-tag revision
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/config	Wed Dec 02 17:46:28 2009 +0000
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+# Load debconf
+. /usr/share/debconf/confmodule
+
+db_input medium mercurial-server/purge_repositories || true
+
+db_go || true
+
+exit 0
+
--- a/debian/control	Thu Nov 12 11:24:50 2009 +0000
+++ b/debian/control	Wed Dec 02 17:46:28 2009 +0000
@@ -11,8 +11,8 @@
 Package: mercurial-server
 Architecture: all
 Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, adduser, python, mercurial, openssh-server | ssh-server
-Description: provide and manage a shared Mercurial repository
+Description: shared Mercurial repository service
  mercurial-server makes a group of repositories available to the developers
- you choose, identified by ssh keys, with easy key and access management
- based on mercurial.
+ you choose, identified by SSH keys, with easy key and access management
+ based on Mercurial.
 
--- a/debian/postinst	Thu Nov 12 11:24:50 2009 +0000
+++ b/debian/postinst	Wed Dec 02 17:46:28 2009 +0000
@@ -1,25 +1,13 @@
 #!/bin/sh
 # postinst script for mercurial-server
-#
-# see: dh_installdeb(1)
 
 set -e
 
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <postinst> `abort-remove'
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
+# Load debconf
+. /usr/share/debconf/confmodule
 
 case "$1" in
-    configure)
+    configure|reconfigure)
         if ! getent passwd hg >/dev/null; then
             adduser --disabled-password --quiet --system \
                 --shell /bin/sh --group \
@@ -45,4 +33,3 @@
 
 exit 0
 
-
--- a/debian/postrm	Thu Nov 12 11:24:50 2009 +0000
+++ b/debian/postrm	Wed Dec 02 17:46:28 2009 +0000
@@ -1,28 +1,32 @@
 #!/bin/sh
 # postrm script for mercurial-server
-#
-# see: dh_installdeb(1)
 
 set -e
 
-# summary of how this script can be called:
-#        * <postrm> `remove'
-#        * <postrm> `purge'
-#        * <old-postrm> `upgrade' <new-version>
-#        * <new-postrm> `failed-upgrade' <old-version>
-#        * <new-postrm> `abort-install'
-#        * <new-postrm> `abort-install' <old-version>
-#        * <new-postrm> `abort-upgrade' <old-version>
-#        * <disappearer's-postrm> `disappear' <overwriter>
-#          <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
+# Load debconf
+. /usr/share/debconf/confmodule
 
+# Check if the user wants the repositories removed on purging
+remove_repositories_on_purge() {
+  db_get mercurial-server/purge_repositories || RET=false
+  if [ "$RET" = "true" ]; then
+    return 0
+  else
+    return 1
+  fi
+}
 
 case "$1" in
     purge)
-        deluser --quiet --system hg > /dev/null || true
+        if remove_repositories_on_purge; then
+            echo -n "Removing hg user and purging data..."
+            deluser --remove-home --quiet --system hg > /dev/null || true
+        else
+            echo -n "Removing hg user..."
+            deluser --quiet --system hg > /dev/null || true
+        fi
         delgroup --quiet --system hg > /dev/null || true
+        echo done
     ;;
 
     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
@@ -41,4 +45,3 @@
 
 exit 0
 
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/templates	Wed Dec 02 17:46:28 2009 +0000
@@ -0,0 +1,5 @@
+Template: mercurial-server/purge_repositories
+Type: boolean
+Default: false
+Description: Do you want the repositories to be removed when mercurial-server is purged?
+