summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-02 11:30:07 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-02 11:30:07 +0000
commit87d7f68e052ce47136a997db0b6ee7d7eb55aa1b (patch)
treeb4537e541dfd1a098fb22d7c23f52cb22d581454 /usr.sbin/pkg_add
parentdd64d16d1bb1c291d90bd0807e6bb058bf3d1508 (diff)
reorder code
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm76
1 files changed, 38 insertions, 38 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index f17b9fef79e..0a29aa02b5b 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.46 2007/06/02 11:24:22 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.47 2007/06/02 11:30:06 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -192,6 +192,43 @@ sub register_dependencies
}
}
+sub record_old_dependencies
+{
+ my ($self, $state) = @_;
+ for my $o ($self->{set}->older) {
+ require OpenBSD::RequiredBy;
+ my @wantlist = OpenBSD::RequiredBy->new($o->{pkgname})->list;
+ $o->{wantlist} = \@wantlist;
+ }
+}
+
+sub adjust_old_dependencies
+{
+ my ($self, $state) = @_;
+ my $pkgname = $self->{set}->handle->{pkgname};
+ for my $o ($self->{set}->older) {
+ require OpenBSD::Replace;
+ require OpenBSD::RequiredBy;
+
+ my $oldname = $o->{pkgname};
+
+ print "Adjusting dependencies for $pkgname/$oldname\n"
+ if $state->{beverbose};
+ my $d = OpenBSD::RequiredBy->new($pkgname);
+ for my $dep (@{$o->{wantlist}}) {
+ if (defined $self->{set}->{skipupdatedeps}->{$dep}) {
+ print "\tskipping $dep\n" if $state->{beverbose};
+ next;
+ }
+ print "\t$dep\n" if $state->{beverbose};
+ $d->add($dep);
+ OpenBSD::Replace::adjust_dependency($dep, $oldname, $pkgname);
+ }
+ }
+}
+
+
+
use OpenBSD::SharedLibs;
sub check_lib_spec
@@ -276,41 +313,4 @@ sub lookup_library
return;
}
-sub record_old_dependencies
-{
- my ($self, $state) = @_;
- for my $o ($self->{set}->older) {
- require OpenBSD::RequiredBy;
- my @wantlist = OpenBSD::RequiredBy->new($o->{pkgname})->list;
- $o->{wantlist} = \@wantlist;
- }
-}
-
-sub adjust_old_dependencies
-{
- my ($self, $state) = @_;
- my $pkgname = $self->{set}->handle->{pkgname};
- for my $o ($self->{set}->older) {
- require OpenBSD::Replace;
- require OpenBSD::RequiredBy;
-
- my $oldname = $o->{pkgname};
-
- print "Adjusting dependencies for $pkgname/$oldname\n"
- if $state->{beverbose};
- my $d = OpenBSD::RequiredBy->new($pkgname);
- for my $dep (@{$o->{wantlist}}) {
- if (defined $self->{set}->{skipupdatedeps}->{$dep}) {
- print "\tskipping $dep\n" if $state->{beverbose};
- next;
- }
- print "\t$dep\n" if $state->{beverbose};
- $d->add($dep);
- OpenBSD::Replace::adjust_dependency($dep, $oldname, $pkgname);
- }
- }
-}
-
-
-
1;