invirt-console-host, invirt-dev, and all of the packages in
xvm-munin-config previously used a convoluted one-liner to clean up
/etc/sudoers, but we can do it much more easily using the .. operator.
Taken from http://blog.ksplice.com/2010/05/top-10-perl-one-liner-tricks/
svn path=/trunk/packages/invirt-console/; revision=3011
+invirt-console (0.2.14) unstable; urgency=low
+
+ * Use the .. Perl operator to simplify the invirt-console-host prerm.
+
+ -- Evan Broder <broder@mit.edu> Thu, 27 May 2010 11:55:53 -0400
+
invirt-console (0.2.13) unstable; urgency=low
* Changed dependency debathena-kerberos-config -> invirt-kerberos-config
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_*
case "$1" in
remove|upgrade|deconfigure)
- perl -i.bak -ne 's%^### (BEGIN|END) invirt-console-host\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
+ perl -i.bak -ne 'print unless /^### BEGIN invirt-console-host/../^### END invirt-console-host/' /etc/sudoers
;;
failed-upgrade)