diff options
author | Francois Pons <fpons@mandriva.com> | 2003-10-30 18:07:13 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-10-30 18:07:13 +0000 |
commit | e551862c2a0cf970468c59ae9e8245782610dc6d (patch) | |
tree | 36f323608542ede163e0f0d28727bcd3a88baf32 /urpm.pm | |
parent | 3ad1dfc47828358dc6a4036b1cda4949e03a821c (diff) | |
download | urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar.gz urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar.bz2 urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.tar.xz urpmi-e551862c2a0cf970468c59ae9e8245782610dc6d.zip |
4.4-41mdk (erwan feature)
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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); + } + } } } |