diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-27 13:44:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-27 13:44:26 +0000 |
commit | 1a8e216b62644a003e0ee4530841a0147d5f4edb (patch) | |
tree | 1a213f49492079664d866f83cc7f8860f72928bf /urpm.pm | |
parent | f969d3d1e11f5fed1acc8e5e35b14dea60b06a0e (diff) | |
download | urpmi-1a8e216b62644a003e0ee4530841a0147d5f4edb.tar urpmi-1a8e216b62644a003e0ee4530841a0147d5f4edb.tar.gz urpmi-1a8e216b62644a003e0ee4530841a0147d5f4edb.tar.bz2 urpmi-1a8e216b62644a003e0ee4530841a0147d5f4edb.tar.xz urpmi-1a8e216b62644a003e0ee4530841a0147d5f4edb.zip |
create is_local_medium() and is_local_url()
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) = @_; |