builder: normalize architectures

Normalize the target architecture, and also each architecture when
checking for a compatible image.

This sort of reverts the effects of
commit 8864c47b94, but at least it is
possible to build e.g. Debian-based amd64 images on any x86_64 system
without being considered as foreign architecture.
This commit is contained in:
Pino Toscano
2015-08-11 15:35:01 +02:00
parent 0bbb903f42
commit d78f685c0e
2 changed files with 2 additions and 1 deletions

View File

@@ -238,7 +238,7 @@ let main () =
let item =
try List.find (
fun (name, { Index.arch = a }) ->
name = arg && arch = a
name = arg && arch = normalize_arch a
) index
with Not_found ->
error (f_"cannot find os-version '%s' with architecture '%s'.\nUse --list to list available guest types.")

View File

@@ -295,6 +295,7 @@ read the man page virt-builder(1).
match arch with
| "" -> Config.host_cpu
| arch -> arch in
let arch = normalize_arch arch in
(* If user didn't elect any root password, that means we set a random
* root password.