diff options
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 33 |
2 files changed, 35 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index fe1b1b7788c..44974c60f29 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.61 2008/06/10 10:52:52 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.62 2008/06/11 12:21:03 espie Exp $ # # Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org> # @@ -161,13 +161,13 @@ sub find_in_new_source { my ($self, $solver, $state, $obj, $dep) = @_; my $plist = OpenBSD::PackingList->from_installation($dep, - \&OpenBSD::PackingList::DependsOnly); + \&OpenBSD::PackingList::DependOnly); if (!defined $plist) { print STDERR "Can't read plist for $dep\n"; } if ($plist->has('define-tag')) { for my $t (@{$plist->{'define-tag'}}) { - $self->{known_tags}->{$t} = $dep; + $self->{known_tags}->{$t->{name}} = $dep; } } return $self->find_in_already_done($solver, $state, $obj); diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index a707dd14534..12567b5142b 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.147 2008/06/11 09:42:13 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.148 2008/06/11 12:21:03 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -257,6 +257,18 @@ sub compute_md5 return OpenBSD::md5::fromfile($filename); } +sub write +{ + my ($self, $fh) = @_; + + $self->SUPER::write($fh); + if (defined $self->{tags}) { + for my $tag (sort keys %{$self->{tags}}) { + print $fh "\@tag ", $tag, "\n"; + } + } +} + # exec/unexec and friends package OpenBSD::PackingElement::Action; our @ISA=qw(OpenBSD::PackingElement::Object); @@ -611,9 +623,28 @@ sub add package OpenBSD::PackingElement::DefineTag; our @ISA=qw(OpenBSD::PackingElement::Meta); +sub category() { 'define-tag' } sub keyword() { 'define-tag' } __PACKAGE__->register_with_factory; +sub new +{ + my ($class, $args) = @_; + my ($tag, $condition, @command) = split(/\s+/, $args); + bless { + name => $tag, + when => $condition, + command => join(' ', @command) + }, $class; +} + +sub stringize +{ + my $self = shift; + return join(' ', map { $self->{$_}} + (qw(name when command))); +} + package OpenBSD::PackingElement::symlink; our @ISA=qw(OpenBSD::PackingElement::Annotation); |