summaryrefslogtreecommitdiffstats
path: root/urpmi.addmedia
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-04-11 14:00:19 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-04-11 14:00:19 +0000
commiteac41d32643794eaf3ea6f1717b538b024067697 (patch)
treee0b0bf0c5893ff15084348b01bc746695b30b0be /urpmi.addmedia
parent356f6e4dd452ff11017aa2466ea4aa2324306012 (diff)
downloadurpmi-eac41d32643794eaf3ea6f1717b538b024067697.tar
urpmi-eac41d32643794eaf3ea6f1717b538b024067697.tar.gz
urpmi-eac41d32643794eaf3ea6f1717b538b024067697.tar.bz2
urpmi-eac41d32643794eaf3ea6f1717b538b024067697.tar.xz
urpmi-eac41d32643794eaf3ea6f1717b538b024067697.zip
Add a --raw option to urpmi.addmedia
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-xurpmi.addmedia33
1 files changed, 22 insertions, 11 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia
index df54a7a6..e4bc7ffc 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -68,6 +68,7 @@ and [options] are from
only file:// protocol is allowed.
") . N(" --no-md5sum - disable MD5SUM file checking.
") . N(" --norebuild - don't try to rebuild hdlist if not readable.
+") . N(" --raw - add the media in config, but don't update it.
") . N(" -c - clean headers cache directory.
") . N(" -f - force generation of hdlist files.
") . N(" -q - quiet mode.
@@ -134,19 +135,27 @@ sub main {
$options{probe_with} || $with eq "with" or usage N("`with' missing for network media\n");
}
- $urpm->add_medium($name, $url, $relative_hdlist, virtual => $options{virtual}, update => $options{update});
+ $urpm->add_medium(
+ $name, $url, $relative_hdlist,
+ virtual => $options{virtual},
+ update => $options{update},
+ no_reload_config => $options{raw},
+ );
urpm::download::copy_cmd_line_proxy($name);
- $urpm->update_media(%options, callback => \&urpm::download::sync_logger);
-
- #- check creation of media (during update has been successfull)
- my ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}};
- $medium or die N("unable to create medium \"%s\"\n", $name);
- if ($medium->{modified}) {
- print STDERR N("unable to update medium \"%s\"\n", $name);
- #- remove quietly the failing media.
- $urpm->{log} = sub {};
- $urpm->remove_selected_media;
+ if ($options{raw}) {
+ $urpm->write_config();
+ } else {
$urpm->update_media(%options, callback => \&urpm::download::sync_logger);
+ #- check creation of media
+ my ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}};
+ $medium or die N("unable to create medium \"%s\"\n", $name);
+ if ($medium->{modified}) {
+ print STDERR N("unable to update medium \"%s\"\n", $name);
+ #- remove quietly the failing media.
+ $urpm->{log} = sub {};
+ $urpm->remove_selected_media;
+ $urpm->update_media(%options, callback => \&urpm::download::sync_logger);
+ }
}
}
@@ -155,3 +164,5 @@ sub main {
}
main();
+
+=for vim:ts=8:sts=4:sw=4