From fa134bd51214259f94ae7b857f61b971fefe9ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 26 Jul 2014 04:30:31 +0200 Subject: [PATCH] Less naive method of template name construction --- Makefile | 7 +++++-- builder_setup | 1 + prepare_image | 2 +- qubeize_image | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) mode change 100644 => 100755 builder_setup diff --git a/Makefile b/Makefile index cd9b670..f69810e 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ ifndef DIST $(error "You must set DIST variable, e.g. DIST=fc14") endif +export DIST -#TODO: build template name somehow smarter -TEMPLATE_NAME := $${DIST/fc/fedora-}-x64 +dist_ver := $(shell DIST=$(DIST) ./builder_setup) +DISTRIBUTION := $(word 1,$(dist_ver)) +DIST_VERSION := $(word 2,$(dist_ver)) +TEMPLATE_NAME := $(DISTRIBUTION)-$(DIST_VERSION)-x64 ifdef TEMPLATE_FLAVOR TEMPLATE_NAME := $(TEMPLATE_NAME)-$(TEMPLATE_FLAVOR) endif diff --git a/builder_setup b/builder_setup old mode 100644 new mode 100755 index 07128eb..ff2fef5 --- a/builder_setup +++ b/builder_setup @@ -22,3 +22,4 @@ fi CACHEDIR=cache_$DIST export SCRIPTSDIR CACHEDIR +echo $DISTRIBUTION $VERSION diff --git a/prepare_image b/prepare_image index d5e747f..e101a14 100755 --- a/prepare_image +++ b/prepare_image @@ -6,7 +6,7 @@ RETCODE=0 : ${DIST=fc14} -. ./builder_setup +. ./builder_setup >/dev/null set -e diff --git a/qubeize_image b/qubeize_image index a4acbc1..f30447d 100755 --- a/qubeize_image +++ b/qubeize_image @@ -3,7 +3,7 @@ export CLEANIMG=$1 export NAME=$2 -. ./builder_setup +. ./builder_setup >/dev/null set -e