Clear out the old sudoers block before re-adding it in invirt-console-host/0.0.10
authorEvan Broder <broder@mit.edu>
Tue, 25 Nov 2008 13:16:32 +0000 (08:16 -0500)
committerEvan Broder <broder@mit.edu>
Tue, 25 Nov 2008 13:16:32 +0000 (08:16 -0500)
invirt-console-host

svn path=/trunk/packages/invirt-console-host/; revision=1769

debian/changelog
debian/invirt-console-host.postinst

index 5cd9a54..d0f3ce7 100644 (file)
@@ -1,3 +1,9 @@
+invirt-console-host (0.0.10) unstable; urgency=low
+
+  * Clean up the old sudoers block in the postinst before we add it back
+
+ -- Evan Broder <broder@mit.edu>  Tue, 25 Nov 2008 08:13:32 -0500
+
 invirt-console-host (0.0.9) unstable; urgency=low
 
   * Add cron dependency
index d2c7c08..9f4b5a8 100755 (executable)
@@ -20,6 +20,9 @@ set -e
 
 case "$1" in
     configure)
+        # Clean up the old sudoers line before we add it back
+        perl -i.bak -ne 's%^### (BEGIN|END) invirt-console-host\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
+        
         cat >>/etc/sudoers <<EOF
 ### BEGIN invirt-console-host
 conservr ALL=(ALL) NOPASSWD: /usr/sbin/xm console d_*