From c486f9800bbbec3a069ae1e96494e13774a18fcd Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Tue, 25 Nov 2008 08:16:34 -0500 Subject: [PATCH] Fix invirt-dev to not add the same line a bunch of times to sudoers svn path=/trunk/packages/invirt-dev/; revision=1770 --- debian/changelog | 6 ++++++ debian/invirt-dev.postinst | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) mode change 100644 => 100755 debian/invirt-dev.postinst 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 <