builder: remove VIRT_BUILDER_SOURCE and VIRT_BUILDER_FINGERPRINT

Drop these two environment variables, and the implicit hardcoded source
hosted at libguestfs.org.
This means all the sources must be provided as .conf files, or at each
invocation with --source.
This commit is contained in:
Pino Toscano
2014-02-25 17:29:11 +01:00
committed by Richard W.M. Jones
parent f4990bef1c
commit 573cae45c3

View File

@@ -30,8 +30,6 @@ open Printf
let prog = Filename.basename Sys.executable_name
let default_source = "http://libguestfs.org/download/builder/index.asc"
let parse_cmdline () =
let display_version () =
printf "virt-builder %s\n" Config.package_version;
@@ -407,27 +405,13 @@ read the man page virt-builder(1).
exit 1
) in
(* Check source(s) and fingerprint(s), or use environment or default. *)
(* Check source(s) and fingerprint(s). *)
let sources =
let list_split = function "" -> [] | str -> string_nsplit "," str in
let rec repeat x = function
| 0 -> [] | 1 -> [x]
| n -> x :: repeat x (n-1)
in
let sources =
if sources <> [] then sources
else (
try list_split (Sys.getenv "VIRT_BUILDER_SOURCE")
with Not_found -> [ default_source ]
) in
let fingerprints =
if fingerprints <> [] then fingerprints
else (
try list_split (Sys.getenv "VIRT_BUILDER_FINGERPRINT")
with Not_found -> [ Sigchecker.default_fingerprint ]
) in
let nr_sources = List.length sources in
let fingerprints =
match fingerprints with
@@ -444,8 +428,6 @@ read the man page virt-builder(1).
exit 1
);
assert (nr_sources > 0);
(* Combine the sources and fingerprints into a single list of pairs. *)
List.combine sources fingerprints in