summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-12-17 15:27:45 +0000
committerFrancois Pons <fpons@mandriva.com>2001-12-17 15:27:45 +0000
commit4d94c8bbdb19eebc62cf4e36dcaff3c639f9f045 (patch)
tree2f508c265f57133552a653d55d47386b6c8f04e8
parent0fece979dbb6f1ad6d02424f4117f9e1ee32bfe3 (diff)
downloadurpmi-4d94c8bbdb19eebc62cf4e36dcaff3c639f9f045.tar
urpmi-4d94c8bbdb19eebc62cf4e36dcaff3c639f9f045.tar.gz
urpmi-4d94c8bbdb19eebc62cf4e36dcaff3c639f9f045.tar.bz2
urpmi-4d94c8bbdb19eebc62cf4e36dcaff3c639f9f045.tar.xz
urpmi-4d94c8bbdb19eebc62cf4e36dcaff3c639f9f045.zip
small fixes.
-rw-r--r--urpm.pm47
-rwxr-xr-xurpmi5
-rw-r--r--urpmi.spec11
-rwxr-xr-xurpmq2
4 files changed, 46 insertions, 19 deletions
diff --git a/urpm.pm b/urpm.pm
index 4d881d1c..ac5b99fb 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -102,7 +102,7 @@ sub sync_curl {
my (@ftp_files, @other_files);
foreach (@_) {
/^ftp:\/\/.*\/([^\/]*)$/ && -s $1 > 8192 and do { push @ftp_files, $_; next }; #- manage time stamp for large file only.
- push @other_files;
+ push @other_files, $_;
}
if (@ftp_files) {
my ($cur_ftp_file, %ftp_files_info);
@@ -1336,11 +1336,11 @@ sub filter_packages_to_upgrade {
my (@forced_selection, @selection);
#- at this point we have almost only choices to resolves.
- #- but we have to check if one package here is already selected
- #- previously, if this is the case, use it instead.
- #- if a choice is proposed with package already installed (this is the case for
- #- a provide with a lot of choices, we have to filter according to those who
- #- are installed).
+ #- but we have to check if one package here is already selected
+ #- previously, if this is the case, use it instead.
+ #- if a choice is proposed with package already installed (this is the case for
+ #- a provide with a lot of choices, we have to filter according to those who
+ #- are installed).
foreach (@$id) {
if (exists $packages->{$_} ||
rpmtools::db_traverse_tag($db, "name",
@@ -1353,11 +1353,11 @@ sub filter_packages_to_upgrade {
#- propose the choice to the user now, or select the best one (as it is supposed to be).
@selection = @forced_selection ? @forced_selection :
- $select_choices && @selection > 1 ?
- ($select_choices->($urpm, undef, @selection)) : ($selection[0]);
+ $select_choices ? (@selection > 1 ? ($select_choices->($urpm, undef, @selection)) : ($selection[0])) :
+ (join '|', @selection);
foreach (@selection) {
unless (exists $packages->{$_}) {
- unshift @packages, $_;
+ /\|/ or unshift @packages, $_;
$packages->{$_} = 1;
}
}
@@ -1753,6 +1753,12 @@ sub extract_packages_to_install {
chomp; s/#.*$//; s/^\s*//; s/\s*$//;
foreach (keys %{$urpm->{params}{provides}{$_} || {}}) {
my $pkg = $urpm->{params}{info}{$_} or next;
+
+ #- some package with specific naming convention to avoid upgrade problem
+ #- should not be taken into account here.
+ #- these package have version=1 and release=1mdk, and name contains version and release.
+ $pkg->{version} eq '1' && $pkg->{release} eq '1mdk' && $pkg->{name} =~ /^.*-[^\-]*mdk$/ and next;
+
exists $sources->{$pkg->{id}} and $inst{$pkg->{id}} = delete $sources->{$pkg->{id}};
}
}
@@ -1762,7 +1768,7 @@ sub extract_packages_to_install {
}
sub select_packages_to_upgrade {
- my ($urpm, $prefix, $packages, $remove_packages, $keep_files) = @_;
+ my ($urpm, $prefix, $packages, $remove_packages, $keep_files, %options) = @_;
my $db = rpmtools::db_open($prefix);
#- used for package that are not correctly updated.
@@ -1787,10 +1793,16 @@ sub select_packages_to_upgrade {
#- latter for each transaction.
local (*INPUT, *OUTPUT_CHILD); pipe INPUT, OUTPUT_CHILD;
local (*INPUT_CHILD, *OUTPUT); pipe INPUT_CHILD, OUTPUT;
- if (my $pid = fork()) {
+ if (my $pid = $options{use_parsehdlist} ? fork() : 1) {
close INPUT_CHILD;
close OUTPUT_CHILD;
- select((select(OUTPUT), $| = 1)[0]);
+ #- check if there is a parsehdlist running in the background.
+ if ($pid == 1) {
+ close INPUT;
+ close OUTPUT;
+ } else {
+ select((select(OUTPUT), $| = 1)[0]);
+ }
#- internal reading from interactive mode of parsehdlist.
#- takes a code to call with the line read, this avoid allocating
@@ -1802,7 +1814,7 @@ sub select_packages_to_upgrade {
#- the hdlist does not exists and the medium is marked as using a
#- synthesis file).
my $p = $urpm->{params}{info}{$name} || $urpm->{params}{names}{$name};
- if ($p && $p->{$tag}) {
+ if ($pid == 1 || $p && $p->{$tag}) {
foreach (@{$p->{$tag} || []}) {
$code->($_);
}
@@ -1958,9 +1970,12 @@ sub select_packages_to_upgrade {
%installedFilesForUpgrade = ();
#- no need to still use the child as this point, we can let him to terminate.
- close OUTPUT;
- close INPUT;
- waitpid $pid, 0;
+ #- but only if a child has really been used.
+ if ($pid != 1) {
+ close OUTPUT;
+ close INPUT;
+ waitpid $pid, 0;
+ }
} else {
close INPUT;
close OUTPUT;
diff --git a/urpmi b/urpmi
index ca9e9f03..d7afc1ee 100755
--- a/urpmi
+++ b/urpmi
@@ -26,6 +26,7 @@ import urpm _;
my $update = 0;
my $auto = 0;
my $allow_medium_change = 0;
+my $complete = 0;
my $auto_select = 0;
my $force = 0;
my $sync = undef;
@@ -54,6 +55,7 @@ usage:
") . _(" --update - use only update media.
") . _(" --auto - automatically select a good package in choices.
") . _(" --auto-select - automatically select packages for upgrading the system.
+") . _(" --complete - use parsehdlist server to complete selection.
") . _(" --force - force invocation even if some packages do not exist.
") . _(" --wget - use wget to retrieve distant files.
") . _(" --curl - use curl to retrieve distant files.
@@ -77,6 +79,7 @@ for (@ARGV) {
/^--auto$/ and do { $auto = 1; next };
/^--allow-medium-change$/ and do { $allow_medium_change = 1; next };
/^--auto-select$/ and do { $auto_select = 1; next };
+ /^--complete$/ and do { $complete = 1; next };
/^--force$/ and do { $force = 1; next };
/^--wget$/ and do { $sync = \&urpm::sync_wget; next };
/^--curl$/ and do { $sync = \&urpm::sync_curl; next };
@@ -204,7 +207,7 @@ my $ask_choice = sub {
if ($auto_select) {
my (%to_remove, %keep_files);
- $urpm->select_packages_to_upgrade('', \%packages, \%to_remove, \%keep_files);
+ $urpm->select_packages_to_upgrade('', \%packages, \%to_remove, \%keep_files, use_parsehdlist => $complete);
if (keys(%to_remove) > 0) {
print STDERR "some packages have to be removed for being upgraded, this is not supported yet\n";
diff --git a/urpmi.spec b/urpmi.spec
index 570608c2..52496cc5 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 3.1
-Release: 2mdk
+Release: 3mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -142,6 +142,15 @@ fi
%changelog
+* Mon Dec 17 2001 François Pons <fpons@mandrakesoft.com> 3.1-3mdk
+- fixed choice listing.
+- somewhat fixed -p kernel.
+- fixed installation of package with naming convention changed to
+ make upgrade identical to install (kernel and kernel-source).
+- allow not to use parsehdlist during --auto-select (now disabled
+ by default)
+- fix curl support broken for http files and missing ftp files.
+
* Fri Dec 14 2001 François Pons <fpons@mandrakesoft.com> 3.1-2mdk
- added time conditionnal download to curl interface for both http
and ftp protocol (so need Date::Manip because urpm library use it
diff --git a/urpmq b/urpmq
index 84a15be8..b5d3c814 100755
--- a/urpmq
+++ b/urpmq
@@ -186,7 +186,7 @@ foreach my $id (keys %packages) {
$hack_only_one{$choices} = undef;
}
} else {
- exists $packages{$id} and print $query_sub->($id), "\n";
+ exists $packages{$id} and print join('|', map { $query_sub->($_) } split '\|', $id), "\n";
}
}