summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-21 14:12:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-21 14:12:30 +0000
commit8cb5d5f1b9513ec8e8b67577fbe5d3bea96e2f7b (patch)
tree9875b3ce42e4f9806761a8081d8f69fd415a17b1
parentd24987f7c3ca1e7d140a6266421e2e81797217b6 (diff)
downloadurpmi-8cb5d5f1b9513ec8e8b67577fbe5d3bea96e2f7b.tar
urpmi-8cb5d5f1b9513ec8e8b67577fbe5d3bea96e2f7b.tar.gz
urpmi-8cb5d5f1b9513ec8e8b67577fbe5d3bea96e2f7b.tar.bz2
urpmi-8cb5d5f1b9513ec8e8b67577fbe5d3bea96e2f7b.tar.xz
urpmi-8cb5d5f1b9513ec8e8b67577fbe5d3bea96e2f7b.zip
- fix typo _is_local_virtual() and _is_remote_virtual()
- introduce _local_file()
-rw-r--r--urpm/media.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 0e056c63..8ca10605 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -243,13 +243,18 @@ sub file_from_file_url {
$url =~ m!^(?:file:/)?(/.*)! && $1;
}
+sub _local_file {
+ my ($medium) = @_;
+ $medium->{url} && file_from_file_url($medium->{url});
+}
+
sub _is_local_virtual {
my ($medium) = @_;
- $medium->{virtual} && file_from_file_url($medium);
+ $medium->{virtual} && _local_file($medium);
}
sub _is_remote_virtual {
my ($medium) = @_;
- $medium->{virtual} && !file_from_file_url($medium);
+ $medium->{virtual} && !_local_file($medium);
}
sub _url_with_synthesis_basename {
@@ -334,7 +339,7 @@ sub any_synthesis {
sub any_media_info_file {
my ($urpm, $medium, $prefix, $suffix, $quiet, $o_callback) = @_;
- if (my $base = file_from_file_url($medium->{url})) {
+ if (my $base = _local_file($medium)) {
my $f = $medium->{with_synthesis}
? reduce_pathname("$base/$prefix." . _synthesis_suffix($medium) . $suffix)
: _synthesis_dir($medium) . "/$prefix$suffix";
@@ -684,10 +689,10 @@ sub add_medium {
#- local media have priority, other are added at the end.
my $inserted;
my $ignore_text = $medium->{ignore} ? ' ' . N("(ignored by default)") : '';
- if (file_from_file_url($url)) {
+ if (_local_file($medium)) {
#- insert before first remote medium
@{$urpm->{media}} = map {
- if (!file_from_file_url($_->{url}) && !$inserted) {
+ if (!_local_file($_) && !$inserted) {
$inserted = 1;
$urpm->{info}(N("adding medium \"%s\" before remote medium \"%s\"", $name, $_->{name}) . $ignore_text);
$medium, $_;
@@ -1443,7 +1448,7 @@ sub _update_medium_ {
remove_user_media_info_files($urpm, $medium);
- if (!file_from_file_url($medium->{url})) {
+ if (!_local_file($medium)) {
_retrieve_xml_media_info_or_remove($urpm, $medium, $options{quiet}) or return;
}
}