diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | urpm/select.pm | 8 | ||||
-rwxr-xr-x | urpmi | 10 |
3 files changed, 16 insertions, 4 deletions
@@ -1,3 +1,5 @@ +- warn if --allow-force, --allow-nodeps, --force or --keep is in use (mga#3127) + Version 6.45 - 27 February 2012 - urpmi: diff --git a/urpm/select.pm b/urpm/select.pm index e90602a5..02cadbde 100644 --- a/urpm/select.pm +++ b/urpm/select.pm @@ -674,12 +674,12 @@ sub should_we_migrate_back_rpmdb_db_version { my ($pkg) = urpm::select::selected_packages_providing($urpm, $state, 'rpm') or return; urpm::select::was_pkg_name_installed($state->{rejected}, 'rpm') and return; - my ($rooted_librpm_version) = map { _libdb_version($_) } $pkg->requires; - my $rooted_rpm_version = eval "v" . $pkg->version; + my ($rooted_librpm_version) = map { _libdb_version($_) } $pkg->requires; # perl_checker: $self = revision + my $rooted_rpm_version = eval "v" . $pkg->version; # perl_checker: $self = revision - my $urpmi_librpm_version = _libdb_version(scalar `ldd /bin/rpm`); + my $urpmi_librpm_version = _libdb_version(scalar `ldd /bin/rpm`); # perl_checker: $self = revision - if (_rpm_version() ge v4.9.0) { + if (_rpm_version() ge v4.9.0) { # perl_checker: $self = revision if ($rooted_rpm_version && $rooted_rpm_version ge v4.9) { $urpm->{debug} and $urpm->{debug}("chrooted db version used by librpm is at least as good as non-rooted one"); } else { @@ -595,6 +595,16 @@ foreach my $pkg (@to_install) { } $urpm->{nb_install} = @to_install; +sub warn_msg { + my ($msg) = @_; + $urpm->{print}(N("WARNING: %s option is in use. Some strange problems may happen", $msg)); +} + +warn_msg("--allow-force") if $urpm->{options}{'allow-force'}; +warn_msg("--allow-nodeps") if $urpm->{options}{'allow-nodeps'}; +warn_msg("--force") if $urpm->{options}{force}; +warn_msg("--keep") if $urpm->{options}{keep}; + if (!$urpm->{options}{auto} && $ask_user && $urpm->{nb_install} || $env && !$options{debug__do_not_install}) { my $msg = $urpm->{nb_install} == 1 ? N("To satisfy dependencies, the following package is going to be installed:") : N("To satisfy dependencies, the following packages are going to be installed:"); |