Ignore:
Timestamp:
May 27, 2010, 11:58:35 AM (14 years ago)
Author:
broder
Message:

Use the .. Perl operator to simplify prerms.

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/

Location:
trunk/packages/xvm-munin-config/debian
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/xvm-munin-config/debian/changelog

    r2970 r3011  
     1xvm-munin-config (0.0.12) unstable; urgency=low
     2
     3  * Use the .. perl operator to simplify the prerms.
     4
     5 -- Evan Broder <broder@mit.edu>  Thu, 27 May 2010 11:55:31 -0400
     6
    17xvm-munin-config (0.0.11) unstable; urgency=low
    28
  • trunk/packages/xvm-munin-config/debian/xvm-munin-console-config.prerm

    r1761 r3011  
    2020case "$1" in
    2121    remove|upgrade|deconfigure)
    22         perl -i.bak -ne 's%^### (BEGIN|END) xvm-munin-config\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
     22        perl -i.bak -ne 'print unless /^### BEGIN xvm-munin-config/../^### END xvm-munin-config/' /etc/sudoers
    2323    ;;
    2424
  • trunk/packages/xvm-munin-config/debian/xvm-munin-host-config.prerm

    r1761 r3011  
    2020case "$1" in
    2121    remove|upgrade|deconfigure)
    22         perl -i.bak -ne 's%^### (BEGIN|END) xvm-munin-config\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
     22        perl -i.bak -ne 'print unless /^### BEGIN xvm-munin-config/../^### END xvm-munin-config/' /etc/sudoers
    2323    ;;
    2424
  • trunk/packages/xvm-munin-config/debian/xvm-munin-master-config.prerm

    r1761 r3011  
    2020case "$1" in
    2121    remove|upgrade|deconfigure)
    22         perl -i.bak -ne 's%^### (BEGIN|END) xvm-munin-config\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
     22        perl -i.bak -ne 'print unless /^### BEGIN xvm-munin-config/../^### END xvm-munin-config/' /etc/sudoers
    2323    ;;
    2424
  • trunk/packages/xvm-munin-config/debian/xvm-munin-remote-config.prerm

    r1761 r3011  
    2020case "$1" in
    2121    remove|upgrade|deconfigure)
    22         perl -i.bak -ne 's%^### (BEGIN|END) xvm-munin-config\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
     22        perl -i.bak -ne 'print unless /^### BEGIN xvm-munin-config/../^### END xvm-munin-config/' /etc/sudoers
    2323    ;;
    2424
Note: See TracChangeset for help on using the changeset viewer.