From 14abfdf01bfa2e0872a85ea7ce022d44a6e29fb7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sat, 23 Feb 2008 21:31:09 +0000 Subject: - all tools: o handle mirrorlist (need perl-Zone-TimeInfo patched for geolocalisation) --- urpmi.addmedia | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'urpmi.addmedia') diff --git a/urpmi.addmedia b/urpmi.addmedia index c24759a2..3bf79ba2 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -41,6 +41,15 @@ where is one of http:/// removable:// +usage: urpmi.addmedia [options] --distrib --mirrorlist +usage: urpmi.addmedia [options] --mirrorlist + +examples: + + urpmi.addmedia --distrib --mirrorlist '\$MIRRORLIST' + urpmi.addmedia --mirrorlist '\$MIRRORLIST' backports media/main/backports + + and [options] are from ") . N(" --help - print this help message. ") . N(" --wget - use wget to retrieve distant files. @@ -94,11 +103,20 @@ if ($options{'xml-info'}) { } our ($name, $url, $with, $relative_synthesis) = our @cmdline; +my $with_dir; $options{quiet} = 1 if $options{verbose} < 0; $url or ($url, $name) = ($name, ''); -$url =~ m,^(([^:]*):/)?/, or die N("bad (for local directory, the path must be absolute)") . "\n"; +if ($options{mirrorlist}) { + if ($options{distrib}) { + $url and die N("no argument needed for --distrib --mirrorlist ") . "\n"; + } else { + ($with_dir, $url) = ($url, undef); + } +} else { + $url =~ m,^(([^:]*):/)?/, or die N("bad (for local directory, the path must be absolute)") . "\n"; +} if ($< != 0) { $urpm->{fatal}(1, N("Only superuser is allowed to add media")); @@ -132,6 +150,7 @@ if ($options{distrib}) { urpm::media::add_distrib_media($urpm, $name, $url, + mirrorlist => $options{mirrorlist}, virtual => $options{virtual}, update => $options{update}, probe_with => $options{probe_with}, @@ -154,6 +173,8 @@ if ($options{distrib}) { urpm::media::add_medium($urpm, $name, $url, $relative_synthesis, + mirrorlist => $options{mirrorlist}, + 'with-dir' => $with_dir, virtual => $options{virtual}, update => $options{update}, ignore => $options{raw}, -- cgit v1.2.1