diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-06-09 10:30:54 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-06-09 10:30:54 +0000 |
commit | f3a00987805a3573b982ef2ac12a4ee2cdd0ab42 (patch) | |
tree | f00cafcd95c4f1cba4fbedfd7e5d06487d9d2b16 /usr.sbin/pkg_add/OpenBSD | |
parent | e666e65bfb76c9b338f86372205d797c8ac9afec (diff) |
new code is much sturdier with respect to old libraries, we do not have
to consider .libs-* as `special case', saving old libraries should do
the right thing in all cases, more or less...
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Replace.pm | 67 |
1 files changed, 1 insertions, 66 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm index 9946fe319fc..5e85ec86998 100644 --- a/usr.sbin/pkg_add/OpenBSD/Replace.pm +++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Replace.pm,v 1.37 2007/06/07 20:41:01 espie Exp $ +# $OpenBSD: Replace.pm,v 1.38 2007/06/09 10:30:53 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -468,69 +468,4 @@ sub adjust_dependency $l->add($into); } -sub figure_out_libs -{ - my ($plist, $state, @libs) = @_; - - my $has = {}; - my $result = []; - - for my $item (@{$plist->{items}}) { - next unless $item->IsFile; - $has->{$item->fullname} = 1; - } - - for my $oldlib (@libs) { - print "Checking for collisions with $oldlib... " - if $state->{verbose}; - -# require OpenBSD::RequiredBy; -# -# if (OpenBSD::RequiredBy->new($oldlib)->list == 0) { -# require OpenBSD::Delete; -# -# OpenBSD::Delete::delete_package($oldlib, $state); -# delete_installed($oldlib); -# next; -# } - - my $p = OpenBSD::PackingList->from_installation($oldlib); - my $n = []; - my $delete = []; - my $empty = 1; - my $doit = 0; - for my $file (@{$p->{items}}) { - if ($file->IsFile) { - if ($has->{$file->fullname}) { - $doit = 1; - push(@$delete, $file); - next; - } else { - $empty = 0; - } - } - push(@$n, $file); - } - $p->{items} = $n; - if ($doit) { - print "some found\n" if $state->{verbose}; - # XXX we don't use this code yet - my $dummy = {items => $delete}; - push(@$result, - { plist => $p, - todelete => $dummy, - empty => $empty}); - #require OpenBSD::Delete; - #OpenBSD::Delete::validate_plist($p, $state); - } else { - print "none found\n" if $state->{verbose}; - } - } - if (@$result) { - #$plist->{old_libs} = $result; - return 0; - } - return 1; -} - 1; |