summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-05 08:48:27 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-05 08:48:27 +0000
commitc6959350b3843cd98a9c2ed125aa60f0008791f8 (patch)
treeec6a1123d2535d9f088c0b27f9ff222eb3a4f27d
parentc5e0ec30567cc78b73353bc51d7ba88f6876629b (diff)
downloadurpmi-c6959350b3843cd98a9c2ed125aa60f0008791f8.tar
urpmi-c6959350b3843cd98a9c2ed125aa60f0008791f8.tar.gz
urpmi-c6959350b3843cd98a9c2ed125aa60f0008791f8.tar.bz2
urpmi-c6959350b3843cd98a9c2ed125aa60f0008791f8.tar.xz
urpmi-c6959350b3843cd98a9c2ed125aa60f0008791f8.zip
committed on going work to handle quietly sncf work stop.
-rwxr-xr-xurpmi23
-rw-r--r--urpmi.spec7
-rwxr-xr-xurpmq2
3 files changed, 28 insertions, 4 deletions
diff --git a/urpmi b/urpmi
index 31dd8c3c..806cc7fd 100755
--- a/urpmi
+++ b/urpmi
@@ -31,6 +31,7 @@ my $synthesis = '';
my $auto = 0;
my $allow_medium_change = 0;
my $auto_select = 0;
+my $no_remove = 0;
my $force = 0;
my $parallel = '';
my $sync;
@@ -77,6 +78,7 @@ usage:
") . N(" --synthesis - use the given synthesis instead of urpmi db.
") . N(" --auto - automatically select a package in choices.
") . N(" --auto-select - automatically select packages to upgrade the system.
+") . N(" --no-uninstall - never ask to uninstall a package, abort the installation.
") . N(" --fuzzy - impose fuzzy search (same as -y).
") . N(" --src - next package is a source package (same as -s).
") . N(" --install-src - install only source package (no binaries).
@@ -144,6 +146,7 @@ while (defined($_ = shift @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 };
+ /^--no-(remove|uninstall)$/ and do { $no_remove = 1; next };
/^--(no-)?fuzzy$/ and do { $urpm->{options}{fuzzy} = !$1; next };
/^--src$/ and do { $src = 1; next };
/^--install-src$/ and do { $install_src = 1; next };
@@ -382,6 +385,7 @@ $urpm->resolve_dependencies($state, \%requested,
auto_select => $auto_select,
callback_choices => \&ask_choice,
install_src => $install_src,
+ nodeps => $urpm->{options}{'allow-nodeps'} || $urpm->{options}{'allow-force'},
);
my @ask_unselect = grep { $state->{rejected}{$_}{backtrack} } keys %{$state->{rejected} || {}};
@@ -404,6 +408,11 @@ if (@ask_unselect) {
}
}
}
+
+foreach (sort { $a cmp $b } keys %{$state->{rejected} || {}}) {
+ my $v = $state->{rejected}{$_};
+ print STDERR "<<$_>> removed=$v->{removed}, obsoleted=$v->{obsoleted}, size=$v->{size};\n";
+}
my @ask_remove = grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } keys %{$state->{rejected} || {}};
if (@ask_remove) {
unless ($auto) {
@@ -433,6 +442,14 @@ if (@ask_remove) {
#- now insert the reason if available.
$_ . ($s ? " ($s)" : '');
} sort { $a cmp $b } @ask_remove;
+
+ if ($no_remove) {
+ my $msg = N("The installation cannot continue because the following packages
+have to be removed for others to be upgraded:\n%s\n", $list);
+ message($msg);
+ exit 0;
+ }
+
my $msg = N("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list);
if ($X) {
gmessage($msg);
@@ -440,7 +457,7 @@ if (@ask_remove) {
} else {
$noexpr = N("Nn");
$yesexpr = N("Yy");
- message_input($msg . N(" (Y/n) ")) =~ /[$noexpr]/ and exit 0;
+ message_input($msg . N(" (y/N) ")) =~ /[$yesexpr]/ or exit 0;
}
}
}
@@ -455,7 +472,9 @@ my $sum = 0;
my @root_only;
foreach my $pkg (sort { $a->name cmp $b->name } @{$urpm->{depslist}}[keys %{$state->{selected}}]) {
- $ask_user ||= $pkg->flag_required || $auto_select || $parallel;
+ #- reflect change in flag usage, now requested is set whatever a package is selected or not,
+ #- but required is always set (so a required but not requested is a pure dependencies).
+ $ask_user ||= !$pkg->flag_requested || $auto_select || $parallel;
my $fullname = $pkg->fullname;
if (!$env && $install_src && $pkg->arch ne 'src') {
diff --git a/urpmi.spec b/urpmi.spec
index 47edbec1..94dd7e69 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -9,7 +9,7 @@ Source1: %{name}.logrotate
Summary: User mode rpm install
URL: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/urpmi
Requires: eject webfetch perl-DateManip >= 5.40 gnupg
-PreReq: perl-Locale-gettext >= 1.01-7mdk rpmtools >= 4.3-6mdk perl-URPM >= 0.90-2mdk
+PreReq: perl-Locale-gettext >= 1.01-7mdk rpmtools >= 4.3-6mdk perl-URPM >= 0.90-4mdk
BuildRequires: bzip2-devel gettext rpm-devel >= 4.0.3 perl-MDK-Common-devel
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
@@ -202,6 +202,11 @@ $urpm->update_media;
%changelog
+- added patch from Michaël Scherer to add --no-uninstall
+ (or --no-remove) and assume no by default when asking to
+ remove packages.
+- updated urpmq with newer perl-URPM 0.90-4mdk and better.
+
* Mon May 26 2003 François Pons <fpons@mandrakesoft.com> 4.3-12mdk
- updated for newer perl-URPM 0.90 series.
- give reason of package requested not being installed.
diff --git a/urpmq b/urpmq
index 217577a2..7eb30817 100755
--- a/urpmq
+++ b/urpmq
@@ -347,7 +347,7 @@ if ($query->{list_aliases}) {
foreach (split /\|/, $_) {
my $pkg = $urpm->{depslist}[$_] or next;
my $file = $local_sources->{$_} || $downloads{$_} || "$urpm->{cachedir}/headers/".$pkg->header_filename;
- $pkg->update_header($file, 0, 1);
+ $pkg->update_header($file, keep_all_tags => 1);
printf "%-12s: %s\n", "Name", $pkg->name;
printf "%-12s: %s\n", "Version", $pkg->version;
printf "%-12s: %s\n", "Release", $pkg->release;