summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-02 15:05:31 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-02 15:05:31 +0000
commit850d571d26f7956f8733a9655f093a52d3e5ff3c (patch)
treed3b1f142fed89e3d021fa6d8d76f47a22cf06a32 /usr.sbin
parent7d7f634945a396998c775ed73d62bde8ad4cc3f4 (diff)
$o->method() becomes $o->method
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm64
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ArcCheck.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/CollisionReport.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm28
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocation.pm54
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocator.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm20
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm48
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm12
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCfl.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Replace.pm66
-rw-r--r--usr.sbin/pkg_add/OpenBSD/RequiredBy.pm14
-rw-r--r--usr.sbin/pkg_add/OpenBSD/SharedItems.pm10
-rw-r--r--usr.sbin/pkg_add/OpenBSD/SharedLibs.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Ustar.pm22
-rw-r--r--usr.sbin/pkg_add/OpenBSD/md5.pm6
19 files changed, 200 insertions, 200 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index fafb859e5ec..ff479213cf4 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.52 2007/04/29 11:09:29 espie Exp $
+# $OpenBSD: Add.pm,v 1.53 2007/05/02 15:05:29 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -52,7 +52,7 @@ sub register_installation
for my $i (info_names()) {
copy($dir.$i, $dest);
}
- $plist->to_installation();
+ $plist->to_installation;
}
sub validate_plist($$)
@@ -61,11 +61,11 @@ sub validate_plist($$)
my $destdir = $state->{destdir};
my $problems = 0;
- my $pkgname = $plist->pkgname();
+ my $pkgname = $plist->pkgname;
my $totsize = 0;
my $colliding = [];
- $plist->validate($state, \$problems, $colliding, \$totsize, $plist->pkgname());
+ $plist->validate($state, \$problems, $colliding, \$totsize, $plist->pkgname);
if (@$colliding > 0) {
require OpenBSD::CollisionReport;
@@ -87,7 +87,7 @@ sub borked_installation
use OpenBSD::PackingElement;
- my $borked = borked_package($plist->pkgname());
+ my $borked = borked_package($plist->pkgname);
# fix packing list for pkg_delete
$plist->{items} = $plist->{done};
@@ -101,7 +101,7 @@ sub borked_installation
if (defined $last->{tempname}) {
$lastname = $last->{tempname};
} else {
- $lastname = $last->fullname();
+ $lastname = $last->fullname;
}
$last->{md5} = OpenBSD::md5::fromfile($lastname);
if ($old ne $last->{md5}) {
@@ -110,7 +110,7 @@ sub borked_installation
}
}
OpenBSD::PackingElement::Cwd->add($plist, '.');
- my $pkgname = $plist->pkgname();
+ my $pkgname = $plist->pkgname;
$plist->{name}->{name} = $borked;
$plist->{pkgdep} = [];
my $dest = installed_info($borked);
@@ -140,8 +140,8 @@ sub set_modes
require OpenBSD::IdCache;
if (!defined $uidcache) {
- $uidcache = OpenBSD::UidCache->new();
- $gidcache = OpenBSD::GidCache->new();
+ $uidcache = OpenBSD::UidCache->new;
+ $gidcache = OpenBSD::GidCache->new;
}
my ($uid, $gid);
if (-l $name) {
@@ -209,7 +209,7 @@ sub validate
my $ok = $self->check();
if (defined $ok) {
if ($ok == 0) {
- Warn $self->type(), " ", $self->{name},
+ Warn $self->type, " ", $self->{name},
" does not match\n";
$$problems++;
}
@@ -221,13 +221,13 @@ sub install
{
my ($self, $state) = @_;
my $auth = $self->{name};
- print "adding ", $self->type(), " $auth\n" if $state->{verbose};
+ print "adding ", $self->type, " $auth\n" if $state->{verbose};
return if $state->{not};
return if defined $self->{okay};
my $l=[];
push(@$l, "-v") if $state->{very_verbose};
$self->build_args($l);
- VSystem($state->{very_verbose}, $self->command(),, @$l, $auth);
+ VSystem($state->{very_verbose}, $self->command,, @$l, $auth);
}
package OpenBSD::PackingElement::NewUser;
@@ -291,7 +291,7 @@ use File::Path;
sub validate
{
my ($self, $state, $problems, $colliding, $totsize, $pkgname) = @_;
- my $fname = $state->{destdir}.$self->fullname();
+ my $fname = $state->{destdir}.$self->fullname;
# check for collisions with existing stuff
if (OpenBSD::Vstat::vexists($fname)) {
push(@$colliding, $self);
@@ -314,7 +314,7 @@ sub validate
if ($state->{forced}->{kitchensink} && $state->{not}) {
return;
}
- if ($s->avail() < 0) {
+ if ($s->avail < 0) {
if ($state->{very_verbose} or ++($s->{problems}) < 4) {
Warn "Error: ", $s->{dev},
" is not large enough ($fname)\n";
@@ -330,7 +330,7 @@ sub validate
sub install
{
my ($self, $state) = @_;
- my $fullname = $self->fullname();
+ my $fullname = $self->fullname;
my $destdir = $state->{destdir};
if ($state->{replacing}) {
@@ -356,10 +356,10 @@ sub install
print "extracting $destdir$fullname\n" if $state->{very_verbose};
if ($state->{not}) {
- $state->{archive}->skip();
+ $state->{archive}->skip;
return;
} else {
- $file->create();
+ $file->create;
}
}
$self->set_modes($destdir.$fullname);
@@ -368,28 +368,28 @@ sub install
sub prepare_to_extract
{
my ($self, $state) = @_;
- my $fullname = $self->fullname();
+ my $fullname = $self->fullname;
my $destdir = $state->{destdir};
- my $file=$state->{archive}->next();
+ my $file=$state->{archive}->next;
if (!defined $file) {
Fatal "Error: truncated archive\n";
}
- $file->{cwd} = $self->cwd();
+ $file->{cwd} = $self->cwd;
if (!$file->check_name($self)) {
Fatal "Error: archive does not match ", $file->{name}, "!=",
$self->{name}, "\n";
}
- if (defined $self->{symlink} || $file->isSymLink()) {
- unless (defined $self->{symlink} && $file->isSymLink()) {
+ if (defined $self->{symlink} || $file->isSymLink) {
+ unless (defined $self->{symlink} && $file->isSymLink) {
Fatal "Error: bogus symlink ", $self->{name}, "\n";
}
if (!$file->check_linkname($self->{symlink})) {
Fatal "Error: archive sl does not match ", $file->{linkname}, "!=",
$self->{symlink}, "\n";
}
- } elsif (defined $self->{link} || $file->isHardLink()) {
- unless (defined $self->{link} && $file->isHardLink()) {
+ } elsif (defined $self->{link} || $file->isHardLink) {
+ unless (defined $self->{link} && $file->isHardLink) {
Fatal "Error: bogus hardlink ", $self->{name}, "\n";
}
if (!$file->check_linkname($self->{link})) {
@@ -447,7 +447,7 @@ sub validate
if ($state->{forced}->{kitchensink} && $state->{not}) {
return;
}
- if ($s->avail() < 0) {
+ if ($s->avail < 0) {
if ($state->{very_verbose} or ++($s->{problems}) < 4) {
Warn "Error: ", $s->{dev},
" is not large enough ($fname)\n";
@@ -465,9 +465,9 @@ sub install
my ($self, $state) = @_;
my $destdir = $state->{destdir};
- my $filename = $destdir.$self->fullname();
+ my $filename = $destdir.$self->fullname;
my $orig = $self->{copyfrom};
- my $origname = $destdir.$orig->fullname();
+ my $origname = $destdir.$orig->fullname;
if (-e $filename) {
if ($state->{verbose}) {
print "The existing file $filename has NOT been changed\n";
@@ -511,7 +511,7 @@ sub install
{
my ($self, $state) = @_;
$self->SUPER::install($state);
- $state->print("You may wish to add ", $self->fullname(), " to /etc/man.conf\n");
+ $state->print("You may wish to add ", $self->fullname, " to /etc/man.conf\n");
}
package OpenBSD::PackingElement::Manpage;
@@ -532,7 +532,7 @@ sub install
my ($self, $state) = @_;
$self->SUPER::install($state);
return if $state->{not};
- my $fullname = $state->{destdir}.$self->fullname();
+ my $fullname = $state->{destdir}.$self->fullname;
VSystem($state->{very_verbose},
"install-info", "--info-dir=".dirname($fullname), $fullname);
}
@@ -543,7 +543,7 @@ sub install
my ($self, $state) = @_;
$self->SUPER::install($state);
return if $state->{not};
- my $fullname = $self->fullname();
+ my $fullname = $self->fullname;
my $destdir = $state->{destdir};
# go append to /etc/shells if needed
open(my $shells, '<', $destdir.'/etc/shells') or return;
@@ -563,7 +563,7 @@ package OpenBSD::PackingElement::Dir;
sub install
{
my ($self, $state) = @_;
- my $fullname = $self->fullname();
+ my $fullname = $self->fullname;
my $destdir = $state->{destdir};
print "new directory ", $destdir, $fullname, "\n" if $state->{very_verbose};
@@ -626,7 +626,7 @@ sub validate
if ($state->{forced}->{kitchensink} && $state->{not}) {
return;
}
- if ($s->avail() < 0) {
+ if ($s->avail < 0) {
Warn "Error: ", $s->{dev}, " is not large enough ($fname)\n";
$state->{overflow} = 1;
$$problems++;
diff --git a/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm b/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm
index 004c6f4428d..8ee643f042d 100644
--- a/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm
+++ b/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: ArcCheck.pm,v 1.5 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: ArcCheck.pm,v 1.6 2007/05/02 15:05:29 espie Exp $
#
# Copyright (c) 2005-2006 Marc Espie <espie@openbsd.org>
#
@@ -41,13 +41,13 @@ sub check_linkname
{
my ($self, $linkname) = @_;
my $c = $self->{linkname};
- if ($self->isHardLink() && defined $self->{cwd}) {
+ if ($self->isHardLink && defined $self->{cwd}) {
$c = $self->{cwd}.'/'.$c;
}
return 1 if $c eq $linkname;
if ($self->{linkname} =~ m/^Long(?:Link|Name)\d+$/) {
$self->{linkname} = $linkname;
- if ($self->isHardLink() && defined $self->{cwd}) {
+ if ($self->isHardLink && defined $self->{cwd}) {
$self->{linkname} =~ s|^$self->{cwd}/||;
}
return 1;
diff --git a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
index 74989fac3fe..6704d1a1eb2 100644
--- a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
+++ b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: CollisionReport.pm,v 1.10 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: CollisionReport.pm,v 1.11 2007/05/02 15:05:29 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -26,7 +26,7 @@ use OpenBSD::Vstat;
sub collision_report($$)
{
my ($list, $state) = @_;
- my %todo = map {($_->fullname(), $_->{md5})} @$list;
+ my %todo = map {($_->fullname, $_->{md5})} @$list;
my $bypkg = {};
my $clueless_bat = 0;
my $clueless_bat2 = 0;
@@ -49,8 +49,8 @@ sub collision_report($$)
my $plist = OpenBSD::PackingList->from_installation($pkg,
\&OpenBSD::PackingList::FilesOnly);
for my $item (@{$plist->{items}}) {
- next unless $item->IsFile();
- my $name = $item->fullname();
+ next unless $item->IsFile;
+ my $name = $item->fullname;
if (defined $todo{$name}) {
$bypkg->{$pkg} = [] unless defined $bypkg->{$pkg};
push(@{$bypkg->{$pkg}}, $name);
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index fa12878a932..4940439bf39 100644
--- a/usr.sbin/pkg_add/OpenBSD/Delete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.36 2007/04/29 11:09:29 espie Exp $
+# $OpenBSD: Delete.pm,v 1.37 2007/05/02 15:05:29 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -38,7 +38,7 @@ sub keep_old_files
push(@{$p->{items}}, $i);
next;
}
- next unless $i->IsFile();
+ next unless $i->IsFile;
if (defined $i->{stillaround}) {
delete $i->{stillaround};
if ($state->{replacing}) {
@@ -70,7 +70,7 @@ sub keep_old_files
File::Copy::copy($dir.COMMENT, $dest);
File::Copy::copy($dir.DESC, $dest);
- $p->to_installation();
+ $p->to_installation;
return $borked;
}
@@ -103,7 +103,7 @@ sub validate_plist($$)
$state->{problems} = 0;
$state->{totsize} = 0;
$plist->prepare_for_deletion($state);
- my $dir = installed_info($plist->pkgname());
+ my $dir = installed_info($plist->pkgname);
for my $i (info_names()) {
my $fname = $dir.$i;
if (-e $fname) {
@@ -139,10 +139,10 @@ sub delete_package
OpenBSD::ProgressMeter::message("reading plist");
my $plist = OpenBSD::PackingList->from_installation($pkgname) or
Fatal "Bad package";
- if (!defined $plist->pkgname()) {
+ if (!defined $plist->pkgname) {
Fatal "Package $pkgname has no name";
}
- if ($plist->pkgname() ne $pkgname) {
+ if ($plist->pkgname ne $pkgname) {
Fatal "Package $pkgname real name does not match";
}
@@ -157,11 +157,11 @@ sub delete_plist
my ($plist, $state) = @_;
my $totsize = $plist->{totsize};
- my $pkgname = $plist->pkgname();
+ my $pkgname = $plist->pkgname;
$state->{pkgname} = $pkgname;
my $dir = installed_info($pkgname);
$state->{dir} = $dir;
- $ENV{'PKG_PREFIX'} = $plist->pkgbase();
+ $ENV{'PKG_PREFIX'} = $plist->pkgbase;
if ($plist->has(REQUIRE)) {
$plist->get(REQUIRE)->delete($state);
}
@@ -255,7 +255,7 @@ sub realname
{
my ($self, $state) = @_;
- my $name = $self->fullname();
+ my $name = $self->fullname;
if (defined $self->{tempname}) {
$name = $self->{tempname};
}
@@ -288,7 +288,7 @@ package OpenBSD::PackingElement::DirlikeObject;
sub mark_dir
{
my ($self, $state) = @_;
- $self->mark_directory($state, $self->fullname());
+ $self->mark_directory($state, $self->fullname);
}
package OpenBSD::PackingElement::NewUser;
@@ -330,7 +330,7 @@ sub delete
{
my ($self, $state) = @_;
- my $name = $self->fullname();
+ my $name = $self->fullname;
if ($state->{very_verbose}) {
print "dirrm: $name\n";
@@ -366,7 +366,7 @@ sub prepare_for_deletion
{
my ($self, $state) = @_;
- my $fname = $state->{destdir}.$self->fullname();
+ my $fname = $state->{destdir}.$self->fullname;
$state->{totsize} += $self->{size} if defined $self->{size};
my $s = OpenBSD::Vstat::remove($fname, $self->{size});
return unless defined $s;
@@ -420,7 +420,7 @@ sub delete
my $md5 = OpenBSD::md5::fromfile($realname);
if ($md5 ne $self->{md5}) {
print "Problem: md5 doesn't match for ",
- $self->fullname(), "\n";
+ $self->fullname, "\n";
print "NOT deleting: $realname\n";
$state->print("Couldn't delete $realname (bad md5)\n");
$self->do_not_delete($state);
@@ -515,7 +515,7 @@ sub delete
my ($self, $state) = @_;
unless ($state->{not}) {
my $destdir = $state->{destdir};
- my $fullname = $self->fullname();
+ my $fullname = $self->fullname;
my @l=();
if (open(my $shells, '<', $destdir.'/etc/shells')) {
local $_;
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index e523ad75f35..89917c643bc 100644
--- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Dependencies.pm,v 1.10 2007/05/02 13:36:07 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.11 2007/05/02 15:05:29 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -114,7 +114,7 @@ sub solve
}
if ($verbose && %$to_register) {
- print "Dependencies for ", $plist->pkgname(), " resolve to: ",
+ print "Dependencies for ", $plist->pkgname, " resolve to: ",
join(', ', keys %$to_register);
print " (todo: ", join(',', @deps), ")" if @deps > 0;
print "\n";
@@ -171,7 +171,7 @@ sub lookup_library
}
}
for my $dep (@{$plist->{depends}}) {
- $r = find_old_lib($state, $plist->pkgbase(), $dep->{pattern}, $lib, $dependencies);
+ $r = find_old_lib($state, $plist->pkgbase, $dep->{pattern}, $lib, $dependencies);
if ($r) {
print "found libspec $lib in old package $r\n" if $state->{verbose};
return 1;
@@ -190,7 +190,7 @@ sub lookup_library
}
next if $dependencies->{$dep};
OpenBSD::SharedLibs::add_package_libs($dep);
- if (check_lib_spec($plist->pkgbase(), $lib, {$dep => 1})) {
+ if (check_lib_spec($plist->pkgbase, $lib, {$dep => 1})) {
print "found libspec $lib in dependent package $dep\n" if $state->{verbose};
$dependencies->{$dep} = 1;
return 1;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
index e8704f19fde..27f762708e6 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.6 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: PackageLocation.pm,v 1.7 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -83,7 +83,7 @@ sub grabInfoFiles
sub scanPackage
{
my $self = shift;
- while (my $e = $self->intNext()) {
+ 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();
@@ -93,7 +93,7 @@ sub scanPackage
$self->{dir} = OpenBSD::Temp::dir();
}
$e->{name}=$self->{dir}.$e->{name};
- eval { $e->create(); };
+ eval { $e->create; };
if ($@) {
unlink($e->{name});
$@ =~ s/\s+at.*//;
@@ -101,7 +101,7 @@ sub scanPackage
return 0;
}
} else {
- $self->unput();
+ $self->unput;
last;
}
}
@@ -112,11 +112,11 @@ sub grabPlist
{
my ($self, $code) = @_;
- my $pkg = $self->openPackage();
+ my $pkg = $self->openPackage;
if (defined $pkg) {
my $plist = $self->plist($code);
- $pkg->wipe_info();
- $pkg->close_now();
+ $pkg->wipe_info;
+ $pkg->close_now;
return $plist;
} else {
return;
@@ -127,28 +127,28 @@ sub openPackage
{
my $self = shift;
my $arch = $self->{arch};
- if (!$self->openArchive()) {
+ if (!$self->openArchive) {
return;
}
- $self->scanPackage();
+ $self->scanPackage;
if (defined $self->{contents}) {
return $self;
}
# maybe it's a fat package.
- while (my $e = $self->intNext()) {
+ while (my $e = $self->intNext) {
unless ($e->{name} =~ m/\/\+CONTENTS$/) {
last;
}
my $prefix = $`;
- my $contents = $e->contents();
+ my $contents = $e->contents;
require OpenBSD::PackingList;
my $plist = OpenBSD::PackingList->fromfile(\$contents,
\&OpenBSD::PackingList::FatOnly);
if (defined $self->{name}) {
- next if $plist->pkgname() ne $self->{name};
+ next if $plist->pkgname ne $self->{name};
}
if ($plist->has('arch')) {
if ($plist->{arch}->check($arch)) {
@@ -160,8 +160,8 @@ sub openPackage
}
}
# hopeless
- $self->close_with_client_error();
- $self->wipe_info();
+ $self->close_with_client_error;
+ $self->wipe_info;
return;
}
@@ -175,7 +175,7 @@ sub info
{
my $self = shift;
if (!defined $self->{dir}) {
- $self->grabInfoFiles();
+ $self->grabInfoFiles;
}
return $self->{dir};
}
@@ -194,7 +194,7 @@ sub plist
$code);
}
# hopeless
- $self->close_with_client_error();
+ $self->close_with_client_error;
return;
}
@@ -241,10 +241,10 @@ sub deref
sub reopen
{
my $self = shift;
- if (!$self->openArchive()) {
+ if (!$self->openArchive) {
return;
}
- while (my $e = $self->{_archive}->next()) {
+ while (my $e = $self->{_archive}->next) {
if ($e->{name} eq $self->{_current}->{name}) {
$self->{_current} = $e;
return $self;
@@ -259,9 +259,9 @@ sub next
my $self = shift;
if (!defined $self->{dir}) {
- $self->grabInfoFiles();
+ $self->grabInfoFiles;
}
- return $self->intNext();
+ return $self->intNext;
}
sub intNext
@@ -269,12 +269,12 @@ sub intNext
my $self = shift;
if (!defined $self->{fh}) {
- if (!$self->reopen()) {
+ if (!$self->reopen) {
return;
}
}
if (!$self->{_unput}) {
- $self->{_current} = $self->getNext();
+ $self->{_current} = $self->getNext;
}
$self->{_unput} = 0;
return $self->{_current};
@@ -290,13 +290,13 @@ sub getNext
{
my $self = shift;
- return $self->{_archive}->next();
+ return $self->{_archive}->next;
}
sub skip
{
my $self = shift;
- return $self->{_archive}->skip();
+ return $self->{_archive}->skip;
}
package OpenBSD::FatPackageLocation;
@@ -306,14 +306,14 @@ sub getNext
{
my $self = shift;
- my $e = $self->SUPER::getNext();
+ my $e = $self->SUPER::getNext;
if ($e->{name} =~ m/^(.*?)\/(.*)$/) {
my ($beg, $name) = ($1, $2);
if (index($beg, $self->{filter}) == -1) {
- return $self->next();
+ return $self->next;
}
$e->{name} = $name;
- if ($e->isHardLink()) {
+ if ($e->isHardLink) {
$e->{linkname} =~ s/^(.*?)\///;
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
index 4323a7d998c..0d98c4e2a0c 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocator.pm,v 1.56 2007/04/29 11:09:29 espie Exp $
+# $OpenBSD: PackageLocator.pm,v 1.57 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -27,7 +27,7 @@ use OpenBSD::PackageRepository;
# There is a cache available.
my %packages;
-my $pkgpath = OpenBSD::PackageRepositoryList->new();
+my $pkgpath = OpenBSD::PackageRepositoryList->new;
if (defined $ENV{PKG_PATH}) {
my $v = $ENV{PKG_PATH};
@@ -112,7 +112,7 @@ sub grabPlist
sub cleanup
{
- $pkgpath->cleanup();
+ $pkgpath->cleanup;
}
sub match_spec
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
index 6cabe16b357..021f11e77da 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageRepository.pm,v 1.15 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.16 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -51,7 +51,7 @@ sub available
{
my $self = shift;
- return @{$self->list()};
+ return @{$self->list};
}
sub wipe_info
@@ -123,13 +123,13 @@ sub make_room
my $self = shift;
# kill old files if too many
- my $already = $self->opened();
+ my $already = $self->opened;
if (defined $already) {
# gc old objects
- if (@$already >= $self->maxcount()) {
+ if (@$already >= $self->maxcount) {
@$already = grep { defined $_->{fh} } @$already;
}
- while (@$already >= $self->maxcount()) {
+ while (@$already >= $self->maxcount) {
my $o = shift @$already;
$self->close_now($o);
}
@@ -145,7 +145,7 @@ sub open
return unless $self->may_exist($object->{name});
# kill old files if too many
- my $already = $self->make_room();
+ my $already = $self->make_room;
my $fh = $self->open_pipe($object);
if (!defined $fh) {
return;
@@ -162,7 +162,7 @@ sub find
my ($repository, $name, $arch, $srcpath) = @_;
my $self = OpenBSD::PackageLocation->new($repository, $name, $arch);
- return $self->openPackage();
+ return $self->openPackage;
}
sub grabPlist
@@ -496,7 +496,7 @@ sub finish_and_close
{
my ($self, $object) = @_;
if (defined $object->{cache_dir}) {
- while (defined $object->intNext()) {
+ while (defined $object->intNext) {
}
}
$self->SUPER::finish_and_close($object);
@@ -553,7 +553,7 @@ sub list
my ($self) = @_;
if (!defined $self->{list}) {
my $error = OpenBSD::Temp::file();
- $self->make_room();
+ $self->make_room;
my $fullname = $self->{baseurl};
my $l = $self->{list} = [];
local $_;
@@ -583,7 +583,7 @@ sub list
require OpenBSD::Temp;
my $error = OpenBSD::Temp::file();
- $self->make_room();
+ $self->make_room;
my $fullname = $self->{baseurl};
$self->{list} = $self->_list("echo 'nlist *.tgz'|ftp -o - $fullname 2>$error");
$self->parse_problems($error);
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm
index 113446531e9..264c7f29a66 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageRepositoryList.pm,v 1.4 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: PackageRepositoryList.pm,v 1.5 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -105,7 +105,7 @@ sub cleanup
{
my $self = shift;
for my $repo (@{$self->{list}}) {
- $repo->cleanup();
+ $repo->cleanup;
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index bad5faa5e2d..28dc74215cf 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.98 2007/05/02 10:30:56 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.99 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -101,10 +101,10 @@ sub needs_keyword() { 1 }
sub write
{
my ($self, $fh) = @_;
- my $s = $self->stringize();
- if ($self->needs_keyword()) {
+ my $s = $self->stringize;
+ if ($self->needs_keyword) {
$s = " $s" unless $s eq '';
- print $fh "\@", $self->keyword(), "$s\n";
+ print $fh "\@", $self->keyword, "$s\n";
} else {
print $fh "$s\n";
}
@@ -114,10 +114,10 @@ sub write
sub fullstring
{
my ($self, $fh) = @_;
- my $s = $self->stringize();
- if ($self->needs_keyword()) {
+ my $s = $self->stringize;
+ if ($self->needs_keyword) {
$s = " $s" unless $s eq '';
- return "\@".$self->keyword().$s;
+ return "\@".$self->keyword.$s;
} else {
return $s;
}
@@ -168,8 +168,8 @@ sub fullname($)
{
my $self = $_[0];
my $fullname = $self->{name};
- if ($fullname !~ m|^/| && $self->cwd() ne '.') {
- $fullname = $self->cwd()."/".$fullname;
+ if ($fullname !~ m|^/| && $self->cwd ne '.') {
+ $fullname = $self->cwd."/".$fullname;
}
return $fullname;
}
@@ -199,8 +199,8 @@ sub dirclass() { undef }
sub new
{
my ($class, $args) = @_;
- if ($args =~ m|/+$| and defined $class->dirclass()) {
- bless { name => $` }, $class->dirclass();
+ if ($args =~ m|/+$| and defined $class->dirclass) {
+ bless { name => $` }, $class->dirclass;
} else {
bless { name => $args }, $class;
}
@@ -340,7 +340,7 @@ sub dirclass() { "OpenBSD::PackingElement::Dir" }
sub needs_keyword
{
my $self = shift;
- return $self->stringize() =~ m/\^@/;
+ return $self->stringize =~ m/\^@/;
}
sub add_object
@@ -348,7 +348,7 @@ sub add_object
my ($self, $plist) = @_;
$self->destate($plist->{state});
- my $j = is_info_name($self->fullname());
+ my $j = is_info_name($self->fullname);
if ($j) {
bless $self, "OpenBSD::PackingElement::$j";
$plist->addunique($self);
@@ -405,7 +405,7 @@ __PACKAGE__->register_with_factory;
sub register_manpage
{
my ($self, $state) = @_;
- my $fname = $self->fullname();
+ my $fname = $self->fullname;
if ($fname =~ m,^(.*/man)/(?:man|cat).*?/,) {
my $d = $1;
$state->{mandirs} = {} unless defined $state->{mandirs};
@@ -428,7 +428,7 @@ sub mark_ldconfig_directory
require OpenBSD::SharedLibs;
my ($self, $destdir) = @_;
- OpenBSD::SharedLibs::mark_ldconfig_directory($self->fullname(),
+ OpenBSD::SharedLibs::mark_ldconfig_directory($self->fullname,
$destdir);
}
@@ -569,9 +569,9 @@ sub new
{
my ($class, @args) = @_;
if ($args[0] eq 'no-default-conflict') {
- return OpenBSD::PackingElement::NoDefaultConflict->new();
+ return OpenBSD::PackingElement::NoDefaultConflict->new;
} elsif ($args[0] eq 'manual-installation') {
- return OpenBSD::PackingElement::ManualInstallation->new();
+ return OpenBSD::PackingElement::ManualInstallation->new;
} else {
die "Unknown option: $args[0]";
}
@@ -971,7 +971,7 @@ sub run
my ($self, $state) = @_;
OpenBSD::PackingElement::Lib::ensure_ldconfig($state);
- print $self->keyword(), " ", $self->{expanded}, "\n" if $state->{beverbose};
+ print $self->keyword, " ", $self->{expanded}, "\n" if $state->{beverbose};
$state->system('/bin/sh', '-c', $self->{expanded}) unless $state->{not};
}
@@ -1021,7 +1021,7 @@ sub destate
sub needs_keyword
{
my $self = shift;
- return $self->stringize() =~ m/\^@/;
+ return $self->stringize =~ m/\^@/;
}
package OpenBSD::PackingElement::Infodir;
@@ -1042,13 +1042,13 @@ sub install
{
my ($self, $state) = @_;
$self->SUPER::install($state);
- $fonts_todo{$state->{destdir}.$self->fullname()} = 1;
+ $fonts_todo{$state->{destdir}.$self->fullname} = 1;
}
sub reload
{
my ($self, $state) = @_;
- $fonts_todo{$state->{destdir}.$self->fullname()} = 1;
+ $fonts_todo{$state->{destdir}.$self->fullname} = 1;
}
sub update_fontalias
@@ -1187,14 +1187,14 @@ sub run
return if $state->{dont_run_scripts};
OpenBSD::PackingElement::Lib::ensure_ldconfig($state);
- print $self->beautify(), " script: $dir$name $pkgname ", join(' ', @args), "\n" if $state->{beverbose};
+ print $self->beautify, " script: $dir$name $pkgname ", join(' ', @args), "\n" if $state->{beverbose};
return if $not;
chmod 0755, $dir.$name;
return if $state->system($dir.$name, $pkgname, @args) == 0;
if ($state->{forced}->{scripts}) {
- $state->warn($self->beautify(), " script failed\n");
+ $state->warn($self->beautify, " script failed\n");
} else {
- $state->fatal($self->beautify()." script failed");
+ $state->fatal($self->beautify." script failed");
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 9acffccd072..3cbbf2c7d32 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingList.pm,v 1.59 2007/05/01 20:13:44 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.60 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -54,7 +54,7 @@ sub new
{
my $class = shift;
bless {state =>
- OpenBSD::PackingList::State->new()
+ OpenBSD::PackingList::State->new
}, $class;
}
@@ -268,14 +268,14 @@ sub tofile
sub add2list
{
my ($plist, $object) = @_;
- my $category = $object->category();
+ my $category = $object->category;
push @{$plist->{$category}}, $object;
}
sub addunique
{
my ($plist, $object) = @_;
- my $category = $object->category();
+ my $category = $object->category;
if (defined $plist->{$category}) {
die "Duplicate $category in plist\n";
}
@@ -415,7 +415,7 @@ sub to_installation
return if $main::not;
- $self->tofile(OpenBSD::PackageInfo::installed_contents($self->pkgname()));
+ $self->tofile(OpenBSD::PackageInfo::installed_contents($self->pkgname));
}
@@ -424,7 +424,7 @@ sub signature
my $self = shift;
my $k = {};
$self->visit('signature', $k);
- return join(',', $self->pkgname(), sort keys %$k);
+ return join(',', $self->pkgname, sort keys %$k);
}
sub forget
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm b/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
index b117aaf9a60..774346ac63f 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgCfl.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCfl.pm,v 1.13 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: PkgCfl.pm,v 1.14 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -37,7 +37,7 @@ sub make_conflict_list
{
my ($class, $plist, $pkg) = @_;
my $l = [];
- my $pkgname = $plist->pkgname();
+ my $pkgname = $plist->pkgname;
if (!defined $pkgname) {
print STDERR "No pkgname in packing-list for $pkg\n";
return;
@@ -81,13 +81,13 @@ sub register($$)
if (!defined $plist->{conflicts}) {
$plist->{conflicts} = OpenBSD::PkgCfl->make_conflict_list($plist);
}
- $state->{conflict_list}->{$plist->pkgname()} = $plist->{conflicts};
+ $state->{conflict_list}->{$plist->pkgname} = $plist->{conflicts};
}
sub unregister($$)
{
my ($plist, $state) = @_;
- delete $state->{conflict_list}->{$plist->pkgname()};
+ delete $state->{conflict_list}->{$plist->pkgname};
}
sub fill_conflict_lists($)
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm
index 8a61ff5fb6c..f8437cbf074 100644
--- a/usr.sbin/pkg_add/OpenBSD/Replace.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Replace.pm,v 1.5 2007/04/29 11:09:29 espie Exp $
+# $OpenBSD: Replace.pm,v 1.6 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -72,7 +72,7 @@ sub extract
}
if ($state->{not}) {
print "extracting tempfile under $d\n" if $state->{very_verbose};
- $state->{archive}->skip();
+ $state->{archive}->skip;
} else {
if (!-e _) {
File::Path::mkpath($d);
@@ -83,7 +83,7 @@ sub extract
print "extracting $tempname\n" if $state->{very_verbose};
$file->{name} = $tempname;
$self->{tempname} = $tempname;
- $file->create();
+ $file->create;
}
}
@@ -91,7 +91,7 @@ package OpenBSD::PackingElement::Dir;
sub extract
{
my ($self, $state) = @_;
- my $fullname = $self->fullname();
+ my $fullname = $self->fullname;
my $destdir = $state->{destdir};
return if -e $destdir.$fullname;
@@ -197,7 +197,7 @@ package OpenBSD::PackingElement::Lib;
sub mark_lib
{
my ($self, $libs, $libpatterns) = @_;
- my $libname = $self->fullname();
+ my $libname = $self->fullname;
if ($libname =~ m/^(.*\.so\.)(\d+)\.(\d+)$/) {
$libpatterns->{"$1"} = [$2, $3, $libname];
}
@@ -207,7 +207,7 @@ sub mark_lib
sub unmark_lib
{
my ($self, $libs, $libpatterns) = @_;
- my $libname = $self->fullname();
+ my $libname = $self->fullname;
if ($libname =~ m/^(.*\.so\.)(\d+)\.(\d+)$/) {
my ($pat, $major, $minor) = ($1, $2, $3);
my $p = $libpatterns->{"$pat"};
@@ -258,7 +258,7 @@ sub can_do
$state->{journal} = [];
$plist->can_update(0, $state);
if ($state->{okay} == 0) {
- Warn "Old package ", $plist->pkgname(), " contains potentially unsafe operations\n";
+ Warn "Old package ", $plist->pkgname, " contains potentially unsafe operations\n";
for my $i (@{$state->{journal}}) {
Warn "\t$i\n";
}
@@ -272,7 +272,7 @@ sub can_do
}
}
}
- my @wantlist = OpenBSD::RequiredBy->new($toreplace)->list();
+ my @wantlist = OpenBSD::RequiredBy->new($toreplace)->list;
my @r = ();
for my $wanting (@wantlist) {
push(@r, $wanting) if !defined $ignore->{$wanting};
@@ -314,7 +314,7 @@ sub is_safe
$state->{journal} = [];
$plist->can_update(1, $state);
if ($state->{okay} == 0) {
- Warn "New package ", $plist->pkgname(),
+ Warn "New package ", $plist->pkgname,
" contains potentially unsafe operations\n";
for my $i (@{$state->{journal}}) {
Warn "\t$i\n";
@@ -338,9 +338,9 @@ sub split_libs
my $items = [];
- my $splitted = OpenBSD::PackingList->new();
+ my $splitted = OpenBSD::PackingList->new;
- OpenBSD::PackingElement::Name->add($splitted, ".libs-".$plist->pkgname());
+ OpenBSD::PackingElement::Name->add($splitted, ".libs-".$plist->pkgname);
if (defined $plist->{conflict}) {
for my $item (@{$plist->{conflict}}) {
$item->clone()->add_object($splitted);
@@ -353,22 +353,22 @@ sub split_libs
}
if (defined $plist->{'no-default-conflict'}) {
# we conflict with the package we just removed...
- OpenBSD::PackingElement::Conflict->add($splitted, $plist->pkgname());
+ OpenBSD::PackingElement::Conflict->add($splitted, $plist->pkgname);
} else {
require OpenBSD::PackageName;
- my $stem = OpenBSD::PackageName::splitstem($plist->pkgname());
+ my $stem = OpenBSD::PackageName::splitstem($plist->pkgname);
OpenBSD::PackingElement::Conflict->add($splitted, $stem."-*");
}
for my $item (@{$plist->{items}}) {
if ($item->isa("OpenBSD::PackingElement::Lib") &&
- defined $to_split->{$item->fullname()}) {
- $item->clone()->add_object($splitted);
+ defined $to_split->{$item->fullname}) {
+ $item->clone->add_object($splitted);
next;
}
if ($item->isa("OpenBSD::PackingElement::Cwd")) {
- $item->clone()->add_object($splitted);
+ $item->clone->add_object($splitted);
}
push(@$items, $item);
}
@@ -390,7 +390,7 @@ sub convert_to_requiring
$r->add($item->{name});
}
delete $plist->{pkgdep};
- $plist->to_installation();
+ $plist->to_installation;
}
sub walk_depends_closure
@@ -399,7 +399,7 @@ sub walk_depends_closure
my @todo = ($start);
my $done = {};
my $depend = 0;
- my $name = $plist->pkgname();
+ my $name = $plist->pkgname;
print "Packages that depend on those shared libraries:\n"
if $state->{beverbose};
@@ -408,14 +408,14 @@ sub walk_depends_closure
while (my $pkg = shift @todo) {
$done->{$pkg} = 1;
- for my $pkg2 (OpenBSD::RequiredBy->new($pkg)->list()) {
+ for my $pkg2 (OpenBSD::RequiredBy->new($pkg)->list) {
next if $done->{$pkg2};
push(@todo, $pkg2);
print "\t$pkg2\n" if $state->{beverbose};
$done->{$pkg2} = 1;
$write->add($pkg2);
my $l = OpenBSD::Requiring->new($pkg2);
- if (!$l->list()) {
+ if (!$l->list) {
convert_to_requiring($pkg2);
}
$l->add($name);
@@ -450,32 +450,32 @@ sub save_old_libraries
print "Libraries to keep: ", join(",", sort(keys %$libs)), "\n"
if $state->{beverbose};
my $stub_list = split_libs($old_plist, $libs);
- my $stub_name = $stub_list->pkgname();
+ my $stub_name = $stub_list->pkgname;
my $dest = installed_info($stub_name);
print "Keeping them in $stub_name\n" if $state->{beverbose};
if ($state->{not}) {
- $stub_list->to_cache();
- $old_plist->to_cache();
+ $stub_list->to_cache;
+ $old_plist->to_cache;
} else {
require OpenBSD::md5;
mkdir($dest);
- my $oldname = $old_plist->pkgname();
+ my $oldname = $old_plist->pkgname;
open my $descr, '>', $dest.DESC;
print $descr "Stub libraries for $oldname\n";
close $descr;
my $f = OpenBSD::PackingElement::FDESC->add($stub_list, DESC);
$f->{ignore} = 1;
$f->{md5} = OpenBSD::md5::fromfile($dest.DESC);
- $stub_list->to_installation();
- $old_plist->to_installation();
+ $stub_list->to_installation;
+ $old_plist->to_installation;
}
add_installed($stub_name);
require OpenBSD::PkgCfl;
OpenBSD::PkgCfl::register($stub_list, $state);
- walk_depends_closure($old_plist->pkgname(), $stub_list, $state);
+ walk_depends_closure($old_plist->pkgname, $stub_list, $state);
} else {
print "No libraries to keep\n" if $state->{beverbose};
}
@@ -488,7 +488,7 @@ sub adjust_dependency
my ($dep, $from, $into) = @_;
my $l = OpenBSD::Requiring->new($dep);
- if (!$l->list()) {
+ if (!$l->list) {
convert_to_requiring($dep);
}
$l->delete($from);
@@ -503,8 +503,8 @@ sub figure_out_libs
my $result = [];
for my $item (@{$plist->{items}}) {
- next unless $item->IsFile();
- $has->{$item->fullname()} = 1;
+ next unless $item->IsFile;
+ $has->{$item->fullname} = 1;
}
for my $oldlib (@libs) {
@@ -513,7 +513,7 @@ sub figure_out_libs
# require OpenBSD::RequiredBy;
#
-# if (OpenBSD::RequiredBy->new($oldlib)->list() == 0) {
+# if (OpenBSD::RequiredBy->new($oldlib)->list == 0) {
# require OpenBSD::Delete;
#
# OpenBSD::Delete::delete_package($oldlib, $state);
@@ -527,8 +527,8 @@ sub figure_out_libs
my $empty = 1;
my $doit = 0;
for my $file (@{$p->{items}}) {
- if ($file->IsFile()) {
- if ($has->{$file->fullname()}) {
+ if ($file->IsFile) {
+ if ($has->{$file->fullname}) {
$doit = 1;
push(@$delete, $file);
next;
diff --git a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
index cc465024576..8b4280a3ecd 100644
--- a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
+++ b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: RequiredBy.pm,v 1.12 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: RequiredBy.pm,v 1.13 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -76,7 +76,7 @@ sub list($)
my $self = shift;
if (wantarray) {
- $self->fill_entries();
+ $self->fill_entries;
return keys %{$self->{entries}};
} else {
if (exists $self->{entries}) {
@@ -95,7 +95,7 @@ sub delete
for my $pkg (@pkgnames) {
delete $self->{entries}->{$pkg};
}
- $self->synch();
+ $self->synch;
}
sub add
@@ -105,7 +105,7 @@ sub add
for my $pkg (@pkgnames) {
$self->{entries}->{$pkg} = 1;
}
- $self->synch();
+ $self->synch;
}
my $cache = {};
@@ -113,7 +113,7 @@ my $cache = {};
sub new
{
my ($class, $pkgname) = @_;
- my $f = installed_info($pkgname).$class->filename();
+ my $f = installed_info($pkgname).$class->filename;
if (!exists $cache->{$f}) {
return $cache->{$f} = bless { filename => $f }, $class;
}
@@ -123,7 +123,7 @@ sub new
sub forget
{
my ($class, $dir) = @_;
- my $f = $dir.$class->filename();
+ my $f = $dir.$class->filename;
if (exists $cache->{$f}) {
$cache->{$f}->{entries} = {};
$cache->{$f}->{nonempty} = 0;
@@ -140,7 +140,7 @@ sub compute_closure
while (my $pkgname = pop @todo) {
next if $done{$pkgname};
$done{$pkgname} = 1;
- for my $dep ($class->new($pkgname)->list()) {
+ for my $dep ($class->new($pkgname)->list) {
next if defined $done{$dep};
push(@todo, $dep);
}
diff --git a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm
index 080d8a3f51e..25792f94bb5 100644
--- a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm
+++ b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: SharedItems.pm,v 1.8 2007/04/29 11:09:29 espie Exp $
+# $OpenBSD: SharedItems.pm,v 1.9 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -143,7 +143,7 @@ package OpenBSD::PackingElement::DirBase;
sub record_shared_item
{
my ($self, $pkgname, $db) = @_;
- my $k = $self->fullname();
+ my $k = $self->fullname;
$db->{dirs}->{$k} = 1;
}
@@ -157,7 +157,7 @@ package OpenBSD::PackingElement::Mandir;
sub cleanup
{
my ($self, $state) = @_;
- my $fullname = $state->{destdir}.$self->fullname();
+ my $fullname = $state->{destdir}.$self->fullname;
$state->print("You may wish to remove ", $fullname, " from man.conf\n");
unlink("$fullname/whatis.db");
}
@@ -166,7 +166,7 @@ package OpenBSD::PackingElement::Fontdir;
sub cleanup
{
my ($self, $state) = @_;
- my $fullname = $state->{destdir}.$self->fullname();
+ my $fullname = $state->{destdir}.$self->fullname;
$state->print("You may wish to remove ", $fullname, " from your font path\n");
unlink("$fullname/fonts.alias");
unlink("$fullname/fonts.dir");
@@ -177,7 +177,7 @@ package OpenBSD::PackingElement::Infodir;
sub cleanup
{
my ($self, $state) = @_;
- my $fullname = $state->{destdir}.$self->fullname();
+ my $fullname = $state->{destdir}.$self->fullname;
unlink("$fullname/dir");
}
diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
index 50ae3986769..562e3421ed2 100644
--- a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
+++ b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: SharedLibs.pm,v 1.10 2007/04/29 11:09:29 espie Exp $
+# $OpenBSD: SharedLibs.pm,v 1.11 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -32,7 +32,7 @@ package OpenBSD::PackingElement::FileBase;
sub mark_bogus_lib
{
my ($self, $pkgname) = @_;
- my $fname = $self->fullname();
+ my $fname = $self->fullname;
return unless $fname =~ m/\/lib[^\/]+\.so\.\d+\.\d+$/;
OpenBSD::SharedLibs::register_lib($fname, $pkgname);
}
@@ -42,7 +42,7 @@ package OpenBSD::PackingElement::Lib;
sub mark_available_lib
{
my ($self, $pkgname) = @_;
- OpenBSD::SharedLibs::register_lib($self->fullname(), $pkgname);
+ OpenBSD::SharedLibs::register_lib($self->fullname, $pkgname);
}
sub mark_bogus_lib
@@ -168,7 +168,7 @@ sub add_bogus_package_libs
sub add_plist_libs
{
my ($plist) = @_;
- my $pkgname = $plist->pkgname();
+ my $pkgname = $plist->pkgname;
return if $done_plist->{$pkgname};
$done_plist->{$pkgname} = 1;
$plist->mark_available_lib($pkgname);
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index d2fdc1a2c2d..3125bef1076 100644
--- a/usr.sbin/pkg_add/OpenBSD/Update.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Update.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Update.pm,v 1.66 2007/04/21 10:02:15 espie Exp $
+# $OpenBSD: Update.pm,v 1.67 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -96,7 +96,7 @@ sub find
}
if (defined $found && @l2 == 1 && $found eq $l2[0]) {
- if (!$plist->uses_old_libs()) {
+ if (!$plist->uses_old_libs) {
my $msg = "No need to update $pkgname";
OpenBSD::ProgressMeter::message($msg);
print "$msg\n" if $state->{beverbose};
@@ -112,7 +112,7 @@ sub find
}
if (@l2 == 1) {
- if (defined $found && $found eq $l2[0] && !$plist->uses_old_libs()) {
+ if (defined $found && $found eq $l2[0] && !$plist->uses_old_libs) {
my $msg = "No need to update $pkgname";
OpenBSD::ProgressMeter::message($msg);
print "$msg\n" if $state->{beverbose};
@@ -124,7 +124,7 @@ sub find
} else {
my $result = OpenBSD::Interactive::choose1($pkgname, $state->{interactive}, sort @l2);
if (defined $result) {
- if (defined $found && $found eq $result && !$plist->uses_old_libs()) {
+ if (defined $found && $found eq $result && !$plist->uses_old_libs) {
print "No need to update $pkgname\n";
} else {
push(@$new, $result);
diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm
index 0de51dc3c9b..483e59a2caf 100644
--- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Ustar.pm,v 1.46 2007/04/15 10:17:29 espie Exp $
+# $OpenBSD: Ustar.pm,v 1.47 2007/05/02 15:05:30 espie Exp $
#
# Copyright (c) 2002-2007 Marc Espie <espie@openbsd.org>
#
@@ -97,7 +97,7 @@ sub next
{
my $self = shift;
# get rid of the current object
- $self->skip();
+ $self->skip;
my $header;
my $n = read $self->{fh}, $header, 512;
return if (defined $n) and $n == 0;
@@ -190,11 +190,11 @@ sub mkheader
my ($prefix, $name) = split_name($entry->{name});
my $linkname = $entry->{linkname};
my $size = $entry->{size};
- if (!$entry->isFile()) {
+ if (!$entry->isFile) {
$size = 0;
}
my ($major, $minor);
- if ($entry->isDevice()) {
+ if ($entry->isDevice) {
$major = $entry->{major};
$minor = $entry->{minor};
} else {
@@ -317,7 +317,7 @@ sub close
{
my $self = shift;
if (defined $self->{padout}) {
- $self->pad();
+ $self->pad;
}
close($self->{fh});
}
@@ -431,7 +431,7 @@ sub create
{
my $self = shift;
File::Path::mkpath($self->{destdir}.$self->{name});
- $self->set_modes();
+ $self->set_modes;
}
sub isDir() { 1 }
@@ -497,7 +497,7 @@ sub create
require POSIX;
POSIX::mkfifo($self->{destdir}.$self->{name}, $self->{mode}) or
die "Can't create fifo $self->{name}: $!";
- $self->set_modes();
+ $self->set_modes;
}
sub isFifo() { 1 }
@@ -510,8 +510,8 @@ sub create
{
my $self = shift;
$self->make_basedir($self->{name});
- system('/sbin/mknod', 'mknod', '-m', $self->{mode}, $self->{destdir}.$self->{name}, $self->devicetype(), $self->{major}, $self->{minor});
- $self->set_modes();
+ system('/sbin/mknod', 'mknod', '-m', $self->{mode}, $self->{destdir}.$self->{name}, $self->devicetype, $self->{major}, $self->{minor});
+ $self->set_modes;
}
sub isDevice() { 1 }
@@ -636,8 +636,8 @@ sub create
$toread -= $actual;
}
- $out->close() or die "Error closing $self->{destdir}$self->{name}: $!";
- $self->set_modes();
+ $out->close or die "Error closing $self->{destdir}$self->{name}: $!";
+ $self->set_modes;
}
sub contents
diff --git a/usr.sbin/pkg_add/OpenBSD/md5.pm b/usr.sbin/pkg_add/OpenBSD/md5.pm
index 499594c47b5..1d15db4f69b 100644
--- a/usr.sbin/pkg_add/OpenBSD/md5.pm
+++ b/usr.sbin/pkg_add/OpenBSD/md5.pm
@@ -1,7 +1,7 @@
# ex:ts=8 sw=4:
-# $OpenBSD: md5.pm,v 1.4 2004/11/12 19:42:01 espie Exp $
+# $OpenBSD: md5.pm,v 1.5 2007/05/02 15:05:30 espie Exp $
#
-# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
+# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -29,6 +29,6 @@ sub fromfile
$md5->addfile($file);
close($file) or die "problem closing $fname: $!";
- return $md5->digest();
+ return $md5->digest;
}
1;