summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-26 15:26:42 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-26 15:26:42 +0000
commitf20a672e01e0caf0fd203ac14f83b09f5a4ce701 (patch)
tree588ed80b3d80ed980c9b78e7eb5e631464947de8
parenta4e5ea60f1de8d46935aeb17cba691a6d572fdf6 (diff)
downloadurpmi-f20a672e01e0caf0fd203ac14f83b09f5a4ce701.tar
urpmi-f20a672e01e0caf0fd203ac14f83b09f5a4ce701.tar.gz
urpmi-f20a672e01e0caf0fd203ac14f83b09f5a4ce701.tar.bz2
urpmi-f20a672e01e0caf0fd203ac14f83b09f5a4ce701.tar.xz
urpmi-f20a672e01e0caf0fd203ac14f83b09f5a4ce701.zip
4.4-8mdk
-rw-r--r--urpm.pm19
-rw-r--r--urpm/parallel_ka_run.pm8
-rw-r--r--urpm/parallel_ssh.pm8
-rwxr-xr-xurpmi11
-rw-r--r--urpmi.spec15
-rwxr-xr-xurpmq11
6 files changed, 43 insertions, 29 deletions
diff --git a/urpm.pm b/urpm.pm
index 0e42ac58..5693a48c 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1088,13 +1088,7 @@ sub update_media {
#- now we need additional methods not defined by default in URPM.
require URPM::Build;
- #- avoid putting a require on Fcntl ':flock' (which is perl and not perl-base).
- my ($LOCK_EX, $LOCK_NB, $LOCK_UN) = (2, 4, 8);
-
- #- lock urpmi database.
- local (*LOCK_FILE);
- open LOCK_FILE, $urpm->{statedir};
- flock LOCK_FILE, $LOCK_EX|$LOCK_NB or $urpm->{fatal}(7, N("urpmi database locked"));
+ $options{nolock} or $urpm->exlock_urpmi_db;
#- examine each medium to see if one of them need to be updated.
#- if this is the case and if not forced, try to use a pre-calculated
@@ -1886,12 +1880,7 @@ sub update_media {
$urpm->write_config();
}
- #- now everything is finished.
- system("sync");
-
- #- release lock on database.
- flock LOCK_FILE, $LOCK_UN;
- close LOCK_FILE;
+ $options{nolock} or $urpm->unlock_urpmi_db;
}
#- clean params and depslist computation zone.
@@ -2476,11 +2465,11 @@ sub exlock_urpmi_db {
my ($urpm) = @_;
#- avoid putting a require on Fcntl ':flock' (which is perl and not perl-base).
- my $LOCK_EX = 2;
+ my ($LOCK_EX, $LOCK_NB) = (2, 4);
#- lock urpmi database, but keep lock to wait for an urpmi.update to finish.
open LOCK_FILE, $urpm->{statedir};
- flock LOCK_FILE, $LOCK_EX or $urpm->{fatal}(7, N("urpmi database locked"));
+ flock LOCK_FILE, $LOCK_EX|$LOCK_NB or $urpm->{fatal}(7, N("urpmi database locked"));
}
sub unlock_urpmi_db {
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index 68e5c80b..84dd9840 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -139,9 +139,11 @@ sub parallel_resolve_dependencies {
while (defined ($_ = <F>)) {
chomp;
s/<([^>]*)>.*:->:(.*)/$2/ and $node = $1;
- if (/^\@removing\@(.*)/) {
- $state->{rejected}{$1}{removed} = 1;
- $state->{rejected}{$1}{nodes}{$node} = undef;
+ if (my ($action, $what) = /^\@([^\@]*)\@(.*)/) {
+ if ($action eq 'removing') {
+ $state->{rejected}{$what}{removed} = 1;
+ $state->{rejected}{$what}{nodes}{$node} = undef;
+ }
} elsif (/\|/) {
#- distant urpmq returned a choices, check if it has already been chosen
#- or continue iteration to make sure no more choices are left.
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index a0831c14..636bd128 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -143,9 +143,11 @@ sub parallel_resolve_dependencies {
open F, "ssh $node urpmq --synthesis $synthesis -fduc $line ".join(' ', keys %chosen)." |";
while (defined ($_ = <F>)) {
chomp;
- if (/^\@removing\@(.*)/) {
- $state->{rejected}{$1}{removed} = 1;
- $state->{rejected}{$1}{nodes}{$node} = undef;
+ if (my ($action, $what) = /^\@([^\@]*)\@(.*)/) {
+ if ($action eq 'removing') {
+ $state->{rejected}{$what}{removed} = 1;
+ $state->{rejected}{$what}{nodes}{$node} = undef;
+ }
} elsif (/\|/) {
#- distant urpmq returned a choices, check if it has already been chosen
#- or continue iteration to make sure no more choices are left.
diff --git a/urpmi b/urpmi
index 418100d6..f25947e7 100755
--- a/urpmi
+++ b/urpmi
@@ -416,7 +416,7 @@ if (@ask_unselect) {
}
}
-my @ask_remove = $urpm->removed_packages($state);
+my @ask_remove = $urpm->{options}{'allow-force'} ? @{[]} : $urpm->removed_packages($state);
if (@ask_remove) {
my $list = join "\n", $urpm->translate_why_removed($state, sort @ask_remove);
@@ -686,7 +686,8 @@ foreach my $set (@{$state->{transaction} || []}) {
gurpm::progress($amount/$total);
}
};
- my @l = $urpm->install($set->{remove} || [], \%transaction_sources_install, \%transaction_sources,
+ my @l = $urpm->install(!$urpm->{options}{'allow-force'} && $set->{remove} || [],
+ \%transaction_sources_install, \%transaction_sources,
translate_message => 1,
oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
test => $test,
@@ -702,7 +703,8 @@ foreach my $set (@{$state->{transaction} || []}) {
message_input(N("Try installation without checking dependencies? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
or ++$nok, next;
$urpm->{log}("starting installing packages without deps");
- @l = $urpm->install($set->{remove} || [], \%transaction_sources_install, \%transaction_sources,
+ @l = $urpm->install(!$urpm->{options}{'allow-force'} && $set->{remove} || [],
+ \%transaction_sources_install, \%transaction_sources,
translate_message => 1, nodeps => 1,
oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
test => $test,
@@ -713,7 +715,8 @@ foreach my $set (@{$state->{transaction} || []}) {
message_input(N("Try installation even more strongly (--force)? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
or ++$nok, next;
$urpm->{log}("starting force installing packages without deps");
- @l = $urpm->install($set->{remove} || [], \%transaction_sources_install, \%transaction_sources,
+ @l = $urpm->install(!$urpm->{options}{'allow-force'} && $set->{remove} || [],
+ \%transaction_sources_install, \%transaction_sources,
translate_message => 1, nodeps => 1, force => 1,
oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
test => $test,
diff --git a/urpmi.spec b/urpmi.spec
index 91cf903c..0a96b4b4 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,14 +2,14 @@
Name: urpmi
Version: 4.4
-Release: 7mdk
+Release: 8mdk
License: GPL
Source0: %{name}.tar.bz2
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.91-6mdk
+PreReq: perl-Locale-gettext >= 1.01-7mdk rpmtools >= 4.3-6mdk perl-URPM >= 0.91-7mdk
BuildRequires: bzip2-devel gettext rpm-devel >= 4.0.3 perl-MDK-Common-devel
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
@@ -130,7 +130,7 @@ exit 0
use urpm;
$urpm = new urpm;
$urpm->read_config;
-$urpm->update_media;
+$urpm->update_media(nolock => 1);
#%preun -n autoirpm
#[ -x %{_sbindir}/autoirpm.uninstall ] && %{_sbindir}/autoirpm.uninstall
@@ -202,6 +202,15 @@ $urpm->update_media;
%changelog
+* Thu Jun 26 2003 François Pons <fpons@mandrakesoft.com> 4.4-8mdk
+- fixed urpmq -d not working if package given has unsatisfied
+ dependencies as backtrack is active, now -d use nodeps.
+- added @unsatisfied@ info with -c of urpmq.
+- fixed lock database error when upgrading urpmi.
+- added hack to avoid exiting installation with --no-remove
+ if --allow-force is given, avoid removing packages in such
+ cases.
+
* Thu Jun 26 2003 François Pons <fpons@mandrakesoft.com> 4.4-7mdk
- fixed building of hdlist.
diff --git a/urpmq b/urpmq
index a6236c44..455ffdc2 100755
--- a/urpmq
+++ b/urpmq
@@ -306,7 +306,7 @@ if ($query->{list_aliases}) {
#- only deps required.
my $empty_db = new URPM; #- URPM has same methods as URPM::DB and empty URPM will be seen as empty URPM::DB.
require URPM::Resolve;
- $urpm->resolve_requested($empty_db, $state, \%requested, callback_choices => $stop_on_choices);
+ $urpm->resolve_requested($empty_db, $state, \%requested, callback_choices => $stop_on_choices, nodeps => 1);
} else {
$state->{selected} = \%requested;
}
@@ -410,6 +410,15 @@ if ($query->{complete}) {
keys %{$state->{rejected} || {}}) {
print '@removing@' . $removal . "\n";
}
+ foreach my $selected (values %{$state->{selected} || {}}) {
+ if (ref($selected) eq 'HASH' && ref($selected->{unsatisfied}) eq 'ARRAY') {
+ foreach (@{$selected->{unsatisfied}}) {
+ exists $hack_only_one{$_} and next;
+ print '@unsatisfied@' . $_ . "\n";
+ $hack_only_one{$_} = undef;
+ }
+ }
+ }
}
foreach my $id ($state->{selected} ? keys %{$state->{selected}} : keys %requested) {
my $class = $state->{selected}{$id} || $requested{$id};