summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-11-18 21:48:03 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-11-18 21:48:03 +0000
commit8d5511c2c78613ccea6d3bae00ab06cb4f58f89e (patch)
treeaf36b84d59823786b5710e7d805a130ce39e52a0 /usr.sbin/pkg_add/OpenBSD
parent570bfe13cae5ebfbf5ee9fcfaa6a737cddb85735 (diff)
support depend (similar to libdepend and newdepend) and wantlib:
put lookup_library code in a separate routine, and add a `harder' mode for wantlib, that will also look in system libraries, and in the full tree of dependent packages.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm9
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm16
2 files changed, 20 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index a0eee8feddd..0e2c2809ef4 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.20 2004/11/14 19:50:44 espie Exp $
+# $OpenBSD: Add.pm,v 1.21 2004/11/18 21:48:02 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -500,16 +500,17 @@ sub install
sub available_lib
{
- my ($self, $avail) = @_;
+ my ($self, $avail, $pkgname) = @_;
my $fullname = $self->fullname();
if ($fullname =~ m/^(.*\.so\.\d+)\.(\d+)$/) {
my ($stem, $minor) = ($1, $2);
- if (!defined $avail->{"$stem"} || $avail->{"$stem"} < $minor) {
- $avail->{"$stem"} = $minor;
+ if (!defined $avail->{"$stem"} || $avail->{"$stem"}->[0] < $minor) {
+ $avail->{"$stem"} = [$minor, $pkgname];
}
}
}
+
package OpenBSD::PackingElement::Arch;
sub check
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index 71edc223357..75961b99792 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.32 2004/11/14 19:25:45 espie Exp $
+# $OpenBSD: Update.pm,v 1.33 2004/11/18 21:48:02 espie Exp $
#
# Copyright (c) 2004 Marc Espie <espie@openbsd.org>
#
@@ -189,6 +189,20 @@ sub validate_depend
}
}
+package OpenBSD::PackingElement::Dependency;
+use OpenBSD::Error;
+
+sub validate_depend
+{
+ my ($self, $state, $wanting, $toreplace, $replacement) = @_;
+
+ return unless OpenBSD::PkgSpec::match($self->{pattern}, $toreplace);
+ if (!OpenBSD::PkgSpec::match($self->{pattern}, $replacement)) {
+ $state->{okay} = 0;
+ Warn "Can't update forward dependency of $wanting on $toreplace\n";
+ }
+}
+
package OpenBSD::Update;
use OpenBSD::RequiredBy;
use OpenBSD::PackingList;