summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-14 13:58:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-14 13:58:28 +0000
commitdfb0b59296ce2b2822dc678b7ff6145b93a57dc8 (patch)
tree88daacec0f2cdd58b5044f578987cb32d11052ec
parent6ca1979e2bdb84916df7b08ea1eb9ea001f024d7 (diff)
downloadurpmi-dfb0b59296ce2b2822dc678b7ff6145b93a57dc8.tar
urpmi-dfb0b59296ce2b2822dc678b7ff6145b93a57dc8.tar.gz
urpmi-dfb0b59296ce2b2822dc678b7ff6145b93a57dc8.tar.bz2
urpmi-dfb0b59296ce2b2822dc678b7ff6145b93a57dc8.tar.xz
urpmi-dfb0b59296ce2b2822dc678b7ff6145b93a57dc8.zip
create may_reconfig_urpmi() out of _update_medium_first_pass()
-rw-r--r--urpm.pm34
1 files changed, 20 insertions, 14 deletions
diff --git a/urpm.pm b/urpm.pm
index a325889c..867e5063 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -988,6 +988,25 @@ sub _probe_with_try_list {
@probe;
}
+sub may_reconfig_urpmi {
+ my ($urpm, $medium, $options) = @_;
+
+ my $f;
+ if (my $dir = file_from_file_url($medium->{url})) {
+ $f = reduce_pathname("$dir/reconfig.urpmi");
+ } else {
+ unlink($f = "$urpm->{cachedir}/partial/reconfig.urpmi");
+ eval {
+ sync_webfetch($urpm, $medium, [ reduce_pathname("$medium->{url}/reconfig.urpmi") ],
+ $options, quiet => 1);
+ };
+ }
+ if (-s $f) {
+ reconfig_urpmi($urpm, $f, $medium->{name});
+ }
+ unlink $f if !file_from_file_url($medium->{url});
+}
+
#- read a reconfiguration file for urpmi, and reconfigure media accordingly
#- $rfile is the reconfiguration file (local), $name is the media name
#-
@@ -1525,20 +1544,7 @@ sub _update_medium_first_pass {
#- check for a reconfig.urpmi file (if not already reconfigured)
if (!$medium->{noreconfigure}) {
- my $reconfig_urpmi;
- if (my $dir = file_from_file_url($medium->{url})) {
- $reconfig_urpmi = reduce_pathname("$dir/reconfig.urpmi");
- } else {
- unlink($reconfig_urpmi = "$urpm->{cachedir}/partial/reconfig.urpmi");
- eval {
- sync_webfetch($urpm, $medium, [ reduce_pathname("$medium->{url}/reconfig.urpmi") ],
- \%options, quiet => 1);
- };
- }
- if (-s $reconfig_urpmi) {
- $urpm->reconfig_urpmi($reconfig_urpmi, $medium->{name});
- }
- unlink $reconfig_urpmi if !file_from_file_url($medium->{url});
+ may_reconfig_urpmi($urpm, $medium, \%options);
}
#- list of rpm files for this medium, only available for local medium where