summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-06-05 12:21:17 +0000
committerFrancois Pons <fpons@mandriva.com>2002-06-05 12:21:17 +0000
commit4f2f4aa7ae78aa7cf130b419c5ea1bf776cfde74 (patch)
tree72fe85d9f4d6c5dacc2d0a6eee69d47ded33276f /urpm.pm
parenta14c5cbcfa2e46f67bcef28ee906da22fa3eee80 (diff)
downloadurpmi-4f2f4aa7ae78aa7cf130b419c5ea1bf776cfde74.tar
urpmi-4f2f4aa7ae78aa7cf130b419c5ea1bf776cfde74.tar.gz
urpmi-4f2f4aa7ae78aa7cf130b419c5ea1bf776cfde74.tar.bz2
urpmi-4f2f4aa7ae78aa7cf130b419c5ea1bf776cfde74.tar.xz
urpmi-4f2f4aa7ae78aa7cf130b419c5ea1bf776cfde74.zip
3.4-4mdk final.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm43
1 files changed, 18 insertions, 25 deletions
diff --git a/urpm.pm b/urpm.pm
index 92119d62..16cc5090 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -445,14 +445,6 @@ sub configure {
$urpm->{log}(_("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$_->{hdlist}"));
($_->{start}, $_->{end}) = $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$_->{hdlist}");
}
-
- if ($options{files}) {
- #- build closure with local package and return list of names.
- $urpm->register_rpms(@{$options{files}});
- }
-
- #- relocate depslist.
- $urpm->relocate_depslist_provides();
}
#- add a new medium, sync the config file accordingly.
@@ -1299,7 +1291,7 @@ sub register_rpms {
($id, undef) = $urpm->parse_rpm($_);
my $pkg = $urpm->{depslist}[$id];
$pkg or $urpm->{error}(_("unable to register rpm file")), next;
- #TODO $pkg->{source} = $1 ? $_ : "./$_";
+ $urpm->{source}{$id} = $1 ? $_ : "./$_";
}
$error and $urpm->{fatal}(1, _("error registering local packages"));
@@ -1450,11 +1442,11 @@ sub filter_packages_to_upgrade {
foreach (@$id) {
my $pkg = $urpm->{depslist}[$_];
$pkg->arch eq 'src' and return;
- $options{keep_alldeps} || exists $installed{$pkg->id} and return 0;
- my $count = $db->traverse_tag('name', [ $pkg->name ], sub {
- my ($p) = @_;
- $installed{$pkg->id} ||= $pkg->compare_pkg($p) <= 0;
- });
+ my $count = $options{keep_alldeps} || exists $installed{$pkg->id} ? 0 :
+ $db->traverse_tag('name', [ $pkg->name ], sub {
+ my ($p) = @_;
+ $installed{$pkg->id} ||= $pkg->compare_pkg($p) <= 0;
+ });
if (exists $packages->{$_} || $count > 0) {
$installed{$pkg->id} or push @forced_selection, $_;
} else {
@@ -1604,8 +1596,8 @@ sub filter_packages_to_upgrade {
$provides{$_} and next;
foreach my $id (keys %{$urpm->{provides}{$n} || {}}) {
-#TODO exists $conflicts{$fullname} and next;
my $pkg = $urpm->{depslist}[$id];
+ exists $conflicts{$pkg->fullname} and next;
$pkg->arch eq 'src' and next;
$selected{$n} || $selected{$pkg->name} and %pre_choices=(), last;
#- check if a unsatisfied selection on a package is needed,
@@ -1655,11 +1647,12 @@ sub filter_packages_to_upgrade {
push @choices, $pkg;
$pkg->arch eq 'src' and return;
- $options{keep_alldeps} || exists $installed{$pkg->id} and return 0;
- $db->traverse_tag('name', [ $pkg->name ], sub {
- my ($p) = @_;
- $installed{$pkg->id} ||= $pkg->compare_pkg($p) <= 0;
- });
+ unless ($options{keep_alldeps} || exists $installed{$pkg->id}) {
+ $db->traverse_tag('name', [ $pkg->name ], sub {
+ my ($p) = @_;
+ $installed{$pkg->id} ||= $pkg->compare_pkg($p) <= 0;
+ });
+ }
$installed{$pkg->id} and delete $packages->{$pkg->id};
exists $installed{$pkg->id} and push @upgradable_choices, $pkg;
}
@@ -1730,11 +1723,11 @@ sub get_source_packages {
#- build association hash to retrieve id and examine all list files.
foreach (keys %$packages) {
my $p = $urpm->{depslist}[$_];
-#TODO if ($p->{source}) {
-#TODO $local_sources{$_} = $p->{source};
-#TODO } else {
+ if ($urpm->{source}{$_}) {
+ $local_sources{$_} = $urpm->{source}{$_};
+ } else {
$fullname2id{$p->fullname} = $_;
-#TODO }
+ }
}
#- examine each medium to search for packages.
@@ -1982,7 +1975,7 @@ sub select_packages_to_upgrade {
#'compat-libs' => 1,
);
- #- TODO installed flag on id.
+ #- installed flag on id.
my %installed;
#- help removing package which may have different release numbering