summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Add.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-04 14:40:40 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-04 14:40:40 +0000
commit8a3fdf46bd93e71794fcec29cb31017529d8ec57 (patch)
tree8721baf5d52b0079af9d143523c9b5d0a8cd2bef /usr.sbin/pkg_add/OpenBSD/Add.pm
parentcc4e44748b6a845f1f2d35fc2fe8753cb8b89300 (diff)
some minor systematic changes.
- mark all regexps I can with /o if they can be compiled once. - turn $o->method() into $o->method - remove unneeded prototypes - reduce split /re/ into split "string" where possible.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Add.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 8385996ad50..cdf4a041e70 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.70 2007/06/01 22:06:03 espie Exp $
+# $OpenBSD: Add.pm,v 1.71 2007/06/04 14:40:39 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -168,7 +168,7 @@ sub set_modes
}
if (defined $self->{mode}) {
my $v = $self->{mode};
- if ($v =~ m/^\d+$/) {
+ if ($v =~ m/^\d+$/o) {
chmod oct($v), $name;
} else {
System('chmod', $self->{mode}, $name);
@@ -204,7 +204,7 @@ sub add_entry
my $f = shift;
my $v = shift;
next if !defined $v or $v eq '';
- if ($v =~ m/^\!/) {
+ if ($v =~ m/^\!/o) {
push(@$l, $f, $');
} else {
push(@$l, $f, $v);
@@ -534,7 +534,7 @@ sub install
open(my $shells, '<', $destdir.'/etc/shells') or return;
local $_;
while(<$shells>) {
- s/^\#.*//;
+ s/^\#.*//o;
return if $_ =~ m/^\Q$fullname\E\s*$/;
}
close($shells);