Ignore:
Timestamp:
May 27, 2010, 11:58:35 AM (15 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/invirt-dev/debian
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-dev/debian/changelog

    r2625 r3011  
    88    upgrades, make sure the postinst code to add it back runs on all
    99    upgrades, too.
    10 
    11  -- Evan Broder <broder@mit.edu>  Thu, 17 Dec 2009 16:06:31 -0600
     10  * Use the .. Perl operator to simplify the prerm.
     11
     12 -- Evan Broder <broder@mit.edu>  Thu, 27 May 2010 11:55:06 -0400
    1213
    1314invirt-dev (0.0.14) unstable; urgency=low
  • trunk/packages/invirt-dev/debian/invirt-dev.prerm

    r2636 r3011  
    2222        [ "$1" = "remove" ] && update-inetd --disable git
    2323
    24         perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
     24        perl -i.bak -ne 'print unless /^### BEGIN invirt-dev/../^### END invirt-dev/' /etc/sudoers
    2525    ;;
    2626
Note: See TracChangeset for help on using the changeset viewer.