improve svn detection

This commit is contained in:
lars 2007-08-15 16:38:30 +00:00
parent 2cf438eb4f
commit 46ef594184

View file

@ -1,7 +1,11 @@
########## Variablendefinitionen ###########
# ist subversion verfuegbar?
IS_SVN := $(shell test -d .svn && which svn && echo "yes")
# 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)
# Verzeichnisse
@ -17,7 +21,7 @@ EXPORT_FILE = $(EXPORT_DIR)/$(EXPORT_PREFIX)$(REVISIONS_SUFFIX)$(EXPORT_FILE_SUF
# Zwischenlagerung
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
# Verzeichnisse, die notfalls erstellt werden muessen
@ -99,7 +103,7 @@ $(CREATE_DIRS):
cd-template: verzeichnisstruktur
@rm -rf $(CCD_BUILD_DIR)
@# 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)" ;\
else mkdir -p $(dir $(CCD_BUILD_DIR)) ;\
cp -r cd-template $(CCD_BUILD_DIR) ;\
@ -147,7 +151,7 @@ website: doku kopiere_programme
source: EXPORT_FILE_SUFFIX := _src
source:
rm -rf "$(CCD_BUILD_DIR)"
if test -d .svn ;\
@if test "yes" = "$(IS_SVN)" ;\
then mkdir -p "$(dir $(CCD_BUILD_DIR))" ;\
echo "Exportiere die gewaehlte svn-Revision ($(REVISIONS_NR)) ..." ;\
svn export . "$(CCD_BUILD_DIR)" | $(EINRUECKEN) ;\