From 4f2f4aa7ae78aa7cf130b419c5ea1bf776cfde74 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 5 Jun 2002 12:21:17 +0000 Subject: 3.4-4mdk final. --- urpm.pm | 43 ++++++++++++++++++------------------------- urpmi | 12 +++++++++--- urpmi.spec | 7 ++++++- urpmq | 30 +++++++++++++++++++----------- 4 files changed, 52 insertions(+), 40 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 diff --git a/urpmi b/urpmi index b0cb8be6..965dca04 100755 --- a/urpmi +++ b/urpmi @@ -189,15 +189,21 @@ $verbose or $urpm->{log} = sub {}; $urpm->configure(nocheck_access => $uid > 0, media => $media, update => $update, - (@files, @src_files) > 0 ? (files => [ @files, @src_files ]) : (), ); -#TODO files and src_files are incorporated but no results from them. + +my ($start, $end) = $urpm->register_rpms(@files, @src_files); + +#- relocate depslist. +$urpm->relocate_depslist_provides(); + +#- select individual files. +my %packages; +@packages{($start .. $end)} = (); #- search the packages according the selection given by the user, #- basesystem is added to the list so if it need to be upgraded, #- all its dependency will be updated too. #- make sure basesystem exists before. -my %packages; if (@names) { $urpm->search_packages(\%packages, [ @names ], all => $all, diff --git a/urpmi.spec b/urpmi.spec index 389a872f..c859f5a3 100644 --- a/urpmi.spec +++ b/urpmi.spec @@ -2,7 +2,7 @@ Name: urpmi Version: 3.4 -Release: 3mdk +Release: 4mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -144,6 +144,11 @@ fi %changelog +* Wed Jun 5 2002 François Pons 3.4-4mdk +- fixed urpmq. +- fixed incomplete requires on some cases. +- fixed reading of rpm files. + * Wed Jun 5 2002 François Pons 3.4-3mdk - avoid sub of sub with different level of variable closure in perl, this cause the interpreter to lose its memory usage. diff --git a/urpmq b/urpmq index e408b8a5..84f351f3 100755 --- a/urpmq +++ b/urpmq @@ -18,7 +18,7 @@ #- this program is based upon urpmi. -#use strict qw(subs vars refs); +use strict; use urpm; # get I18N translation method. @@ -115,14 +115,22 @@ $query->{verbose} or $urpm->{log} = sub {}; $urpm->configure(nocheck_access => 1, media => $query->{media}, - update => $query->{update} - @files > 0 ? (files => [ @files ]) : (), + update => $query->{update}, ); + +my ($start, $end) = $urpm->register_rpms(@files); + +#- relocate depslist. +$urpm->relocate_depslist_provides(); + +#- select individual files. +my %packages; +@packages{($start .. $end)} = (); + #- search the packages according the selection given by the user, #- basesystem is added to the list so if it need to be upgraded, all its dependency #- will be updated too. -my %packages; if (@names) { $urpm->search_packages(\%packages, [ @names ], use_provides => $query->{use_provides}, @@ -140,7 +148,7 @@ if (@src_names) { #- open/close of database should be moved here, in order to allow testing #- some bogus case and check for integrity. if ($query->{auto_select} || $query->{deps}) { - my $db = URPM::DB::open($root); + my $db = URPM::DB::open($query->{root}); my $sig_handler = sub { undef $db; exit 3 }; local $SIG{INT} = $sig_handler; local $SIG{QUIT} = $sig_handler; @@ -202,13 +210,13 @@ if ($query->{headers} || $query->{sources}) { #- print sub for query. my $query_sub = sub { my ($id) = @_; - my $info = $urpm->{params}{depslist}[$id]; + my $pkg = $urpm->{depslist}[$id]; my $str = ''; - $query->{group} and $str .= $info->{group} . '/'; - $str .= $info->{name}; - $query->{version} and $str .= '-' . $info->{version}; - $query->{release} and $str .= '-' . $info->{release}; - $query->{arch} and $str .= '.' . $info->{arch}; + $query->{group} and $str .= $pkg->group . '/'; + $str .= $pkg->name; + $query->{version} and $str .= '-' . $pkg->version; + $query->{release} and $str .= '-' . $pkg->release; + $query->{arch} and $str .= '.' . $pkg->arch; $str; }; -- cgit v1.2.1