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/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-console/debian/invirt-console-host.postinst

    r1815 r3011  
    2121case "$1" in
    2222    configure)
    23         # Clean up the old sudoers line before we add it back
    24         perl -i.bak -ne 's%^### (BEGIN|END) invirt-console-host\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
    25        
    2623        cat >>/etc/sudoers <<EOF
    2724### BEGIN invirt-console-host
Note: See TracChangeset for help on using the changeset viewer.