summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Update.pm
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/Update.pm
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/Update.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm16
1 files changed, 15 insertions, 1 deletions
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;