From: Evan Broder Date: Tue, 25 Nov 2008 13:16:34 +0000 (-0500) Subject: Fix invirt-dev to not add the same line a bunch of times to sudoers X-Git-Tag: 0.0.9^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/commitdiff_plain/c486f9800bbbec3a069ae1e96494e13774a18fcd?hp=118a14e94a9d46c46a4f340a1d89c3c3c2e1e515 Fix invirt-dev to not add the same line a bunch of times to sudoers svn path=/trunk/packages/invirt-dev/; revision=1770 --- diff --git a/debian/changelog b/debian/changelog index 0a098bd..ab1ea68 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-dev (0.0.9) unstable; urgency=low + + * Don't add the same line a bunch of times to /etc/sudoers + + -- Evan Broder Tue, 25 Nov 2008 08:16:17 -0500 + invirt-dev (0.0.8) unstable; urgency=low * Support building multiple packages in sequence diff --git a/debian/invirt-dev.postinst b/debian/invirt-dev.postinst old mode 100644 new mode 100755 index 91fc673..96725c3 --- a/debian/invirt-dev.postinst +++ b/debian/invirt-dev.postinst @@ -8,7 +8,15 @@ case "$1" in if [ -z "$2" ]; then adduser --system repository addgroup --system repo - echo "%repo ALL=(repository) ALWAYS_SET_HOME,NOPASSWD: /usr/bin/reprepro" >>/etc/sudoers + + # Clean up the old sudoers block, then add it back + perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers + + cat >>/etc/sudoers <