Print the package name and version number, and exit.
+=item B<--yum-config CONFIGFILE>
+
+(Yum/RPM package handler only). Use an alternate configuration file
+instead of C</etc/yum.conf>. If you also want to specify alternate
+repositories then you can put them in this file directly or add a
+C<reposdir> option to this file. For more information on the file
+format see L<yum.conf(5)>.
+
=back
=head1 SEE ALSO
let packages = ref []
let verbose = ref false
let warnings = ref true
+let yum_config = ref None
let print_version () =
printf "%s %s\n" Config.package_name Config.package_version;
let add_exclude re =
excludes := Str.regexp re :: !excludes
+let set_yum_config str =
+ yum_config := Some str
+
let argspec = Arg.align [
"--exclude", Arg.String add_exclude,
"regexp Exclude packages matching regexp";
" Print package name and version, and exit";
"--version", Arg.Unit print_version,
" Print package name and version, and exit";
+ "--yum-config", Arg.String set_yum_config,
+ "file Set alternate yum configuration file";
]
let anon_fn str =
packages := str :: !packages
let packages = List.rev !packages
let verbose = !verbose
let warnings = !warnings
+let yum_config = !yum_config
let debug fs = ksprintf (fun str -> if verbose then print_endline str) fs
val warnings : bool
(** If true, print warnings. [--no-warnings] sets this to false. *)
+
+val yum_config : string option
+ (** Yum configuration file. *)
yb = yum.YumBase ()
yb.preconf.debuglevel = %d
yb.preconf.errorlevel = %d
+if %s:
+ yb.preconf.fn = %S
yb.setCacheDir ()
# Look up the base packages from the command line.
f.write (\"%%s %%s %%s %%s %%s\\n\" %%
(pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch))
f.close ()
-" (if verbose then 1 else 0) (if verbose then 1 else 0) tmpfile in
+"
+ (if verbose then 1 else 0)
+ (if verbose then 1 else 0)
+ (match yum_config with None -> "False" | Some _ -> "True")
+ (match yum_config with None -> "" | Some filename -> filename)
+ tmpfile in
run_python py names;
let chan = open_in tmpfile in
let lines = input_all_lines chan in
exit 1
);
- let cmd = sprintf "yumdownloader%s --destdir %s %s"
+ let cmd = sprintf "yumdownloader%s%s --destdir %s %s"
(if verbose then "" else " --quiet")
+ (match yum_config with None -> ""
+ | Some filename -> sprintf " -c %s" filename)
(Filename.quote tmpdir)
(String.concat " " (List.map Filename.quote pkgnames)) in
run_command cmd;