summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-27 13:57:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-27 13:57:48 +0000
commit19456f175d4681a0646af79d75e04fe9e64e3648 (patch)
tree9e183a57a34f8fe3295feec3f854949703b24ae4 /urpm.pm
parent1a8e216b62644a003e0ee4530841a0147d5f4edb (diff)
downloadurpmi-19456f175d4681a0646af79d75e04fe9e64e3648.tar
urpmi-19456f175d4681a0646af79d75e04fe9e64e3648.tar.gz
urpmi-19456f175d4681a0646af79d75e04fe9e64e3648.tar.bz2
urpmi-19456f175d4681a0646af79d75e04fe9e64e3648.tar.xz
urpmi-19456f175d4681a0646af79d75e04fe9e64e3648.zip
- create file_from_local_medium(), and use it where possible instead of
file_from_local_url() - in urpm::removable, this implies passing $blist around nb: for now file_from_local_medium() doesn't use the first parameter if url is given, but future commit will use both (needed for {url} cdrom://)
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index 7699d33c..aec79d5e 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -14,7 +14,7 @@ use urpm::md5sum;
our $VERSION = '5.6';
our @ISA = qw(URPM Exporter);
-our @EXPORT_OK = ('file_from_local_url', 'is_local_medium');
+our @EXPORT_OK = ('file_from_local_url', 'file_from_local_medium', 'is_local_medium');
use URPM;
use URPM::Resolve;
@@ -200,6 +200,10 @@ sub file_from_local_url {
my ($url) = @_;
$url =~ m!^(?:removable[^:]*:/|file:/)?(/.*)! && $1;
}
+sub file_from_local_medium {
+ my ($medium, $o_url) = @_;
+ file_from_local_url($o_url || $medium->{url});
+}
sub is_local_url {
my ($url) = @_;
file_from_local_url($url);