diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2004-01-13 15:57:28 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2004-01-13 15:57:28 +0000 |
commit | 45219a97f50e6c6328d14da239c0fea7192e4007 (patch) | |
tree | 68422c437f2b904d0fa9477990bd096b2ee2b2b7 | |
parent | bc1eba5a5ced035717c0b9000bd1015c5551d289 (diff) | |
download | urpmi-45219a97f50e6c6328d14da239c0fea7192e4007.tar urpmi-45219a97f50e6c6328d14da239c0fea7192e4007.tar.gz urpmi-45219a97f50e6c6328d14da239c0fea7192e4007.tar.bz2 urpmi-45219a97f50e6c6328d14da239c0fea7192e4007.tar.xz urpmi-45219a97f50e6c6328d14da239c0fea7192e4007.zip |
add --use-distrib code
-rw-r--r-- | urpm.pm | 9 | ||||
-rw-r--r-- | urpme | 4 | ||||
-rwxr-xr-x | urpmi | 3 | ||||
-rwxr-xr-x | urpmq | 2 |
4 files changed, 16 insertions, 2 deletions
@@ -787,7 +787,12 @@ sub configure { $urpm->{options}{'split-length'} = 0; } } else { - $urpm->read_config(%options); + if ($options{usedistrib}) { + $urpm->{media} = []; + $urpm->add_distrib_media("Virtual", $options{usedistrib}, %options, 'virtual' => 1); + } else { + $urpm->read_config(%options); + } if ($options{media}) { delete $_->{modified} foreach @{$urpm->{media} || []}; $urpm->select_media(split ',', $options{media}); @@ -918,6 +923,7 @@ sub add_medium { my ($urpm, $name, $url, $with_hdlist, %options) = @_; #- make sure configuration has been read. + # (Olivier Thauvin) Yes but Why ??? Is this a workaround ? $urpm->{media} or $urpm->read_config(); #- if a medium with that name has already been found @@ -986,6 +992,7 @@ sub add_distrib_media { my ($hdlists_file); #- make sure configuration has been read. + # (Olivier Thauvin): Is this a workaround ? $urpm->{media} or $urpm->read_config(); #- try to copy/retrive Mandrake/basehdlists file. @@ -25,7 +25,7 @@ use URPM; use URPM::Resolve; use urpm; -my (@nextargv, $root, $test, $parallel, $auto, $matches, $verbose, $maymatch, @l); +my (@nextargv, $root, $test, $parallel, $auto, $matches, $verbose, $maymatch, $usedistrib, @l); my $askok = N("Is this OK?"); # Translator: Add here the keys which might be pressed in the "No"-case. my $noexpr = N("Nn"); @@ -57,6 +57,7 @@ while (defined($_ = shift @ARGV)) { /^--(no-)?test$/ and do { $test = !$1; next }; /^--force$/ and do { $force = 1; next }; /^--root$/ and do { push @nextargv, \$root; next }; + /^--use-distrib$/ and do { push @nextargv, \$usedistrib; next }; /^--parallel$/ and do { push @nextargv, \$parallel; next }; /^-(.*)$/ and do { foreach (split //, $1) { /[\?h]/ and do { usage; next }; @@ -77,6 +78,7 @@ $verbose or $urpm->{log} = sub {}; $parallel and $urpm->configure(synthesis => ($parallel and 'none'), root => $root, parallel => $parallel, + usedistrib => $usedistrib, ); #- examine packages... @@ -50,6 +50,7 @@ my $noclean = 0; my $verbose = 0; my $skip = ''; my $root = ''; +my $usedistrib = undef; my $bug = ''; my $env = ''; my $log = ''; @@ -204,6 +205,7 @@ while (defined($_ = shift @argv)) { /^--comment$/ and do { push @nextargv, undef; next }; /^--skip$/ and do { push @nextargv, \$skip; next }; /^--root$/ and do { push @nextargv, \$root; next }; + /^--use-distrib$/ and do { push @nextargv, \$usedistrib; 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) { @@ -334,6 +336,7 @@ $urpm->configure(nocheck_access => $env || $uid > 0, root => $root, bug => $bug, parallel => $parallel, + usedistrib => $usedistrib, ); #- get back activated default values of boolean options. foreach (qw(post-clean verify-rpm)) { @@ -113,6 +113,7 @@ while (defined($_ = shift @ARGV)) { /^--force$/ and do { $query->{force} = 1; next }; /^--skip$/ and do { push @nextargv, \$query->{skip}; next }; /^--root$/ and do { push @nextargv, \$query->{root}; next }; + /^--use-distrib$/ and do { push @nextargv, \$query->{usedistrib}; next }; /^--parallel$/ and do { push @nextargv, \$query->{parallel}; next }; /^--wget$/ and do { $urpm->{sync} = sub { my $options = shift @_; if (ref($options)) { $options->{prefer} = 'wget' } @@ -192,6 +193,7 @@ $urpm->configure(nocheck_access => 1, skip => $query->{skip}, root => $query->{root}, parallel => $query->{parallel}, + usedistrib => $query->{usedistrib}, ); my $state = {}; |