summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-09-19 14:15:10 +0000
committerFrancois Pons <fpons@mandriva.com>2003-09-19 14:15:10 +0000
commitb6a045527eb4293f1569b8d534180adf8ad688e8 (patch)
tree45d02224a4b9ddc88e3487a3df98f5a9a45787b6
parent5c7264f47e156a5283ef2f542f51a465b1a18289 (diff)
downloadurpmi-b6a045527eb4293f1569b8d534180adf8ad688e8.tar
urpmi-b6a045527eb4293f1569b8d534180adf8ad688e8.tar.gz
urpmi-b6a045527eb4293f1569b8d534180adf8ad688e8.tar.bz2
urpmi-b6a045527eb4293f1569b8d534180adf8ad688e8.tar.xz
urpmi-b6a045527eb4293f1569b8d534180adf8ad688e8.zip
on-going 4.4-38mdk
-rw-r--r--urpm.pm314
-rw-r--r--urpme32
-rwxr-xr-xurpmi57
-rw-r--r--urpmi.spec8
4 files changed, 230 insertions, 181 deletions
diff --git a/urpm.pm b/urpm.pm
index effea779..639d4ba7 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1091,7 +1091,8 @@ sub remove_selected_media {
$urpm->{modified} = 1;
#- remove file associated with this medium.
- foreach ($_->{hdlist}, $_->{list}, "synthesis.$_->{hdlist}", "descriptions.$_->{name}", "$_->{name}.cache") {
+ foreach ($_->{hdlist}, $_->{list}, "synthesis.$_->{hdlist}", "descriptions.$_->{name}", "names.$_->{name}",
+ "$_->{name}.cache") {
$_ and unlink "$urpm->{statedir}/$_";
}
} else {
@@ -1307,54 +1308,111 @@ this could happen if you mounted manually the directory when creating the medium
#- file are present.
my $basename = basename($with_hdlist_dir);
- if (!$options{nomd5sum} && -s reduce_pathname("$with_hdlist_dir/../MD5SUM") > 32) {
- if ($options{force}) {
- #- force downloading the file again, else why a force option has been defined ?
- delete $medium->{md5sum};
- } else {
- unless ($medium->{md5sum}) {
- $urpm->{log}(N("computing md5sum of existing source hdlist (or synthesis)"));
- if ($medium->{synthesis}) {
- -e "$urpm->{statedir}/synthesis.$medium->{hdlist}" and
- $medium->{md5sum} = (split ' ', `md5sum '$urpm->{statedir}/synthesis.$medium->{hdlist}'`)[0];
- } else {
- -e "$urpm->{statedir}/$medium->{hdlist}" and
- $medium->{md5sum} = (split ' ', `md5sum '$urpm->{statedir}/$medium->{hdlist}'`)[0];
+ unless ($medium->{virtual}) {
+ if (!$options{nomd5sum} && -s reduce_pathname("$with_hdlist_dir/../MD5SUM") > 32) {
+ if ($options{force}) {
+ #- force downloading the file again, else why a force option has been defined ?
+ delete $medium->{md5sum};
+ } else {
+ unless ($medium->{md5sum}) {
+ $urpm->{log}(N("computing md5sum of existing source hdlist (or synthesis)"));
+ if ($medium->{synthesis}) {
+ -e "$urpm->{statedir}/synthesis.$medium->{hdlist}" and
+ $medium->{md5sum} = (split ' ', `md5sum '$urpm->{statedir}/synthesis.$medium->{hdlist}'`)[0];
+ } else {
+ -e "$urpm->{statedir}/$medium->{hdlist}" and
+ $medium->{md5sum} = (split ' ', `md5sum '$urpm->{statedir}/$medium->{hdlist}'`)[0];
+ }
}
}
+ if ($medium->{md5sum}) {
+ $urpm->{log}(N("examining MD5SUM file"));
+ local (*F, $_);
+ open F, reduce_pathname("$with_hdlist_dir/../MD5SUM");
+ while (<F>) {
+ my ($md5sum, $file) = /(\S+)\s+(?:\.\/)?(\S+)/ or next;
+ #- keep md5sum got here to check download was ok ! so even if md5sum is not defined, we need
+ #- to compute it, keep it in mind ;)
+ $file eq $basename and $retrieved_md5sum = $md5sum;
+ }
+ close F;
+ #- if an existing hdlist or synthesis file has the same md5sum, we assume the
+ #- file are the same.
+ #- if local md5sum is the same as distant md5sum, this means there is no need to
+ #- download hdlist or synthesis file again.
+ foreach (@{$urpm->{media}}) {
+ if ($_->{md5sum} && $_->{md5sum} eq $retrieved_md5sum) {
+ unlink "$urpm->{cachedir}/partial/$basename";
+ #- the medium is now considered not modified.
+ $medium->{modified} = 0;
+ #- hdlist or synthesis file must be linked with the other same one.
+ #- a link is better for reducing used size of /var/lib/urpmi.
+ if ($_ ne $medium) {
+ $medium->{md5sum} = $_->{md5sum};
+ unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}";
+ unlink "$urpm->{statedir}/$medium->{hdlist}";
+ symlink "synthesis.$_->{hdlist}", "$urpm->{statedir}/synthesis.$medium->{hdlist}";
+ symlink $_->{hdlist}, "$urpm->{statedir}/$medium->{hdlist}";
+ }
+ #- as previously done, just read synthesis file here, this is enough.
+ $urpm->{log}(N("examining synthesis file [%s]",
+ "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
+ eval { ($medium->{start}, $medium->{end}) =
+ $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$medium->{hdlist}") };
+ unless (defined $medium->{start} && defined $medium->{end}) {
+ $urpm->{log}(N("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
+ eval { ($medium->{start}, $medium->{end}) =
+ $urpm->parse_hdlist("$urpm->{statedir}/$medium->{hdlist}", packing => 1) };
+ unless (defined $medium->{start} && defined $medium->{end}) {
+ $urpm->{error}(N("problem reading hdlist or synthesis file of medium \"%s\"",
+ $medium->{name}));
+ $medium->{ignore} = 1;
+ }
+ }
+ #- no need to continue examining other md5sum.
+ last;
+ }
+ }
+ $medium->{modified} or next;
+ }
}
- if ($medium->{md5sum}) {
- $urpm->{log}(N("examining MD5SUM file"));
- local (*F, $_);
- open F, reduce_pathname("$with_hdlist_dir/../MD5SUM");
- while (<F>) {
- my ($md5sum, $file) = /(\S+)\s+(?:\.\/)?(\S+)/ or next;
- #- keep md5sum got here to check download was ok ! so even if md5sum is not defined, we need
- #- to compute it, keep it in mind ;)
- $file eq $basename and $retrieved_md5sum = $md5sum;
+
+ #- if the source hdlist is present and we are not forcing using rpms file
+ if ($options{force} < 2 && $medium->{with_hdlist} && -e $with_hdlist_dir) {
+ unlink "$urpm->{cachedir}/partial/$medium->{hdlist}";
+ $urpm->{log}(N("copying source hdlist (or synthesis) of \"%s\"...", $medium->{name}));
+ $options{callback} && $options{callback}('copy', $medium->{name});
+ if (system("cp", "--preserve=mode", "--preserve=timestamps", "-R", $with_hdlist_dir,
+ "$urpm->{cachedir}/partial/$medium->{hdlist}")) {
+ $options{callback} && $options{callback}('failed', $medium->{name});
+ $urpm->{log}(N("...copying failed"));
+ unlink "$urpm->{cachedir}/partial/$medium->{hdlist}"; #- force error...
+ } else {
+ $options{callback} && $options{callback}('done', $medium->{name});
+ $urpm->{log}(N("...copying done"));
}
- close F;
- #- if an existing hdlist or synthesis file has the same md5sum, we assume the
- #- file are the same.
- #- if local md5sum is the same as distant md5sum, this means there is no need to
- #- download hdlist or synthesis file again.
- foreach (@{$urpm->{media}}) {
- if ($_->{md5sum} && $_->{md5sum} eq $retrieved_md5sum) {
- unlink "$urpm->{cachedir}/partial/$basename";
- #- the medium is now considered not modified.
+
+ -s "$urpm->{cachedir}/partial/$medium->{hdlist}" > 32 or
+ $error = 1, $urpm->{error}(N("copy of [%s] failed", $with_hdlist_dir));
+
+ #- keep checking md5sum of file just copied ! (especially on nfs or removable device).
+ if (!$error && $retrieved_md5sum) {
+ $urpm->{log}(N("computing md5sum of copied source hdlist (or synthesis)"));
+ (split ' ', `md5sum '$urpm->{cachedir}/partial/$medium->{hdlist}'`)[0] eq $retrieved_md5sum or
+ $error = 1, $urpm->{error}(N("copy of [%s] failed", $with_hdlist_dir));
+ }
+
+ #- check if the file are equals... and no force copy...
+ if (!$error && !$options{force} && -e "$urpm->{statedir}/synthesis.$medium->{hdlist}") {
+ my @sstat = stat "$urpm->{cachedir}/partial/$medium->{hdlist}";
+ my @lstat = stat "$urpm->{statedir}/$medium->{hdlist}";
+ if ($sstat[7] == $lstat[7] && $sstat[9] == $lstat[9]) {
+ #- the two files are considered equal here, the medium is so not modified.
$medium->{modified} = 0;
- #- hdlist or synthesis file must be linked with the other same one.
- #- a link is better for reducing used size of /var/lib/urpmi.
- if ($_ ne $medium) {
- $medium->{md5sum} = $_->{md5sum};
- unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}";
- unlink "$urpm->{statedir}/$medium->{hdlist}";
- symlink "synthesis.$_->{hdlist}", "$urpm->{statedir}/synthesis.$medium->{hdlist}";
- symlink $_->{hdlist}, "$urpm->{statedir}/$medium->{hdlist}";
- }
- #- as previously done, just read synthesis file here, this is enough.
- $urpm->{log}(N("examining synthesis file [%s]",
- "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
+ unlink "$urpm->{cachedir}/partial/$medium->{hdlist}";
+ #- as previously done, just read synthesis file here, this is enough, but only
+ #- if synthesis exists, else it need to be recomputed.
+ $urpm->{log}(N("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
eval { ($medium->{start}, $medium->{end}) =
$urpm->parse_synthesis("$urpm->{statedir}/synthesis.$medium->{hdlist}") };
unless (defined $medium->{start} && defined $medium->{end}) {
@@ -1362,128 +1420,72 @@ this could happen if you mounted manually the directory when creating the medium
eval { ($medium->{start}, $medium->{end}) =
$urpm->parse_hdlist("$urpm->{statedir}/$medium->{hdlist}", packing => 1) };
unless (defined $medium->{start} && defined $medium->{end}) {
- $urpm->{error}(N("problem reading hdlist or synthesis file of medium \"%s\"", $medium->{name}));
+ $urpm->{error}(N("problem reading synthesis file of medium \"%s\"", $medium->{name}));
$medium->{ignore} = 1;
}
}
- #- no need to continue examining other md5sum.
- last;
+ next;
}
}
- $medium->{modified} or next;
+ } else {
+ $options{force} < 2 and $options{force} = 2;
}
- }
- }
-
- #- if the source hdlist is present and we are not forcing using rpms file
- if ($options{force} < 2 && $medium->{with_hdlist} && -e $with_hdlist_dir) {
- unlink "$urpm->{cachedir}/partial/$medium->{hdlist}";
- $urpm->{log}(N("copying source hdlist (or synthesis) of \"%s\"...", $medium->{name}));
- $options{callback} && $options{callback}('copy', $medium->{name});
- if (system("cp", "--preserve=mode", "--preserve=timestamps", "-R", $with_hdlist_dir,
- "$urpm->{cachedir}/partial/$medium->{hdlist}")) {
- $options{callback} && $options{callback}('failed', $medium->{name});
- $urpm->{log}(N("...copying failed"));
- unlink "$urpm->{cachedir}/partial/$medium->{hdlist}"; #- force error...
- } else {
- $options{callback} && $options{callback}('done', $medium->{name});
- $urpm->{log}(N("...copying done"));
- }
-
- -s "$urpm->{cachedir}/partial/$medium->{hdlist}" > 32 or
- $error = 1, $urpm->{error}(N("copy of [%s] failed", $with_hdlist_dir));
-
- #- keep checking md5sum of file just copied ! (especially on nfs or removable device).
- if (!$error && $retrieved_md5sum) {
- $urpm->{log}(N("computing md5sum of copied source hdlist (or synthesis)"));
- (split ' ', `md5sum '$urpm->{cachedir}/partial/$medium->{hdlist}'`)[0] eq $retrieved_md5sum or
- $error = 1, $urpm->{error}(N("copy of [%s] failed", $with_hdlist_dir));
- }
- #- check if the file are equals... and no force copy...
- if (!$error && !$options{force} && -e "$urpm->{statedir}/synthesis.$medium->{hdlist}") {
- my @sstat = stat "$urpm->{cachedir}/partial/$medium->{hdlist}";
- my @lstat = stat "$urpm->{statedir}/$medium->{hdlist}";
- if ($sstat[7] == $lstat[7] && $sstat[9] == $lstat[9]) {
- #- the two files are considered equal here, the medium is so not modified.
- $medium->{modified} = 0;
- unlink "$urpm->{cachedir}/partial/$medium->{hdlist}";
- #- as previously done, just read synthesis file here, this is enough, but only
- #- if synthesis exists, else it need to be recomputed.
- $urpm->{log}(N("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
- eval { ($medium->{start}, $medium->{end}) =
- $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$medium->{hdlist}") };
- unless (defined $medium->{start} && defined $medium->{end}) {
- $urpm->{log}(N("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
- eval { ($medium->{start}, $medium->{end}) =
- $urpm->parse_hdlist("$urpm->{statedir}/$medium->{hdlist}", packing => 1) };
- unless (defined $medium->{start} && defined $medium->{end}) {
- $urpm->{error}(N("problem reading synthesis file of medium \"%s\"", $medium->{name}));
- $medium->{ignore} = 1;
- }
- }
- next;
+ #- if copying hdlist has failed, try to build it directly.
+ if ($error) {
+ $options{force} < 2 and $options{force} = 2;
+ #- clean error state now.
+ $error = undef;
}
- }
- } else {
- $options{force} < 2 and $options{force} = 2;
- }
- #- if copying hdlist has failed, try to build it directly.
- if ($error) {
- $options{force} < 2 and $options{force} = 2;
- #- clean error state now.
- $error = undef;
- }
-
- unless ($medium->{virtual}) {
- if ($options{force} < 2) {
- #- examine if a local list file is available (always probed according to with_hdlist
- #- and check hdlist has not be named very strangely...
- if ($medium->{hdlist} ne 'list') {
- my $local_list = $medium->{with_hdlist} =~ /hd(list.*)\.cz2?$/ ? $1 : 'list';
- my $path_list = reduce_pathname("$with_hdlist_dir/../$local_list");
- -s $path_list or $path_list = "$dir/list";
- -s $path_list and system("cp", "--preserve=mode", "--preserve=timestamps", "-R",
- $path_list, "$urpm->{cachedir}/partial/list");
- }
- } else {
- #- try to find rpm files, use recursive method, added additional
- #- / after dir to make sure it will be taken into account if this
- #- is a symlink to a directory.
- #- make sure rpm filename format is correct and is not a source rpm
- #- which are not well managed by urpmi.
- @files = split "\n", `find '$dir/' -name "*.rpm" -print`;
-
- #- check files contains something good!
- if (@files > 0) {
- #- we need to rebuild from rpm files the hdlist.
- eval {
- $urpm->{log}(N("reading rpm files from [%s]", $dir));
- my @unresolved_before = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
- $medium->{start} = @{$urpm->{depslist}};
- $medium->{headers} = [ $urpm->parse_rpms_build_headers(dir => "$urpm->{cachedir}/headers",
- rpms => \@files,
- clean => $cleaned_cache,
- ) ];
- $medium->{end} = $#{$urpm->{depslist}};
- if ($medium->{start} > $medium->{end}) {
- #- an error occured (provided there are files in input.
- delete $medium->{start};
- delete $medium->{end};
- die "no rpms read\n";
- } else {
- $cleaned_cache = 0; #- make sure the headers will not be removed for another media.
- my @unresolved_after = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
- @unresolved_before == @unresolved_after or $second_pass = 1;
- }
- };
- $@ and $error = 1, $urpm->{error}(N("unable to read rpm files from [%s]: %s", $dir, $@));
- $error and delete $medium->{headers}; #- do not propagate these.
- $error or delete $medium->{synthesis}; #- when building hdlist by ourself, drop synthesis property.
+ if ($options{force} < 2) {
+ #- examine if a local list file is available (always probed according to with_hdlist
+ #- and check hdlist has not be named very strangely...
+ if ($medium->{hdlist} ne 'list') {
+ my $local_list = $medium->{with_hdlist} =~ /hd(list.*)\.cz2?$/ ? $1 : 'list';
+ my $path_list = reduce_pathname("$with_hdlist_dir/../$local_list");
+ -s $path_list or $path_list = "$dir/list";
+ -s $path_list and system("cp", "--preserve=mode", "--preserve=timestamps", "-R",
+ $path_list, "$urpm->{cachedir}/partial/list");
+ }
} else {
- $error = 1;
- $urpm->{error}(N("no rpm files found from [%s]", $dir));
+ #- try to find rpm files, use recursive method, added additional
+ #- / after dir to make sure it will be taken into account if this
+ #- is a symlink to a directory.
+ #- make sure rpm filename format is correct and is not a source rpm
+ #- which are not well managed by urpmi.
+ @files = split "\n", `find '$dir/' -name "*.rpm" -print`;
+
+ #- check files contains something good!
+ if (@files > 0) {
+ #- we need to rebuild from rpm files the hdlist.
+ eval {
+ $urpm->{log}(N("reading rpm files from [%s]", $dir));
+ my @unresolved_before = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
+ $medium->{start} = @{$urpm->{depslist}};
+ $medium->{headers} = [ $urpm->parse_rpms_build_headers(dir => "$urpm->{cachedir}/headers",
+ rpms => \@files,
+ clean => $cleaned_cache,
+ ) ];
+ $medium->{end} = $#{$urpm->{depslist}};
+ if ($medium->{start} > $medium->{end}) {
+ #- an error occured (provided there are files in input.
+ delete $medium->{start};
+ delete $medium->{end};
+ die "no rpms read\n";
+ } else {
+ $cleaned_cache = 0; #- make sure the headers will not be removed for another media.
+ my @unresolved = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
+ @unresolved_before == @unresolved or $second_pass = 1;
+ }
+ };
+ $@ and $error = 1, $urpm->{error}(N("unable to read rpm files from [%s]: %s", $dir, $@));
+ $error and delete $medium->{headers}; #- do not propagate these.
+ $error or delete $medium->{synthesis}; #- when building hdlist by ourself, drop synthesis property.
+ } else {
+ $error = 1;
+ $urpm->{error}(N("no rpm files found from [%s]", $dir));
+ }
}
}
}
diff --git a/urpme b/urpme
index 085b216d..a63747b1 100644
--- a/urpme
+++ b/urpme
@@ -41,6 +41,7 @@ usage:
", $urpm::VERSION) . N(" --help - print this help message.
") . N(" --auto - automatically select a package in choices.
") . N(" --test - verify if the installation can be achieved correctly.
+") . N(" --force - force invocation even if some packages do not exist.
") . N(" --parallel - distributed urpmi accross machines of alias.
") . N(" -v - verbose mode.
") . N(" -a - select all packages matching expression.
@@ -107,8 +108,8 @@ if ($test && $auto) {
$sum += $state->{rejected}{$_}{size};
}
my $msg = N("To satisfy dependencies, the following packages will be removed (%d MB)", toMb($sum));
- print STDOUT "$msg:\n$list\n$askok" . N(" (Y/n) ");
- <STDIN> =~ /[$noexpr]/ and exit 0;
+ print STDOUT "$msg:\n$list\n";
+ message_input("$askok" . N(" (Y/n) "), $force && $yesexpr, boolean => 1) =~ /[$noexpr]/ and exit 0;
}
print STDOUT "\n".N("removing %s", join(' ', sort @toremove))."\n";
@@ -121,3 +122,30 @@ sub toMb {
my $nb = $_[0] / 1024 / 1024;
int $nb + 0.5;
}
+
+sub message_input {
+ my ($msg, $default_input, %options) = @_;
+ my $input;
+ my $noexpr = N("Nn");
+ my $yesexpr = N("Yy");
+
+ while (1) {
+ print STDOUT $msg;
+ if ($default_input) {
+ $bug and log_it($input);
+ return $default_input;
+ }
+ $input = <STDIN>;
+ defined $input or return undef;
+ $bug and log_it($input);
+ if ($options{boolean}) {
+ $input =~ /^[$noexpr$yesexpr]*$/ and last;
+ } elsif ($options{range}) {
+ 1 <= $input && $input <= $options{range} and last;
+ } else {
+ last;
+ }
+ print STDOUT N("Sorry, bad choice, try again\n")."\n";
+ }
+ return $input;
+}
diff --git a/urpmi b/urpmi
index e5164972..4a672bfe 100755
--- a/urpmi
+++ b/urpmi
@@ -402,12 +402,8 @@ sub ask_choice {
} else {
message($msg);
my $i = 0; foreach (@l) { message(" " . ++$i . "- $_") }
- while (1) {
- $n = message_input(N("What is your choice? (1-%d) ", $i));
- defined $n or exit 1;
- 1 <= $n && $n <= $i and last;
- message(N("Sorry, bad choice, try again\n"));
- }
+ $n = message_input(N("What is your choice? (1-%d) ", $i), undef, range => $i);
+ defined $n or exit 1;
}
}
@@ -438,7 +434,7 @@ if (@ask_unselect) {
} else {
$noexpr = N("Nn");
$yesexpr = N("Yy");
- message_input($msg . N(" (Y/n) "), $force && $yesexpr) =~ /[$noexpr]/ and exit 0;
+ message_input($msg . N(" (Y/n) "), $force && $yesexpr, boolean => 1) =~ /[$noexpr]/ and exit 0;
}
}
}
@@ -464,7 +460,7 @@ have to be removed for others to be upgraded:\n%s\n", $list);
} else {
$noexpr = N("Nn");
$yesexpr = N("Yy");
- message_input($msg . N(" (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/ or exit 0;
+ message_input($msg . N(" (y/N) "), $force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or exit 0;
}
}
}
@@ -510,7 +506,7 @@ if (@root_only) {
} else {
$noexpr = N("Nn");
$yesexpr = N("Yy");
- message_input("$msg:\n$p\n$msg2" . N(" (Y/n) "), $force && $yesexpr) =~ /[$noexpr]/ and exit 0;
+ message_input("$msg:\n$p\n$msg2" . N(" (Y/n) "), $force && $yesexpr, boolean => 1) =~ /[$noexpr]/ and exit 0;
}
}
@@ -619,7 +615,7 @@ foreach my $set (@{$state->{transaction} || []}) {
} else {
$noexpr = N("Nn");
$yesexpr = N("Yy");
- message_input("$msg:\n$p\n$msg2" . N(" (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/ or exit 1;
+ message_input("$msg:\n$p\n$msg2" . N(" (y/N) "), $force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or exit 1;
}
}
}
@@ -697,8 +693,8 @@ foreach my $set (@{$state->{transaction} || []}) {
} else {
$noexpr = N("Nn");
$yesexpr = N("Yy");
- message_input(N("Try installation without checking dependencies? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
- or ++$nok, next;
+ message_input(N("Try installation without checking dependencies? (y/N) "),
+ $force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or ++$nok, next;
$urpm->{log}("starting installing packages without deps");
@l = $urpm->install(!$urpm->{options}{'allow-force'} && $set->{remove} || [],
\%transaction_sources_install, \%transaction_sources,
@@ -714,8 +710,8 @@ foreach my $set (@{$state->{transaction} || []}) {
++$nok;
push @errors, @l;
} else {
- message_input(N("Try installation even more strongly (--force)? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
- or ++$nok, next;
+ message_input(N("Try installation even more strongly (--force)? (y/N) "),
+ $force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or ++$nok, next;
$urpm->{log}("starting force installing packages without deps");
@l = $urpm->install(!$urpm->{options}{'allow-force'} && $set->{remove} || [],
\%transaction_sources_install, \%transaction_sources,
@@ -816,21 +812,38 @@ sub message {
}
}
sub message_input {
- my ($msg, $default_input) = @_;
+ my ($msg, $default_input, %options) = @_;
+ my $input;
if ($X && !$default_input) { #- if a default input is given, the user doesn't have to choose (and being asked).
gmessage($msg, ok_only => 1);
$bug and log_it($msg);
} else {
- if ($bug) {
- print STDOUT $msg;
- } else {
- print SAVEOUT $msg;
+ my $noexpr = N("Nn");
+ my $yesexpr = N("Yy");
+ while (1) {
+ if ($bug) {
+ print STDOUT $msg;
+ } else {
+ print SAVEOUT $msg;
+ }
+ if ($default_input) {
+ $bug and log_it($input);
+ return $default_input;
+ }
+ $input = <STDIN>;
+ defined $input or return undef;
+ $bug and log_it($input);
+ if ($options{boolean}) {
+ $input =~ /^[$noexpr$yesexpr]*$/ and last;
+ } elsif ($options{range}) {
+ 1 <= $input && $input <= $options{range} and last;
+ } else {
+ last;
+ }
+ message(N("Sorry, bad choice, try again\n"));
}
}
-
- my $input = $default_input || <STDIN>;
- $bug and log_it($input);
return $input;
}
diff --git a/urpmi.spec b/urpmi.spec
index 65a64bcc..71c80d8b 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 4.4
-Release: 37mdk
+Release: 38mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -202,6 +202,12 @@ $urpm->update_media(nolock => 1, nopubkey => 1);
%changelog
+* Fri Sep 19 2003 François Pons <fpons@mandrakesoft.com> 4.4-38mdk
+- fixed md5sum or copy of hdlist of virtual media uneeded.
+- fixed bug 5807 for names.XXX files still present after removing
+ medium XXX.
+- fixed bug 5802 about exotic character recognized as default answer.
+
* Wed Sep 17 2003 François Pons <fpons@mandrakesoft.com> 4.4-37mdk
- fixed virtual media examination of list file.