summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index 85345f66..7699d33c 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';
+our @EXPORT_OK = ('file_from_local_url', 'is_local_medium');
use URPM;
use URPM::Resolve;
@@ -200,6 +200,14 @@ sub file_from_local_url {
my ($url) = @_;
$url =~ m!^(?:removable[^:]*:/|file:/)?(/.*)! && $1;
}
+sub is_local_url {
+ my ($url) = @_;
+ file_from_local_url($url);
+}
+sub is_local_medium {
+ my ($medium) = @_;
+ is_local_url($medium->{url});
+}
sub db_open_or_die {
my ($urpm, $root, $b_write_perm) = @_;