diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-01-01 12:57:09 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-01-01 12:57:09 +0000 |
commit | 44ed6ee04c327dc2429f9f00c22f81393b92aeec (patch) | |
tree | d64637a102758e67f51884d55aa7f719ddac0055 /usr.sbin | |
parent | d3352204880a02be7097b2b718ef50927391786b (diff) |
make the merge_paths operations visible
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/UpdateSet.pm | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm index 09703d6cce6..a8d77f3f83e 100644 --- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm +++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: UpdateSet.pm,v 1.47 2010/01/01 12:47:14 espie Exp $ +# $OpenBSD: UpdateSet.pm,v 1.48 2010/01/01 12:57:08 espie Exp $ # # Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org> # @@ -88,6 +88,19 @@ sub add_repositories $set->{path}->add(@repos); } +sub merge_paths +{ + my ($set, $other) = @_; + + if (defined $other->path) { + if (!defined $set->path) { + $set->{path} = $other->path; + } elsif ($set->{path} ne $other->path) { + $set->add_path(@{$other->{path}}); + } + } +} + sub match_locations { my ($set, @spec) = @_; @@ -348,13 +361,7 @@ sub merge $self->add_newer($set->newer); $self->add_older($set->older); $self->add_kept($set->kept); - if (defined $set->path) { - if (!defined $self->path) { - $self->{path} = $set->path; - } elsif ($set->{path} ne $self->path) { - $self->add_path(@{$set->{path}}); - } - } + $self->merge_paths($set); # ... and mark it as already done $set->{finished} = 1; $tracker->handle_set($set); |