aboutsummaryrefslogtreecommitdiffstats
path: root/gurpmi.addmedia
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-05-09 17:01:33 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-05-09 17:01:33 +0000
commit5b3406fee29f11400ef6bb7337d5009d2331fd41 (patch)
tree9ba4e69017228dbfd9c9b08691e71e1219884602 /gurpmi.addmedia
parent97c476306e7c780d7dd434cef9b522f59b4137f6 (diff)
downloadrpmdrake-5b3406fee29f11400ef6bb7337d5009d2331fd41.tar
rpmdrake-5b3406fee29f11400ef6bb7337d5009d2331fd41.tar.gz
rpmdrake-5b3406fee29f11400ef6bb7337d5009d2331fd41.tar.bz2
rpmdrake-5b3406fee29f11400ef6bb7337d5009d2331fd41.tar.xz
rpmdrake-5b3406fee29f11400ef6bb7337d5009d2331fd41.zip
- allow adding local media without file:// (#27291)
- update usage accordingly - do not mention "... with hdlist" in usage (it's deprecated)
Diffstat (limited to 'gurpmi.addmedia')
-rwxr-xr-xgurpmi.addmedia18
1 files changed, 12 insertions, 6 deletions
diff --git a/gurpmi.addmedia b/gurpmi.addmedia
index 3920baf4..b9b8d332 100755
--- a/gurpmi.addmedia
+++ b/gurpmi.addmedia
@@ -28,11 +28,12 @@ BEGIN {
@ARGV == 0 || "@ARGV" =~ /-h/ and do {
print "usage: gurpmi.addmedia [options] <name> <url> [with <relative_path>]
where <url> is one of
- file://<path>
- ftp://<login>:<password>@<host>/<path> with <relative filename of hdlist>
- ftp://<host>/<path> with <relative filename of hdlist>
- http://<host>/<path> with <relative filename of hdlist>
- removable://<path>
+ [file:/]/<path>
+ ftp://<login>:<password>\@<host>/<path>
+ ftp://<host>/<path>
+ http://<host>/<path>
+ removable://<path>
+
and [options] are from
--update create an update medium.
--silent-success don't show popup window on success
@@ -78,7 +79,12 @@ my @names;
while (@ARGV) {
my ($name, $url, $with, $with_hdlist) = @ARGV;
$with eq 'with' or ($with, $with_hdlist) = (undef, undef);
- if ($url !~ m,^(file://|ftp://|http://|removable://), || $with && !$with_hdlist) {
+ if ($url !~ m,^(([^:]*):/)?/,) {
+ interactive_msg('gurpmi.addmedia',
+ N("bad <url> (for local directory, the path must be absolute)"));
+ myexit(-1);
+ }
+ if ($with && !$with_hdlist) {
interactive_msg('gurpmi.addmedia',
N("Unable to add medium, wrong or missing arguments"));
myexit(-1);