summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-10-30 18:07:13 +0000
committerFrancois Pons <fpons@mandriva.com>2003-10-30 18:07:13 +0000
commite551862c2a0cf970468c59ae9e8245782610dc6d (patch)
tree36f323608542ede163e0f0d28727bcd3a88baf32
parent3ad1dfc47828358dc6a4036b1cda4949e03a821c (diff)
downloadurpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar
urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar.gz
urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar.bz2
urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar.xz
urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.zip
4.4-41mdk (erwan feature)
-rw-r--r--man/C/urpmi.814
-rw-r--r--man/fr/urpmi.814
-rw-r--r--urpm.pm23
-rwxr-xr-xurpmi35
-rw-r--r--urpmi.spec8
5 files changed, 80 insertions, 14 deletions
diff --git a/man/C/urpmi.8 b/man/C/urpmi.8
index a395f131..d81f9e48 100644
--- a/man/C/urpmi.8
+++ b/man/C/urpmi.8
@@ -247,6 +247,20 @@ When a package is removed, it may not be replaced with an older version.
Pascal Rigaux, Mandrakesoft <pixel@mandrakesoft.com> (original author)
.PP
Francois Pons, Mandrakesoft <fpons@mandrakesoft.com> (current author)
+.SH CONTRIBUTORS
+Please mail to authors if you are not belonging to this alphabetically sorted
+list after having contributed.
+.PP
+Andrej Borsenkow,
+Guillaume Cottenceau,
+Philippe Libat,
+Bryan Paxton,
+Guillaume Rousse,
+Michael Scherer,
+Alexander Skwar,
+Olivier Thauvin,
+Erwan Velu,
+Florent Villard.
.SH SEE ALSO
\fIurpmi.addmedia\fP(8),
\fIurpmi.update\fP(8),
diff --git a/man/fr/urpmi.8 b/man/fr/urpmi.8
index 58b4bc37..1afd61b3 100644
--- a/man/fr/urpmi.8
+++ b/man/fr/urpmi.8
@@ -250,6 +250,20 @@ version correspondante.
Pascal Rigaux, Mandrakesoft <pixel@mandrakesoft.com> (auteur originel)
.PP
Francois Pons, Mandrakesoft <fpons@mandrakesoft.com> (auteur actuel)
+.SH CONTRIBUTEURS
+Envoyez un mail aux auteurs si vous n'êtes pas dans cette liste triée
+alphabetiquement lorsque vous avez contribué à urpmi.
+.PP
+Andrej Borsenkow,
+Guillaume Cottenceau,
+Philippe Libat,
+Bryan Paxton,
+Guillaume Rousse,
+Michael Scherer,
+Alexander Skwar,
+Olivier Thauvin,
+Erwan Velu,
+Florent Villard.
.SH "VOIR AUSSI"
\fIurpmi.addmedia\fP(8),
\fIurpmi.update\fP(8),
diff --git a/urpm.pm b/urpm.pm
index 77e17c0c..eb5604d3 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -452,7 +452,7 @@ sub read_config {
$no and $urpm->{options}{$k} = ! $urpm->{options}{$k} || 0;
}
next;
- } elsif (($k, $v) = /^(limit-rate|excludepath|key[\-_]ids|split-(?:level|length))\s*:\s*(.*)$/) {
+ } elsif (($k, $v) = /^(limit-rate|excludepath|key[\-_]ids|split-(?:level|length)|priority-upgrade)\s*:\s*(.*)$/) {
unless (exists($urpm->{options}{$k})) {
$v =~ /^'([^']*)'$/ and $v = $1; $v =~ /^"([^"]*)"$/ and $v = $1;
$urpm->{options}{$k} = $v;
@@ -700,7 +700,7 @@ sub write_config {
}
foreach my $medium (@{$urpm->{media}}) {
printf F "%s %s {\n", quotespace($medium->{name}), quotespace($medium->{clear_url});
- foreach (qw(hdlist with_hdlist list removable key-ids)) {
+ foreach (qw(hdlist with_hdlist list removable key-ids priority-upgrade)) {
$medium->{$_} and printf F " %s: %s\n", $_, $medium->{$_};
}
$medium->{md5sum} and print MD5SUM "$medium->{md5sum} ".($medium->{synthesis} && "synthesis.").$medium->{hdlist}."\n";
@@ -2422,6 +2422,25 @@ sub resolve_dependencies {
$options{auto_select} and $urpm->request_packages_to_upgrade($db, $state, $requested, requested => undef);
$urpm->resolve_requested($db, $state, $requested, %options);
+
+ if ($options{priority_upgrade} && !$options{rpmdb}) {
+ my (%priority_upgrade, %priority_requested);
+ @priority_upgrade{split ',', $options{priority_upgrade}} = ();
+
+ #- try to find if a priority upgrade should be tried, this is erwan feature he waited for months :)
+ #- this can be also considered as a special gift...
+ foreach (keys %{$state->{selected}}) {
+ my $pkg = $urpm->{depslist}[$_] or next;
+ exists $priority_upgrade{$pkg->name} or next;
+ $priority_requested{$pkg->id} = undef;
+ }
+
+ if (%priority_requested) {
+ #- clean state as we found priority packages, no --auto-select should be done though here...
+ %$state = ();
+ $urpm->resolve_requested($db, $state, \%priority_requested, %options);
+ }
+ }
}
}
diff --git a/urpmi b/urpmi
index 4a672bfe..66ddd50c 100755
--- a/urpmi
+++ b/urpmi
@@ -144,7 +144,8 @@ sub gmessage {
my @nextargv;
my $command_line = join " ", @ARGV;
@ARGV or usage;
-while (defined($_ = shift @ARGV)) {
+my @argv = @ARGV;
+while (defined($_ = shift @argv)) {
/^--help$/ and do { usage; next };
/^--no-locales$/ and do { undef *N; undef *urpm::N; *N = *urpm::N = sub { sprintf(shift @_, @_) }; next };
/^--update$/ and do { $update = 1; next };
@@ -178,14 +179,14 @@ while (defined($_ = shift @ARGV)) {
/^--curl$/ and do { $sync = \&urpm::sync_webfetch; next };
/^--limit-rate$/ and do { push @nextargv, \$urpm->{options}{'limit-rate'}; next };
/^--proxy$/ and do {
- my ($proxy, $port) = ($_ = shift @ARGV) =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, or
+ my ($proxy, $port) = ($_ = shift @argv) =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, or
die N("bad proxy declaration on command line\n");
$proxy .= ":1080" unless $port;
$urpm->{proxy}{http_proxy} = "http://$proxy";
next;
};
/^--proxy-user$/ and do {
- ($_ = shift @ARGV) =~ /(.+):(.+)/, or
+ ($_ = shift @argv) =~ /(.+):(.+)/, or
die N("bad proxy declaration on command line\n");
@{$urpm->{proxy}}{qw(user proxy)} = ($1, $2);
next;
@@ -339,6 +340,7 @@ foreach (qw(post-clean verify-rpm)) {
}
exists $urpm->{options}{'split-level'} or $urpm->{options}{'split-level'} = $split_level;
exists $urpm->{options}{'split-length'} or $urpm->{options}{'split-length'} = $split_length;
+exists $urpm->{options}{'priority-ugrade'} or $urpm->{options}{'priority-upgrade'} = 'rpm,perl-URPM,urpmi';
my $state = {};
my %requested = $urpm->register_rpms(@files, @src_files);
@@ -412,14 +414,17 @@ sub ask_choice {
#- do the resolution of dependencies between requested package (and auto selection if any).
#- handle parallel option if any.
-$urpm->resolve_dependencies($state, \%requested,
- rpmdb => $env && "$env/rpmdb.cz",
- auto_select => $auto_select,
- callback_choices => \&ask_choice,
- install_src => $install_src,
- keep => $keep,
- nodeps => $urpm->{options}{'allow-nodeps'} || $urpm->{options}{'allow-force'},
- );
+#- return value is true if program should be restarted (in order to take care of important
+#- packages being upgraded (problably urpmi and perl-URPM, but maybe rpm too, and glibc also ?).
+my $restart_itself = $urpm->resolve_dependencies($state, \%requested,
+ rpmdb => $env && "$env/rpmdb.cz",
+ auto_select => $auto_select,
+ callback_choices => \&ask_choice,
+ install_src => $install_src,
+ keep => $keep,
+ nodeps => $urpm->{options}{'allow-nodeps'} || $urpm->{options}{'allow-force'},
+ priority_upgrade => !$env && $urpm->{options}{'priority-upgrade'},
+ );
my @ask_unselect = $urpm->unselected_packages($state);
if (@ask_unselect) {
@@ -773,6 +778,14 @@ unless ($env) {
$urpm->try_umounting_removables;
}
+#- restart urpmi if needed, keep command line for that.
+if ($restart_itself && !$exit_code) {
+ message(N("restarting urpmi"), 'noX');
+ #- it seems to work correctly with exec instead of system, provided
+ #- STDOUT or STDERR are not closed before (else no output at all).
+ exec "/usr/sbin/urpmi", @ARGV;
+}
+
#- this help flushing correctly by closing this file before (piped on tee).
#- but killing them is generally better.
if ($pid_err && $pid_out) {
diff --git a/urpmi.spec b/urpmi.spec
index 680ca98f..a8b1feed 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 4.4
-Release: 40mdk
+Release: 41mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -202,6 +202,12 @@ $urpm->update_media(nolock => 1, nopubkey => 1);
%changelog
+* Thu Oct 30 2003 François Pons <fpons@mandrakesoft.com> 4.4-41mdk
+- added the Erwan feature (update rpm, perl-URPM or urpmi first and
+ restart urpmi in such case).
+- added contributors section in man page (please accept I may have
+ forget you, so ask to authors in such case).
+
* Tue Oct 21 2003 François Pons <fpons@mandrakesoft.com> 4.4-40mdk
- fixed invalid signature checking when using --media on first
package listed.