diff options
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 94 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 41 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 46 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_merge | 9 |
4 files changed, 95 insertions, 95 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index c20256294d5..216e4301f80 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.228 2007/05/01 18:22:20 espie Exp $ +# $OpenBSD: pkg_add,v 1.229 2007/05/02 13:59:19 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -46,7 +46,7 @@ our $not; sub can_install($$$) { my ($plist, $state, $handle) = @_; - my $pkgname = $plist->pkgname(); + my $pkgname = $plist->pkgname; $plist->{replacing} = []; my @conflicts = OpenBSD::PkgCfl::find_all($plist, $state); return 1 if @conflicts == 0; @@ -55,7 +55,7 @@ sub can_install($$$) if ((keys %conflicts) == 1 && (keys %conflicts)[0] eq $pkgname) { if (!$state->{forced}->{installed} && - !$plist->has_new_sig($state) && !$plist->uses_old_libs()) { + !$plist->has_new_sig($state) && !$plist->uses_old_libs) { print "Already installed: $pkgname\n"; return 1; } @@ -72,11 +72,11 @@ sub can_install($$$) } if (!$state->{replace}) { - if (@conflicts == 1 && is_installed($plist->pkgname()) && + if (@conflicts == 1 && is_installed($plist->pkgname) && !$plist->has_new_sig($state) && - !$plist->uses_old_libs()) { + !$plist->uses_old_libs) { print "Not reinstalling $pkgname\n" if $state->{verbose}; - OpenBSD::SharedLibs::add_package_libs($plist->pkgname()); + OpenBSD::SharedLibs::add_package_libs($plist->pkgname); $state->{installed}->{$pkgname} = 1; return; } @@ -97,10 +97,10 @@ sub can_install($$$) require OpenBSD::Replace; - if (is_installed($plist->pkgname()) && !$state->{forced}->{installed}) { - if (!$plist->has_new_sig($state) && !$plist->uses_old_libs()) { + if (is_installed($plist->pkgname) && !$state->{forced}->{installed}) { + if (!$plist->has_new_sig($state) && !$plist->uses_old_libs) { print "Not reinstalling $pkgname\n" if $state->{verbose}; - OpenBSD::SharedLibs::add_package_libs($plist->pkgname()); + OpenBSD::SharedLibs::add_package_libs($plist->pkgname); $state->{installed}->{$pkgname} = 1; return; } @@ -158,18 +158,18 @@ sub pre_add($$) if ($handle->{finished}) { return; } - my $plist = $handle->{plist} = $handle->plist(); + my $plist = $handle->{plist} = $handle->plist; unless (defined $plist) { print "Can't find CONTENTS from $pkg\n"; $errors++; return; } - if ($plist->pkgbase() ne $state->{localbase}) { - print "Localbase mismatch: package has: ", $plist->pkgbase(), " , user wants: ", $state->{localbase}, "\n"; + if ($plist->pkgbase ne $state->{localbase}) { + print "Localbase mismatch: package has: ", $plist->pkgbase, " , user wants: ", $state->{localbase}, "\n"; $errors++; return; } - my $pkgname = $handle->{pkgname} = $plist->pkgname(); + my $pkgname = $handle->{pkgname} = $plist->pkgname; if ($pkg ne '-') { if (!defined $pkgname or OpenBSD::PackageName::url2pkgname($pkg) ne $pkgname) { @@ -187,8 +187,8 @@ sub pre_add($$) if (can_install($plist, $state, $handle)) { return $handle; } else { - $handle->close_with_client_error(); - $handle->wipe_info(); + $handle->close_with_client_error; + $handle->wipe_info; delete $handle->{plist}; $handle->{finished} = 1; if ($state->{forced}->{kitchensink}) { @@ -210,7 +210,7 @@ sub thunderbird_special_case { my $plist = shift; for my $item (@{$plist->{items}}) { - next unless $item->IsFile(); + next unless $item->IsFile; my $t = $item->{tempname}; if (defined $t && $t =~ s/^(.*\/mozilla-thunderbird)\/extensions(.*)\/pkg\./$1\/pkg\./) { rename $item->{tempname}, $t; @@ -224,12 +224,12 @@ sub failed_install { my ($handle, $not, $interrupted) = @_; my $plist = $handle->{plist}; - my $pkgname = $plist->pkgname(); + my $pkgname = $plist->pkgname; my $msg = "Installation of $pkgname failed"; if ($interrupted) { $msg ="Caught SIG$interrupted. $msg"; } - OpenBSD::Add::borked_installation($plist, $handle->info(), $not, $msg); + OpenBSD::Add::borked_installation($plist, $handle->info, $not, $msg); } sub really_add($$) @@ -237,8 +237,8 @@ sub really_add($$) my ($handle, $state) = @_; my $destdir = $state->{destdir}; my $plist = $handle->{plist}; - my $dir = $handle->info(); - my $pkgname = $plist->pkgname(); + my $dir = $handle->info; + my $pkgname = $plist->pkgname; $state->{archive} = $handle; $plist->{dir} = $dir; $state->{dir} = $plist->{dir}; @@ -249,7 +249,7 @@ sub really_add($$) # are actually replacing. my @toreplace = (); for my $pl2 (@{$plist->{replacing}}) { - if (is_installed($pl2->pkgname())) { + if (is_installed($pl2->pkgname)) { push(@toreplace, $pl2); } } @@ -269,7 +269,7 @@ sub really_add($$) $header = $state->{deptree}->{$pkgname}.":".$header; } if (@toreplace) { - $header.=" (replacing ". join(', ', (map {$_->pkgname()}@toreplace)). ")"; + $header.=" (replacing ". join(', ', (map {$_->pkgname} @toreplace)). ")"; } if (!OpenBSD::ProgressMeter::set_header($header)) { print $state->{not} ? "Pretending to add " : "Adding "; @@ -286,7 +286,7 @@ sub really_add($$) Fatal "Archive in $pkgname broken"; } - $ENV{'PKG_PREFIX'} = $plist->pkgbase(); + $ENV{'PKG_PREFIX'} = $plist->pkgbase; my $interrupted; my $handler = sub { @@ -329,10 +329,10 @@ sub really_add($$) } for my $op (@toreplace) { - OpenBSD::ProgressMeter::set_header($op->pkgname()." (deleting)"); - $state->set_pkgname($op->pkgname()); + OpenBSD::ProgressMeter::set_header($op->pkgname." (deleting)"); + $state->set_pkgname($op->pkgname); if (OpenBSD::PkgSpec::match("mozilla-thunderbird-<=1.0.2p0", - ($op->pkgname()))) { + $op->pkgname)) { thunderbird_special_case($plist); } require OpenBSD::Delete; @@ -343,12 +343,12 @@ sub really_add($$) OpenBSD::Add::borked_installation($plist, $dir, $state->{not}, "Deinstallation of ", - $op->pkgname(), " failed"); + $op->pkgname, " failed"); }; - delete_installed($op->pkgname()); + delete_installed($op->pkgname); if (defined $state->{updatedepends}) { - delete $state->{updatedepends}->{$op->pkgname()}; + delete $state->{updatedepends}->{$op->pkgname}; } OpenBSD::PkgCfl::unregister($op, $state); } @@ -403,7 +403,7 @@ sub really_add($$) } try { - $handle->finish_and_close(); } + $handle->finish_and_close; } catchall { Warn $_; $errors++; @@ -424,7 +424,7 @@ sub really_add($$) failed_install($handle, $state->{not}, $interrupted); } OpenBSD::SharedLibs::add_plist_libs($plist); - $plist->to_cache(); + $plist->to_cache; my $dest = installed_info($pkgname); OpenBSD::Add::register_installation($dir, $dest, $plist); if (defined $handle->{solved_dependencies}) { @@ -446,7 +446,7 @@ sub really_add($$) for my $op (@toreplace) { require OpenBSD::RequiredBy; require OpenBSD::Replace; - my $opkgname = $op->pkgname(); + my $opkgname = $op->pkgname; print "Adjusting dependencies for $pkgname/$opkgname\n" if $state->{beverbose}; @@ -505,7 +505,7 @@ sub install_package } if (defined $state->{installed}->{$handle->{pkgname}}) { - $handle->close_now(); + $handle->close_now; return (); } @@ -518,20 +518,20 @@ sub install_package return (@deps, $pkg); } } else { - $plist = $handle->{plist} = $handle->plist(); + $plist = $handle->{plist} = $handle->plist; } } - if (is_installed($plist->pkgname()) && !$state->{forced}->{installed}) { + if (is_installed($plist->pkgname) && !$state->{forced}->{installed}) { if ($state->{replace}) { - if (!$plist->has_new_sig($state) && !$plist->uses_old_libs()) { - OpenBSD::SharedLibs::add_package_libs($plist->pkgname()); + if (!$plist->has_new_sig($state) && !$plist->uses_old_libs) { + OpenBSD::SharedLibs::add_package_libs($plist->pkgname); $state->{installed}->{$handle->{pkgname}} = 1; - $handle->close_now(); + $handle->close_now; return (); } } else { - $handle->close_now(); + $handle->close_now; return (); } } @@ -554,7 +554,7 @@ sub install_package for my $dep (keys %{$handle->{solved_dependencies}}) { next if is_installed($dep); print "Can't install $pkg: can't resolve $dep\n"; - $handle->close_now(); + $handle->close_now; $bad++; return (); } @@ -565,7 +565,7 @@ sub install_package } my $okay = 1; for my $dep (@{$plist->{libdepend}}) { - return () if defined $dep->{name} and $dep->{name} ne $plist->pkgname(); + return () if defined $dep->{name} and $dep->{name} ne $plist->pkgname; for my $spec (split(/,/, $dep->{libspec})) { if (!OpenBSD::Dependencies::lookup_library($state, $spec, $plist, $handle->{solved_dependencies}, 0)) { @@ -585,14 +585,14 @@ sub install_package } } if (!$okay) { - $handle->close_now(); + $handle->close_now; if (!$forced{libdepends}) { $bad++; return (); } } really_add($handle, $state); - $handle->wipe_info(); + $handle->wipe_info; delete $handle->{plist}; $state->{installed}->{$handle->{pkgname}} = 1; return (); @@ -844,7 +844,7 @@ sub uses_old_libs my $plist = shift; require OpenBSD::RequiredBy; - my $d = OpenBSD::Requiring->new($plist->pkgname()); + my $d = OpenBSD::Requiring->new($plist->pkgname); return grep {/^\.libs\-/} $d->list(); } @@ -852,9 +852,9 @@ sub has_new_sig { my ($plist, $state) = @_; if (!defined $plist->{new_sig}) { - my $n = OpenBSD::PackingList->from_installation($plist->pkgname())->signature(); - my $o = $plist->signature(); - print "Comparing full signature for ", $plist->pkgname(), " \"$o\" vs. \"$n\": ", $n eq $o ? "equal\n" : "different\n" + my $n = OpenBSD::PackingList->from_installation($plist->pkgname)->signature; + my $o = $plist->signature; + print "Comparing full signature for ", $plist->pkgname, " \"$o\" vs. \"$n\": ", $n eq $o ? "equal\n" : "different\n" if $state->{very_verbose}; $plist->{new_sig} = $n ne $o; } diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index 876e5afed6d..377e6f9d2b2 100644 --- a/usr.sbin/pkg_add/pkg_create +++ b/usr.sbin/pkg_add/pkg_create @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_create,v 1.84 2007/05/01 18:46:02 espie Exp $ +# $OpenBSD: pkg_create,v 1.85 2007/05/02 13:59:19 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -38,14 +38,14 @@ sub create_package $self->archive($arc, $base); if ($verbose) { - $self->comment_create_package(); + $self->comment_create_package; } } sub pretend_to_archive { my ($self, $arc, $base) = @_; - $self->comment_create_package(); + $self->comment_create_package; } sub archive {} @@ -56,8 +56,8 @@ sub print_file {} sub avert_duplicates_and_other_checks { my ($self, $allfiles) = @_; - return unless $self->NoDuplicateNames(); - my $n = $self->fullname(); + return unless $self->NoDuplicateNames; + my $n = $self->fullname; if (defined $allfiles->{$n}) { print STDERR "Error in packing-list: duplicate item $n\n"; $main::errors++; @@ -130,24 +130,24 @@ sub prepare_for_archival my ($self, $arc) = @_; my $o = $arc->prepare_long($self); - if (!defined $self->{owner} && !$o->isSymLink()) { + if (!defined $self->{owner} && !$o->isSymLink) { if ($o->{uname} ne 'root' && $o->{uname} ne 'bin') { print STDERR "Error: no \@owner for ", - $self->fullname(), " (", $o->{uname}, ")\n"; + $self->fullname, " (", $o->{uname}, ")\n"; $main::errors++; } } - if (!defined $self->{group} && !$o->isSymLink()) { + if (!defined $self->{group} && !$o->isSymLink) { if ($o->{gname} ne 'bin' && $o->{gname} ne 'wheel') { print STDERR "Warning: no \@group for ", - $self->fullname(), " (", $o->{gname}, ")\n"; + $self->fullname, " (", $o->{gname}, ")\n"; # $main::errors++; } } - if (!defined $self->{mode} && $o->isFile()) { + if (!defined $self->{mode} && $o->isFile) { if (($o->{mode} & (S_ISUID | S_ISGID | S_IWOTH)) != 0) { print STDERR "Error: weird mode for ", - $self->fullname(), ": ", + $self->fullname, ": ", sprintf("%4o", $o->{mode} & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID)), "\n"; $main::errors++; } @@ -210,7 +210,7 @@ sub pretend_to_archive { my ($self, $arc, $base) = @_; $arc->destdir($base."/".$self->{name}); - $self->comment_create_package(); + $self->comment_create_package; } sub comment_create_package @@ -227,7 +227,7 @@ sub archive my $o = $self->prepare_for_archival($arc); - $o->write() unless $main::errors; + $o->write unless $main::errors; } sub pretend_to_archive @@ -235,7 +235,7 @@ sub pretend_to_archive my ($self, $arc, $base) = @_; $self->prepare_for_archival($arc); - $self->comment_create_package(); + $self->comment_create_package; } sub comment_create_package @@ -247,19 +247,19 @@ sub comment_create_package sub print_file { my ($item) = @_; - print '@', $item->keyword(), " ", $item->fullname(), "\n"; + print '@', $item->keyword, " ", $item->fullname, "\n"; } sub makesum_plist { my ($self, $plist, $base, $stash, $infodir) = @_; - $self->makesum_plist_filename($plist, $base, $self->fullname(), $stash); + $self->makesum_plist_filename($plist, $base, $self->fullname, $stash); } sub verify_checksum { my ($self, $base, $stash, $infodir) = @_; - $self->verify_checksum_filename($base, $self->fullname(), $stash); + $self->verify_checksum_filename($base, $self->fullname, $stash); } package OpenBSD::PackingElement::InfoFile; @@ -267,7 +267,7 @@ sub makesum_plist { my ($self, $plist, $base, $stash, $infodir) = @_; $self->SUPER::makesum_plist($plist, $base, $stash); - my $fname = $self->fullname(); + my $fname = $self->fullname; for (my $i = 1; ; $i++) { if (-e "$base/$fname-$i") { my $e = OpenBSD::PackingElement::File->add($plist, $self->{name}."-".$i); @@ -604,7 +604,7 @@ if (defined $opt_q) { } my $wname; if ($regen_package) { - $wname = $plist->pkgname().".tgz"; + $wname = $plist->pkgname.".tgz"; } else { $plist->tofile($infodir.CONTENTS) or Fatal "Can't write packing list"; $wname = $ARGV[0]; @@ -631,8 +631,7 @@ if ($opt_n) { my $wrarc = OpenBSD::Ustar->new($fh, $infodir); $plist->create_package($wrarc, $base, $opt_v); - $wrarc->pad(); - close($fh); + $wrarc->close; if ($errors) { unlink($wname); exit(1); diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index b9ac6b80d88..6a49b046eb3 100644 --- a/usr.sbin/pkg_add/pkg_info +++ b/usr.sbin/pkg_add/pkg_info @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_info,v 1.44 2007/05/01 18:22:20 espie Exp $ +# $OpenBSD: pkg_info,v 1.45 2007/05/02 13:59:19 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -45,15 +45,15 @@ sub dump_file { my ($item, $opt_K) = @_; if ($opt_K) { - print '@', $item->keyword(), " "; + print '@', $item->keyword, " "; } - print $item->fullname(), "\n"; + print $item->fullname, "\n"; } sub hunt_file { my ($item, $h, $pkgname, $l) = @_; - my $fname = $item->fullname(); + my $fname = $item->fullname; if (defined $h->{$fname}) { push(@{$h->{$fname}}, $pkgname); push(@$l, $pkgname); @@ -90,8 +90,8 @@ sub find_pkg $pkg = OpenBSD::PackageLocator->find($pkgname); if (defined $pkg) { &$code($pkgname, $pkg); - $pkg->close_now(); - $pkg->wipe_info(); + $pkg->close_now; + $pkg->wipe_info; } } @@ -220,7 +220,7 @@ sub print_info if ($opt_I) { my $l = 20 - length($pkg); $l = 1 if $l <= 0; - print $pkg, " "x$l, get_comment($handle->info()), "\n"; + print $pkg, " "x$l, get_comment($handle->info), "\n"; } else { if ($terse) { print $opt_l, $pkg, "\n" unless $opt_q; @@ -229,42 +229,42 @@ sub print_info } if ($opt_c) { print $opt_l, "Comment:\n" unless $opt_q; - print get_comment($handle->info()), "\n"; + print get_comment($handle->info), "\n"; print "\n"; } - if ($opt_R && -f $handle->info().REQUIRED_BY) { + if ($opt_R && -f $handle->info.REQUIRED_BY) { print $opt_l, "Required by:\n" unless $opt_q; - printfile($handle->info().REQUIRED_BY); + printfile($handle->info.REQUIRED_BY); print "\n"; } if ($opt_d) { print $opt_l, "Description:\n" unless $opt_q; - print_description($handle->info()); + print_description($handle->info); print "\n"; } - if ($opt_M && -f $handle->info().DISPLAY) { + if ($opt_M && -f $handle->info.DISPLAY) { print $opt_l, "Install notice:\n" unless $opt_q; - printfile($handle->info().DISPLAY); + printfile($handle->info.DISPLAY); print "\n"; } - if ($opt_U && -f $handle->info().UNDISPLAY) { + if ($opt_U && -f $handle->info.UNDISPLAY) { print $opt_l, "Deinstall notice:\n" unless $opt_q; - printfile($handle->info().UNDISPLAY); + printfile($handle->info.UNDISPLAY); print "\n"; } - if ($opt_i && -f $handle->info().INSTALL) { + if ($opt_i && -f $handle->info.INSTALL) { print $opt_l, "Install script:\n" unless $opt_q; - printfile($handle->info().INSTALL); + printfile($handle->info.INSTALL); print "\n"; } - if ($opt_k && -f $handle->info().DEINSTALL) { + if ($opt_k && -f $handle->info.DEINSTALL) { print $opt_l, "De-Install script:\n" unless $opt_q; - printfile($handle->info().DEINSTALL, \*STDOUT); + printfile($handle->info.DEINSTALL, \*STDOUT); print "\n"; } - if ($opt_r && -f $handle->info().REQUIRE) { + if ($opt_r && -f $handle->info.REQUIRE) { print $opt_l, "Require script:\n" unless $opt_q; - printfile($handle->info().REQUIRE, \*STDOUT); + printfile($handle->info.REQUIRE, \*STDOUT); print "\n"; } my $plist; @@ -272,7 +272,7 @@ sub print_info require OpenBSD::PackingList; if ($opt_f || $opt_s || $opt_S) { - $plist = $handle->plist(); + $plist = $handle->plist; } else { $plist = $handle->plist(\&OpenBSD::PackingList::FilesOnly); } @@ -293,7 +293,7 @@ sub print_info } if ($opt_S) { print "Signature: " unless $opt_q; - print $plist->signature(), "\n"; + print $plist->signature, "\n"; } if ($opt_P) { require OpenBSD::PackingList; diff --git a/usr.sbin/pkg_add/pkg_merge b/usr.sbin/pkg_add/pkg_merge index 8479c4b9f0a..1c66e97a77d 100644 --- a/usr.sbin/pkg_add/pkg_merge +++ b/usr.sbin/pkg_add/pkg_merge @@ -1,5 +1,5 @@ #! /usr/bin/perl -# Copyright (c) 2005 Marc Espie <espie@openbsd.org> +# Copyright (c) 2005-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 @@ -14,6 +14,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. use strict; +use warnings; use OpenBSD::PackageLocator; use OpenBSD::PackageInfo; use OpenBSD::PackingList; @@ -74,7 +75,7 @@ sub copy_over $wrarc->destdir($pkg->{dir}); my $e = $wrarc->prepare($self->{name}); $e->{name} = "$prefix/".$e->{name}; - $e->write(); + $e->write; } } @@ -150,7 +151,7 @@ my $wrarc = OpenBSD::Ustar->new($outfh, "."); for my $pkgname (@ARGV) { my $true_package = OpenBSD::PackageLocator->find($pkgname); die "No such package $pkgname" unless $true_package; - my $dir = $true_package->info(); + my $dir = $true_package->info; my $plist = OpenBSD::PackingList->fromfile($dir.CONTENTS); my $in = { @@ -245,5 +246,5 @@ while(1) { } } } -$wrarc->close(); +$wrarc->close; print "Shared $total_files files for $total_size bytes\n" if $opt_v; |