diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2011-07-13 13:01:14 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2011-07-13 13:01:14 +0000 |
commit | ac56c8387256b7dfd1d6b22289c96b515e9f2966 (patch) | |
tree | 28e872302b30f8d47a079be97e580eb67d12ab1d /usr.sbin | |
parent | 2f2c2a5d63b15de4cb3e4f5445c8cce82f4c8555 (diff) |
share code
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgDelete.pm | 14 |
3 files changed, 12 insertions, 18 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index 3edba67dee3..c01343989c0 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.48 2011/07/13 12:32:15 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.49 2011/07/13 13:01:13 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org> # @@ -183,6 +183,12 @@ sub ntogo $self->f("ok"); } +sub todo +{ + my ($state, $offset) = @_; + return $state->tracker->sets_todo($offset); +} + sub ntogo_string { my ($self, $offset) = @_; diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm index 175b06e786a..1e6f768cb7c 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgAdd.pm,v 1.26 2011/07/13 12:32:15 espie Exp $ +# $OpenBSD: PkgAdd.pm,v 1.27 2011/07/13 13:01:13 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -171,12 +171,6 @@ sub build_deptree } } -sub todo -{ - my ($state, $offset) = @_; - return $state->tracker->sets_todo($offset); -} - sub deptree_header { my ($state, $pkg) = @_; diff --git a/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm b/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm index 1d0fab3158a..4f3d29ea616 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm @@ -1,6 +1,6 @@ #!/usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgDelete.pm,v 1.15 2011/07/13 12:32:15 espie Exp $ +# $OpenBSD: PkgDelete.pm,v 1.16 2011/07/13 13:01:13 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -73,7 +73,7 @@ sub find return $self->{todo}{$pkgname}; } - + package OpenBSD::PkgDelete::State; our @ISA = qw(OpenBSD::AddDelete::State); @@ -112,12 +112,6 @@ sub handle_options } } -sub todo -{ - my ($state, $offset) = @_; - return $state->tracker->sets_todo($offset); -} - sub stem2location { my ($self, $locator, $name, $state) = @_; @@ -157,7 +151,7 @@ use OpenBSD::Handle; sub add_location { my ($self, $state, $l) = @_; - push(@{$state->{setlist}}, + push(@{$state->{setlist}}, $state->deleteset_from_location($l)); } @@ -169,7 +163,7 @@ sub create_locations for my $name (@l) { my $l = $inst->find($name, $state->{arch}); if (!defined $l) { - $state->errsay("Can't find #1 in installed packages", + $state->errsay("Can't find #1 in installed packages", $name); $state->{bad}++; } else { |