summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-04-14 13:07:46 +0000
committerFrancois Pons <fpons@mandriva.com>2003-04-14 13:07:46 +0000
commitcfd503abe837a572de86b3773b1d95fb3b8d4ca6 (patch)
tree32d5fc4c160925d5a6a45ee5e2874160d605df08
parent67d197d1edf2cfecec03ca82dce8e88346de503d (diff)
downloadurpmi-cfd503abe837a572de86b3773b1d95fb3b8d4ca6.tar
urpmi-cfd503abe837a572de86b3773b1d95fb3b8d4ca6.tar.gz
urpmi-cfd503abe837a572de86b3773b1d95fb3b8d4ca6.tar.bz2
urpmi-cfd503abe837a572de86b3773b1d95fb3b8d4ca6.tar.xz
urpmi-cfd503abe837a572de86b3773b1d95fb3b8d4ca6.zip
4.3-1mdk
-rw-r--r--urpm.pm177
-rwxr-xr-xurpmi26
-rwxr-xr-xurpmi.addmedia17
-rw-r--r--urpmi.spec14
-rwxr-xr-xurpmq9
5 files changed, 139 insertions, 104 deletions
diff --git a/urpm.pm b/urpm.pm
index 79695dfb..e4553553 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -3,11 +3,12 @@ package urpm;
use strict;
use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '4.2';
+$VERSION = '4.3';
@ISA = qw(Exporter URPM);
@EXPORT = qw(*N);
use URPM;
+use URPM::Resolve;
use POSIX;
use Locale::gettext();
@@ -417,7 +418,7 @@ sub read_config {
$_ eq '}' and last;
#- check for boolean variables first, and after that valued variables.
my ($no, $k, $v);
- if (($no, $k, $v) = /^(no-)?(verify-rpm|fuzzy|allow-(?:force|nodeps)|(?:pre|post)-clean)(?:\s*:\s*(.*))?$/) {
+ if (($no, $k, $v) = /^(no-)?(verify-rpm|fuzzy|allow-(?:force|nodeps)|(?:pre|post)-clean|excludedocs)(?:\s*:\s*(.*))?$/) {
unless (exists($urpm->{options}{$k})) {
$urpm->{options}{$k} = $v eq '' || $v =~ /^(yes|on|1)$/i || 0;
$no and $urpm->{options}{$k} = ! $urpm->{options}{$k} || 0;
@@ -709,8 +710,8 @@ sub configure {
if ($options{synthesis}) {
if ($options{synthesis} ne 'none') {
#- synthesis take precedence over media, update options.
- $options{media} || $options{update} || $options{parallel} and
- $urpm->{fatal}(1, N("--synthesis cannot be used with --media, --update or --parallel"));
+ $options{media} || $options{excludemedia} || $options{update} || $options{parallel} and
+ $urpm->{fatal}(1, N("--synthesis cannot be used with --media, --excludemedia, --update or --parallel"));
$urpm->parse_synthesis($options{synthesis});
}
} else {
@@ -722,6 +723,13 @@ sub configure {
$_->{ignore} = 1;
}
}
+ if ($options{excludemedia}) {
+ $urpm->select_media(split ',', $options{excludemedia});
+ foreach (grep { $_->{modified} } @{$urpm->{media} || []}) {
+ #- this is only a local ignore that will not be saved.
+ $_->{ignore} = 1;
+ }
+ }
foreach (grep { !$_->{ignore} && (!$options{update} || $_->{update}) } @{$urpm->{media} || []}) {
delete @{$_}{qw(start end)};
if ($options{callback}) {
@@ -759,6 +767,11 @@ sub configure {
}
}
}
+ #- determine package to withdraw (from skip.list file).
+ $urpm->compute_skip_flags($urpm->get_unwanted_packages($options{skip}), callback => sub {
+ my ($urpm, $pkg) = @_;
+ $urpm->{log}(N("skipping package %s", scalar($pkg->fullname)));
+ });
if ($options{bug}) {
#- and a dump of rpmdb itself as synthesis file.
my $db = URPM::DB::open($options{root});
@@ -968,15 +981,40 @@ sub remove_selected_media {
$urpm->{media} = \@result;
}
+#- return list of synthesis or hdlist reference to probe.
+sub probe_with_try_list {
+ my ($suffix, $probe_with) = @_;
+
+ my @probe = ("synthesis.hdlist.cz", "synthesis.hdlist$suffix.cz",
+ "../synthesis.hdlist$suffix.cz", "../base/synthesis.hdlist$suffix.cz");
+
+ defined $suffix && !$suffix and push @probe, ("synthesis.hdlist1.cz", "synthesis.hdlist2.cz",
+ "../synthesis.hdlist1.cz", "../synthesis.hdlist2.cz",
+ "../base/synthesis.hdlist1.cz", "../base/synthesis.hdlist2.cz");
+
+ my @probe_hdlist = ("hdlist.cz", "hdlist$suffix.cz", "../hdlist$suffix.cz", "../base/hdlist$suffix.cz");
+ defined $suffix && !$suffix and push @probe_hdlist, ("hdlist1.cz", "hdlist2.cz",
+ "../hdlist1.cz", "../hdlist2.cz",
+ "../base/hdlist1.cz", "../base/hdlist2.cz");
+
+ if ($probe_with =~ /synthesis/) {
+ push @probe, @probe_hdlist;
+ } else {
+ unshift @probe, @probe_hdlist;
+ }
+
+ @probe;
+}
+
#- update urpmi database regarding the current configuration.
#- take care of modification and try some trick to bypass
#- computational of base files.
#- allow options :
-#- all -> all medium are rebuilded.
-#- force -> try to force rebuilding base files (1) or hdlist from rpm files (2).
-#- probe_with_hdlist -> probe synthesis or hdlist.
-#- ratio -> use compression ratio (with gzip, default is 4)
-#- noclean -> keep header directory cleaned.
+#- all -> all medium are rebuilded.
+#- force -> try to force rebuilding base files (1) or hdlist from rpm files (2).
+#- probe_with -> probe synthesis or hdlist.
+#- ratio -> use compression ratio (with gzip, default is 4)
+#- noclean -> keep header directory cleaned.
sub update_media {
my ($urpm, %options) = @_; #- do not trust existing hdlist and try to recompute them.
my ($cleaned_cache);
@@ -1046,30 +1084,19 @@ sub update_media {
#- the directory given does not exist and may be accessible
#- by mounting some other. try to figure out these directory and
#- mount everything necessary.
- $urpm->try_mounting($options{force} < 2 && ($options{probe_with_hdlist} || $medium->{with_hdlist}) ?
+ $urpm->try_mounting($options{force} < 2 && ($options{probe_with} || $medium->{with_hdlist}) ?
$with_hdlist_dir : $dir) or
$urpm->{error}(N("unable to access medium \"%s\"", $medium->{name})), next;
#- try to probe for possible with_hdlist parameter, unless
#- it is already defined (and valid).
- if ($options{probe_with_hdlist} && (!$medium->{with_hdlist} || ! -e "$dir/$medium->{with_hdlist}")) {
+ if ($options{probe_with} && (!$medium->{with_hdlist} || ! -e "$dir/$medium->{with_hdlist}")) {
my ($suffix) = $dir =~ /RPMS([^\/]*)\/*$/;
- if (-s "$dir/synthesis.hdlist.cz" > 32) {
- $medium->{with_hdlist} = "./synthesis.hdlist.cz";
- } elsif (-s "$dir/synthesis.hdlist$suffix.cz" > 32) {
- $medium->{with_hdlist} = "./synthesis.hdlist$suffix.cz";
- } elsif (defined $suffix && !$suffix && -s "$dir/synthesis.hdlist1.cz" > 32) {
- $medium->{with_hdlist} = "./synthesis.hdlist1.cz";
- } elsif (defined $suffix && !$suffix && -s "$dir/synthesis.hdlist2.cz" > 32) {
- $medium->{with_hdlist} = "./synthesis.hdlist2.cz";
- } elsif (-s "$dir/../synthesis.hdlist$suffix.cz" > 32) {
- $medium->{with_hdlist} = "../synthesis.hdlist$suffix.cz";
- } elsif (defined $suffix && !$suffix && -s "$dir/../synthesis.hdlist1.cz" > 32) {
- $medium->{with_hdlist} = "../synthesis.hdlist1.cz";
- } elsif (-s "$dir/../base/hdlist$suffix.cz" > 32) {
- $medium->{with_hdlist} = "../base/hdlist$suffix.cz";
- } elsif (defined $suffix && !$suffix && -s "$dir/../base/hdlist1.cz" > 32) {
- $medium->{with_hdlist} = "../base/hdlist1.cz";
+
+ foreach (probe_with_try_list($suffix, $options{probe_with})) {
+ if (-s "$dir/$_" > 32) {
+ $medium->{with_hdlist} = $_;
+ }
}
#- redo...
$with_hdlist_dir = reduce_pathname($dir . ($medium->{with_hdlist} ? "/$medium->{with_hdlist}" : "/.."));
@@ -1217,15 +1244,10 @@ sub update_media {
#- it is already defined (and valid).
$urpm->{log}(N("retrieving source hdlist (or synthesis) of \"%s\"...", $medium->{name}));
$options{callback} && $options{callback}('retrieve', $medium->{name});
- if ($options{probe_with_hdlist}) {
+ if ($options{probe_with}) {
my ($suffix) = $dir =~ /RPMS([^\/]*)\/*$/;
- foreach ($medium->{with_hdlist} || (),
- "synthesis.hdlist.cz", "synthesis.hdlist$suffix.cz",
- !$suffix ? ("synthesis.hdlist1.cz", "synthesis.hdlist2.cz") : @{[]},
- "../synthesis.hdlist$suffix.cz", !$suffix ? "../synthesis.hdlist1.cz" : @{[]},
- "../base/hdlist$suffix.cz", !$suffix ? "../base/hdlist1.cz" : @{[]},
- ) {
+ foreach ($medium->{with_hdlist} || (), probe_with_try_list($suffix, $options{probe_with})) {
$basename = /^.*\/([^\/]*)$/ && $1 || $_ or next;
unlink "$urpm->{cachedir}/partial/$basename";
@@ -1866,6 +1888,10 @@ sub search_packages {
foreach (@$names) {
if (defined $exact{$_}) {
$packages->{$exact{$_}} = 1;
+ foreach (split '\|', $exact{$_}) {
+ my $pkg = $urpm->{depslist}[$_] or next;
+ $pkg->set_flag_skip(0); #- reset skip flag as manually selected.
+ }
} else {
#- at this level, we need to search the best package given for a given name,
#- always prefer already found package.
@@ -1891,6 +1917,7 @@ sub search_packages {
}
}
$packages->{$best->id} = 1;
+ $best->set_flag_skip(0); #- reset skip flag as manually selected.
}
}
}
@@ -1904,9 +1931,6 @@ sub search_packages {
sub resolve_dependencies {
my ($urpm, $state, $requested, %options) = @_;
- #- needed for both parallel mode or simple mode.
- require URPM::Resolve;
-
if ($options{install_src}) {
#- only src will be installed, so only update $state->{selected} according
#- to src status of files.
@@ -1948,10 +1972,10 @@ sub resolve_dependencies {
}
}
-#- get out of package that should not be upgraded.
-sub deselect_unwanted_packages {
- my ($urpm, $packages, %options) = @_;
- my (%skip, %remove);
+#- get list of package that should not be upgraded.
+sub get_unwanted_packages {
+ my ($urpm, $skip) = @_;
+ my %skip;
local ($_, *F);
open F, $urpm->{skiplist};
@@ -1963,28 +1987,14 @@ sub deselect_unwanted_packages {
}
close F;
- %skip or return;
- foreach (grep { $options{force} || exists($packages->{$_}) && ! defined $packages->{$_} } keys %$packages) {
- my $pkg = $urpm->{depslist}[$_] or next;
- my $remove_it;
-
- #- check if fullname is matching a regexp.
- if (grep { exists($skip{$_}{''}) && /^\/(.*)\/$/ && $pkg->fullname =~ /$1/ } keys %skip) {
- delete $packages->{$pkg->id};
- } else {
- #- check if a provides match at least one package.
- foreach ($pkg->provides) {
- if (my ($n, $s) = /^([^\s\[]*)(?:\[\*\])?\[?([^\s\]]*\s*[^\s\]]*)/) {
- foreach my $sn ($n, grep { /^\/(.*)\/$/ && $n =~ /$1/ } keys %skip) {
- foreach (keys %{$skip{$sn} || {}}) {
- URPM::ranges_overlap($_, $s) and delete $packages->{$pkg->id};
- }
- }
- }
- }
+ #- additional skipping from given parameter.
+ foreach (split ',', $skip) {
+ if (my ($n, $s) = /^([^\s\[]+)(?:\[\*\])?\[?\s*([^\s\]]*\s*[^\s\]]*)/) {
+ $skip{$n}{$s} = undef;
}
}
- 1;
+
+ \%skip;
}
#- select source for package selected.
@@ -1994,7 +2004,7 @@ sub deselect_unwanted_packages {
#- have a null list.
sub get_source_packages {
my ($urpm, $packages, %options) = @_;
- my ($id, $error, %local_sources, @list, %fullname2id, %file2fullnames, %examined);
+ my ($id, $error, %local_sources, @list, %fullname2id, %usefull_files, %file2fullnames, %examined);
local (*D, *F, $_);
#- build association hash to retrieve id and examine all list files.
@@ -2005,33 +2015,37 @@ sub get_source_packages {
} else {
$fullname2id{$p->fullname} = $_.'';
}
+ #- keep track of related files to avoid scanning all the cache (very long when cache is big).
+ $usefull_files{$p->filename} = undef;
}
#- examine each medium to search for packages.
#- now get rpm file name in hdlist to match list file.
foreach my $pkg (@{$urpm->{depslist} || []}) {
- $file2fullnames{$pkg->filename =~ /(.*)\.rpm$/ && $1 || $pkg->fullname}{$pkg->fullname} = undef;
+ $file2fullnames{$pkg->filename}{$pkg->fullname} = undef;
}
#- examine the local repository, which is trusted (no gpg or pgp signature check but md5 is now done).
opendir D, "$urpm->{cachedir}/rpms";
while (defined($_ = readdir D)) {
- if (my ($filename) = /^([^\/]*)\.rpm$/) {
- my $filepath = "$urpm->{cachedir}/rpms/$filename.rpm";
- if (!$options{clean_all} && -s $filepath && URPM::verify_rpm($filepath, nogpg => 1, nopgp => 1) =~ /md5 OK/) {
- if (keys(%{$file2fullnames{$filename} || {}}) > 1) {
- $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\""), $filename);
- next;
- } elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
- my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
- if (defined($id = delete $fullname2id{$fullname})) {
- $local_sources{$id} = $filepath;
+ if (my ($filename) = /^([^\/]*\.rpm)$/) {
+ my $filepath = "$urpm->{cachedir}/rpms/$filename";
+ if (!$options{clean_all} && -s $filepath) {
+ if (exists $usefull_files{$filename} && URPM::verify_rpm($filepath, nogpg => 1, nopgp => 1) =~ /md5 OK/) {
+ if (keys(%{$file2fullnames{$filename} || {}}) > 1) {
+ $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\""), $filename);
+ next;
+ } elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
+ my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
+ if (defined($id = delete $fullname2id{$fullname})) {
+ $local_sources{$id} = $filepath;
+ } else {
+ $options{clean_other} and unlink $filepath;
+ }
} else {
$options{clean_other} and unlink $filepath;
}
- } else {
- $options{clean_other} and unlink $filepath;
- }
+ } #- do not examine rpm file in cache that will not be used.
} else {
#- this is an invalid file in cache, remove it and ignore it.
#- or clean options has been given meaning ignore any file in cache
@@ -2050,7 +2064,7 @@ sub get_source_packages {
if ($medium->{list} && -r "$urpm->{statedir}/$medium->{list}") {
open F, "$urpm->{statedir}/$medium->{list}";
while (<F>) {
- if (my ($filename) = /\/([^\/]*)\.rpm$/) {
+ if (my ($filename) = /\/([^\/]*\.rpm)$/) {
if (keys(%{$file2fullnames{$filename} || {}}) > 1) {
$urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\""), $filename);
next;
@@ -2072,12 +2086,11 @@ sub get_source_packages {
if (defined $medium->{url}) {
foreach ($medium->{start} .. $medium->{end}) {
my $pkg = $urpm->{depslist}[$_];
- my ($filename) = $pkg->filename =~ /([^\/]*)\.rpm$/;
- if (keys(%{$file2fullnames{$filename} || {}}) > 1) {
- $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\""), $filename);
+ if (keys(%{$file2fullnames{$pkg->filename} || {}}) > 1) {
+ $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\""), $pkg->filename);
next;
- } elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
- my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
+ } elsif (keys(%{$file2fullnames{$pkg->filename} || {}}) == 1) {
+ my ($fullname) = keys(%{$file2fullnames{$pkg->filename} || {}});
unless (exists($list_examined{$fullname})) {
++$list_warning;
defined($id = $fullname2id{$fullname}) and $sources{$id} = "$medium->{url}/".$pkg->filename;
diff --git a/urpmi b/urpmi
index 24cae56f..f2a013cb 100755
--- a/urpmi
+++ b/urpmi
@@ -25,6 +25,7 @@ my $urpm = new urpm;
#- default options.
my $update = 0;
my $media = '';
+my $excludemedia = '';
my $synthesis = '';
my $auto = 0;
my $allow_medium_change = 0;
@@ -42,6 +43,7 @@ my $install_src = 0;
my $clean = 0;
my $noclean = 0;
my $verbose = 0;
+my $skip = '';
my $root = '';
my $bug = '';
my $env = '';
@@ -69,6 +71,7 @@ usage:
", $urpm::VERSION) . N(" --help - print this help message.
") . N(" --update - use only update media.
") . N(" --media - use only the given media, separated by comma.
+") . N(" --excludemedia - do not use only the given media, separated by comma.
") . 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.
@@ -132,6 +135,7 @@ while (defined($_ = shift @ARGV)) {
/^--no-locales$/ and do { undef *N; undef *urpm::N; *N = *urpm::N = sub { sprintf(shift @_, @_) }; next };
/^--update$/ and do { $update = 1; next };
/^--media$/ and do { push @nextargv, \$media; next };
+ /^--exclude-?media$/ and do { push @nextargv, \$excludemedia; next };
/^--mediums$/ and do { push @nextargv, \$media; next };
/^--synthesis$/ and do { push @nextargv, \$synthesis; next };
/^--auto$/ and do { $auto = 1; next };
@@ -177,8 +181,10 @@ while (defined($_ = shift @ARGV)) {
/^--(no-)?verify-rpm$/ and do { $urpm->{options}{'verify-rpm'} = !$1; next };
/^--(no-)?test$/ and do { $test = !$1; next };
/^--comment$/ and do { push @nextargv, undef; next };
+ /^--skip$/ and do { push @nextargv, \$skip; next };
/^--root$/ and do { push @nextargv, \$root; next };
- /^--excludepath$/ and do { $urpm->{options}{excludepath} = undef; push @nextargv, \$urpm->{options}{excludepath}; next };
+ /^--exclude-?path$/ and do { $urpm->{options}{excludepath} = undef; push @nextargv, \$urpm->{options}{excludepath}; next };
+ /^--exclude-?docs$/ and do { $urpm->{options}{excludedocs} = 1; next };
/^-(.*)$/ and do { foreach (split //, $1) {
/[\?h]/ and do { usage; next };
/a/ and do { $all = 1; next };
@@ -300,8 +306,10 @@ $verbose > 0 or $urpm->{log} = sub {};
$urpm->configure(nocheck_access => $env || $uid > 0,
media => $media,
+ excludemedia => $excludemedia,
synthesis => $synthesis,
update => $update,
+ skip => $skip,
root => $root,
bug => $bug,
parallel => $parallel,
@@ -427,9 +435,6 @@ if (%{$state->{ask_remove} || {}}) {
}
}
-#- get out of package that should not be upgraded.
-$urpm->deselect_unwanted_packages($state->{selected});
-
#- package to install as a array of strings.
my @to_install;
@@ -570,7 +575,8 @@ if (%sources_install || %sources) {
#- no remove are handle here, automatically done by each distant node.
$urpm->{log}("starting distributed install");
$urpm->parallel_install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
- test => $test, excludepath => $urpm->{options}{excludepath});
+ test => $test,
+ excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
} else {
message(N("installing %s\n", join(' ', values %sources_install, values %sources)), 'noX');
log_it(scalar localtime, " ", join(' ', values %sources_install, values %sources), "\n");
@@ -589,7 +595,8 @@ if (%sources_install || %sources) {
my @l = $urpm->install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
translate_message => 1,
oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
- test => $test, excludepath => $urpm->{options}{excludepath});
+ test => $test,
+ excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
if (@l) {
message(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
@@ -604,7 +611,8 @@ if (%sources_install || %sources) {
@l = $urpm->install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
translate_message => 1, nodeps => 1,
oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
- test => $test, excludepath => $urpm->{options}{excludepath});
+ test => $test,
+ excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
if (@l) {
message(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
!$urpm->{options}{'allow-force'} and exit 1;
@@ -614,7 +622,9 @@ if (%sources_install || %sources) {
@l = $urpm->install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
translate_message => 1, nodeps => 1, force => 1,
oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
- test => $test, excludepath => $urpm->{options}{excludepath});
+ test => $test,
+ excludepath => $urpm->{options}{excludepath},
+ excludedocs => $urpm->{options}{excludedocs});
@l and $urpm->fatal(2, N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
}
} else {
diff --git a/urpmi.addmedia b/urpmi.addmedia
index c9f5261c..fe294a15 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -56,6 +56,10 @@ and [options] are from
") . N(" --proxy-user - specify user and password to use for proxy
authentication (format is <user:password>).
") . N(" --update - create an update medium.
+") . N(" --probe-synthesis - try to find and use synthesis file.
+") . N(" --probe-hdlist - try to find and use hdlist file.
+") . N(" --no-probe - do not try to find any synthesis or
+ hdlist file.
") . N(" --distrib - automatically create all media from an installation
medium.
") . N(" --distrib-XXX - automatically create a medium for XXX part of a
@@ -69,17 +73,16 @@ and [options] are from
") . N(" --arch - use specified architecture, the default is arch of
mandrake-release package installed.
") . N(" -c - clean headers cache directory.
-") . N(" -h - try to find and use synthesis or hdlist
- file.
") . N(" -f - force generation of hdlist files.
");
$options{force} = 0;
$options{noclean} = 1;
+ $options{probe_with} = 'synthesis'; #- no the default is to probe synthesis file.
my $urpm = new urpm;
while ($_ = shift @_) {
/^--?c/ and $options{noclean} = 0, next;
- /^--?h/ and $options{probe_with_hdlist} = 1, next;
+ /^--?h/ and next;
/^--?f/ and ++$options{force}, next;
/^--wget/ and $urpm->{sync} = sub { my $options = shift @_;
if (ref $options) { $options->{prefer} = 'wget' }
@@ -101,6 +104,9 @@ and [options] are from
$urpm->{proxy}{pwd} = $2;
next;
};
+ /^--probe-synthesis/ and $options{probe_with} = 'synthesis', next;
+ /^--probe-hdlist/ and $options{probe_with} = 'hdlist', next;
+ /^--no-probe/ and $options{probe_with} = undef, next;
/^--distrib$/ and $options{distrib} = undef, next;
/^--distrib-(.*)$/ and $options{distrib} = $1, next;
/^--from$/ and $options{mirrors_url} = shift @_, next;
@@ -123,7 +129,6 @@ and [options] are from
$name or die $usage;
#- extended distribution support, code is directly inlined here.
#- -h always set, updates should allow setting update flag.
- $options{probe_with_hdlist} = 1;
$options{distrib} eq 'updates' and $options{update} = 1;
#- official site by default.
$options{from} ||= $mirrors;
@@ -198,8 +203,8 @@ and [options] are from
if ($with eq "with") {
$relative_hdlist or die N("%s\n<relative path of hdlist> missing\n", $usage);
- } elsif ($type =~ /ftp|http/) {
- $options{probe_with_hdlist} || $with eq "with" or die N("%s\n`with' missing for ftp media\n", $usage);
+ } elsif ($type =~ /ftp|http|rsync|ssh/) {
+ $options{probe_with} || $with eq "with" or die N("%s\n`with' missing for network media\n", $usage);
}
$urpm->add_medium($name, $url, $relative_hdlist, update => $options{update});
diff --git a/urpmi.spec b/urpmi.spec
index 4c76e12f..80ab81d5 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -1,15 +1,15 @@
%define group System/Configuration/Packaging
Name: urpmi
-Version: 4.2
-Release: 35mdk
+Version: 4.3
+Release: 1mdk
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.81
+PreReq: perl-Locale-gettext >= 1.01-7mdk rpmtools >= 4.3-6mdk perl-URPM >= 0.82-2mdk
BuildRequires: bzip2-devel gettext rpm-devel >= 4.0.3 perl-MDK-Common-devel
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
@@ -199,7 +199,13 @@ $urpm->update_media;
%changelog
-
+* Mon Apr 14 2003 François Pons <fpons@mandrakesoft.com> 4.3-1mdk
+- avoid scanning all urpmi cache for checking unused rpm files.
+- added smarter skip.list support (parsed before resolving requires).
+- added --excludemedia options to urpmi and urpmq.
+- obsoleted -h, added --probe-synthesis, --probe-hdlist,
+ --no-probe, now --probe-synthesis is by default.
+- added --excludedocs option.
- fixed --excludepath option.
* Fri Mar 28 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 4.2-35mdk
diff --git a/urpmq b/urpmq
index c8496f4c..a7166a2b 100755
--- a/urpmq
+++ b/urpmq
@@ -37,6 +37,7 @@ usage:
", $urpm::VERSION) . N(" --help - print this help message.
") . N(" --update - use only update media.
") . N(" --media - use only the given media, separated by comma.
+") . N(" --excludemedia - do not use only the given media, separated by comma.
") . N(" --synthesis - use the synthesis given instead of urpmi db.
") . N(" --auto-select - automatically select packages to upgrade the system.
") . N(" --fuzzy - impose fuzzy search (same as -y).
@@ -82,6 +83,7 @@ while (defined($_ = shift @ARGV)) {
/^--help$/ and do { usage };
/^--update$/ and do { $query->{update} = 1; next };
/^--media$/ and do { push @nextargv, \$query->{media}; next };
+ /^--exclude-?media$/ and do { push @nextargv, \$query->{excludemedia}; next };
/^--mediums$/ and do { push @nextargv, \$query->{media}; next };
/^--synthesis$/ and do { push @nextargv, \$query->{synthesis}; next };
/^--auto-select$/ and do { $query->{deps} = $query->{upgrade} = $query->{auto_select} = 1; next };
@@ -94,6 +96,7 @@ while (defined($_ = shift @ARGV)) {
/^--headers$/ and do { $query->{headers} = 1; next };
/^--sources$/ and do { $query->{sources} = 1; next };
/^--force$/ and do { $query->{force} = 1; next };
+ /^--skip$/ and do { push @nextargv, \$query->{skip}; next };
/^--root$/ and do { push @nextargv, \$query->{root}; next };
/^--parallel$/ and do { push @nextargv, \$query->{parallel}; next };
/^--wget$/ and do { $urpm->{sync} = sub { my $options = shift @_;
@@ -149,8 +152,10 @@ $query->{verbose} or $urpm->{log} = sub {};
$urpm->configure(nocheck_access => 1,
media => $query->{media},
+ excludemedia => $query->{excludemedia},
synthesis => $query->{synthesis},
update => $query->{update},
+ skip => $query->{skip},
root => $query->{root},
parallel => $query->{parallel},
);
@@ -285,9 +290,6 @@ if ($query->{list_aliases}) {
$state->{selected} = \%requested;
}
- #- get out of package that should not be upgraded.
- $urpm->deselect_unwanted_packages($state->{selected});
-
if ($query->{headers} || $query->{sources}) {
my ($local_sources, $list) = $urpm->get_source_packages($state->{selected});
unless ($local_sources || $list) {
@@ -311,7 +313,6 @@ if ($query->{list_aliases}) {
} else {
#- fallback to retrieve rpm package before, so that --headers will be ok.
my %downloads = $urpm->download_source_packages({}, $list, 'local', undef);
- print STDERR join " ", "rpm2header", values %downloads;
system "rpm2header", values %downloads;
}
}