improve svn detection
This commit is contained in:
parent
2cf438eb4f
commit
46ef594184
1 changed files with 8 additions and 4 deletions
12
Makefile
12
Makefile
|
@ -1,7 +1,11 @@
|
||||||
########## Variablendefinitionen ###########
|
########## Variablendefinitionen ###########
|
||||||
|
|
||||||
|
# ist subversion verfuegbar?
|
||||||
|
IS_SVN := $(shell test -d .svn && which svn && echo "yes")
|
||||||
# Revisions-Variablen
|
# Revisions-Variablen
|
||||||
REVISIONS_NR := $(shell if test -d .svn; then svn -R info | grep ^Revision | cut -f2 -d " " | sort | tail -1; else date +%Y%m%d; fi)
|
REVISIONS_NR := $(shell test "yes" = "$(IS_SVN)" && svn -R info | grep ^Revision | cut -f2 -d " " | sort | tail -1)
|
||||||
|
# kein svn vorhanden? also nehmen wir das heutige Datum
|
||||||
|
REVISIONS_NR ?= $(shell date +%Y%m%d)
|
||||||
REVISIONS_SUFFIX = _r$(REVISIONS_NR)
|
REVISIONS_SUFFIX = _r$(REVISIONS_NR)
|
||||||
|
|
||||||
# Verzeichnisse
|
# Verzeichnisse
|
||||||
|
@ -17,7 +21,7 @@ EXPORT_FILE = $(EXPORT_DIR)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUF
|
||||||
|
|
||||||
# Zwischenlagerung
|
# Zwischenlagerung
|
||||||
TMP_ROOT = $(ROOT_DIR)/tmp
|
TMP_ROOT = $(ROOT_DIR)/tmp
|
||||||
CCD_BUILD_DIR = $(TMP_ROOT)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
|
CCD_BUILD_DIR ?= $(TMP_ROOT)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUFFIX)
|
||||||
PROGRAMM_DIR = $(CCD_BUILD_DIR)/programme
|
PROGRAMM_DIR = $(CCD_BUILD_DIR)/programme
|
||||||
|
|
||||||
# Verzeichnisse, die notfalls erstellt werden muessen
|
# Verzeichnisse, die notfalls erstellt werden muessen
|
||||||
|
@ -99,7 +103,7 @@ $(CREATE_DIRS):
|
||||||
cd-template: verzeichnisstruktur
|
cd-template: verzeichnisstruktur
|
||||||
@rm -rf $(CCD_BUILD_DIR)
|
@rm -rf $(CCD_BUILD_DIR)
|
||||||
@# export local svn directory OR just copy the directories (for non-svn users)
|
@# export local svn directory OR just copy the directories (for non-svn users)
|
||||||
@if test -d .svn ;\
|
if test "yes" = "$(IS_SVN)" ;\
|
||||||
then svn export cd-template "$(CCD_BUILD_DIR)" ;\
|
then svn export cd-template "$(CCD_BUILD_DIR)" ;\
|
||||||
else mkdir -p $(dir $(CCD_BUILD_DIR)) ;\
|
else mkdir -p $(dir $(CCD_BUILD_DIR)) ;\
|
||||||
cp -r cd-template $(CCD_BUILD_DIR) ;\
|
cp -r cd-template $(CCD_BUILD_DIR) ;\
|
||||||
|
@ -147,7 +151,7 @@ website: doku kopiere_programme
|
||||||
source: EXPORT_FILE_SUFFIX := _src
|
source: EXPORT_FILE_SUFFIX := _src
|
||||||
source:
|
source:
|
||||||
rm -rf "$(CCD_BUILD_DIR)"
|
rm -rf "$(CCD_BUILD_DIR)"
|
||||||
if test -d .svn ;\
|
@if test "yes" = "$(IS_SVN)" ;\
|
||||||
then mkdir -p "$(dir $(CCD_BUILD_DIR))" ;\
|
then mkdir -p "$(dir $(CCD_BUILD_DIR))" ;\
|
||||||
echo "Exportiere die gewaehlte svn-Revision ($(REVISIONS_NR)) ..." ;\
|
echo "Exportiere die gewaehlte svn-Revision ($(REVISIONS_NR)) ..." ;\
|
||||||
svn export . "$(CCD_BUILD_DIR)" | $(EINRUECKEN) ;\
|
svn export . "$(CCD_BUILD_DIR)" | $(EINRUECKEN) ;\
|
||||||
|
|
Loading…
Reference in a new issue