Less naive method of template name construction

This commit is contained in:
Marek Marczykowski-Górecki 2014-07-26 04:30:31 +02:00
parent 7f38babc0a
commit fa134bd512
4 changed files with 8 additions and 4 deletions

View File

@ -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

1
builder_setup Normal file → Executable file
View File

@ -22,3 +22,4 @@ fi
CACHEDIR=cache_$DIST
export SCRIPTSDIR CACHEDIR
echo $DISTRIBUTION $VERSION

View File

@ -6,7 +6,7 @@ RETCODE=0
: ${DIST=fc14}
. ./builder_setup
. ./builder_setup >/dev/null
set -e

View File

@ -3,7 +3,7 @@
export CLEANIMG=$1
export NAME=$2
. ./builder_setup
. ./builder_setup >/dev/null
set -e