[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.44-836-g931cbb1

Andreas Beckmann debian at abeckmann.de
Thu Jun 21 11:36:57 UTC 2012


The following commit has been merged in the piatti branch:
commit e313a2f9ece394e8ed6086940b856993fa14f91b
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Thu Jun 21 09:33:10 2012 +0200

    p-m/s.deb: create missing homedir if user already exists
    
    if the user already exists in /etc/passwd, adduser won't create a missing
    HOME, so do it manually
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/TODO b/TODO
index 02d8b9a..fc3e662 100644
--- a/TODO
+++ b/TODO
@@ -38,8 +38,6 @@ for 0.46:
 - slave.postinst should setup ~piupartsm/.ssh/authorized_keys using triggers
     dpkg-trigger piuparts-master-please-install-the-slave-key
 
-- piuparts-master package fails install, remove, install.
-
 - split /etc/piuparts/piuparts.conf in /etc/piuparts/master.conf and
   /etc/piuparts/slave.conf?! or use /etc/default/slave to define sections?
 
diff --git a/debian/changelog b/debian/changelog
index 90377c5..d8b9306 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -179,6 +179,8 @@ piuparts (0.45) UNRELEASED; urgency=low
   * Bump debhelper and dpkg dependencies for using dpkg-maintscript-helper.
   * Remove obsolete /etc/piuparts/piuparts.conf from old piuparts package.
   * Ship /etc/piuparts/piuparts.conf in the piuparts-slave package.
+  * Create missing home directories if the piupartsm/piupartss users remain
+    from a previously purged installation.
 
   [ Leo Iannacone ]
   * piuparts.py: add --existing-chroot option, specify a directory as source
diff --git a/debian/piuparts-master.postinst b/debian/piuparts-master.postinst
index 1d92451..e7410aa 100755
--- a/debian/piuparts-master.postinst
+++ b/debian/piuparts-master.postinst
@@ -16,6 +16,11 @@ case "$1" in
         adduser --system --quiet --home $userhome/$user --ingroup $pgroup \
                 --shell /bin/sh $user
 
+	if ! [ -d $userhome/$user ]; then
+		mkdir -m 0755 $userhome/$user
+		chown $user:$pgroup $userhome/$user
+	fi
+
         touch $userhome/$user/.profile
         chown $user:$pgroup $userhome/$user/.profile
 
diff --git a/debian/piuparts-slave.postinst b/debian/piuparts-slave.postinst
index a988e29..9d641f2 100755
--- a/debian/piuparts-slave.postinst
+++ b/debian/piuparts-slave.postinst
@@ -17,6 +17,11 @@ case "$1" in
         adduser --system --quiet --home $userhome/$user --ingroup $pgroup \
                 --shell /bin/sh $user
 
+	if ! [ -d $userhome/$user ]; then
+		mkdir -m 0755 $userhome/$user
+		chown $user:$pgroup $userhome/$user
+	fi
+
         touch $userhome/$user/.profile
         chown $user:$pgroup $userhome/$user/.profile
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list