summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackageLocation.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/PackageLocation.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/PackageLocation.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocation.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
index ba757e836dd..5792fc6c7b3 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocation.pm,v 1.11 2007/05/17 18:52:58 espie Exp $
+# $OpenBSD: PackageLocation.pm,v 1.12 2007/06/04 14:40:39 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -28,7 +28,7 @@ sub new
my ($class, $repository, $name, $arch) = @_;
if (defined $name) {
- $name =~ s/\.tgz$//;
+ $name =~ s/\.tgz$//o;
}
my $self = { repository => $repository, name => $name, arch => $arch};
bless $self, $class;
@@ -82,15 +82,15 @@ sub grabInfoFiles
while (my $e = $self->intNext) {
if ($e->isFile && is_info_name($e->{name})) {
$e->{name}=$dir.$e->{name};
- eval { $e->create(); };
+ eval { $e->create; };
if ($@) {
unlink($e->{name});
- $@ =~ s/\s+at.*//;
+ $@ =~ s/\s+at.*//o;
print STDERR $@;
return 0;
}
} else {
- $self->unput();
+ $self->unput;
last;
}
}
@@ -103,7 +103,7 @@ sub scanPackage
while (my $e = $self->intNext) {
if ($e->isFile && is_info_name($e->{name})) {
if ($e->{name} eq CONTENTS && !defined $self->{dir}) {
- $self->{contents} = $e->contents();
+ $self->{contents} = $e->contents;
last;
}
if (!defined $self->{dir}) {
@@ -113,7 +113,7 @@ sub scanPackage
eval { $e->create; };
if ($@) {
unlink($e->{name});
- $@ =~ s/\s+at.*//;
+ $@ =~ s/\s+at.*//o;
print STDERR $@;
return 0;
}
@@ -155,7 +155,7 @@ sub openPackage
# maybe it's a fat package.
while (my $e = $self->intNext) {
- unless ($e->{name} =~ m/\/\+CONTENTS$/) {
+ unless ($e->{name} =~ m/\/\+CONTENTS$/o) {
last;
}
my $prefix = $`;
@@ -324,14 +324,14 @@ sub getNext
my $self = shift;
my $e = $self->SUPER::getNext;
- if ($e->{name} =~ m/^(.*?)\/(.*)$/) {
+ if ($e->{name} =~ m/^(.*?)\/(.*)$/o) {
my ($beg, $name) = ($1, $2);
if (index($beg, $self->{filter}) == -1) {
return $self->next;
}
$e->{name} = $name;
if ($e->isHardLink) {
- $e->{linkname} =~ s/^(.*?)\///;
+ $e->{linkname} =~ s/^(.*?)\///o;
}
}
return $e;