diff options
author | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2008-02-03 16:59:58 +0000 |
---|---|---|
committer | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2008-02-03 16:59:58 +0000 |
commit | e4a5e014618e687a43146c45f07999948421e6d3 (patch) | |
tree | 7228e35944de96628d72522e895ef9cbd7da8af4 | |
parent | 47f1bb06f9305d95563b705fe346bd24763a915c (diff) |
Add Cactus directory to source id instead of user name to make it
unique within a machine
git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@150 83718e91-0e4f-0410-abf4-91180603181f
-rw-r--r-- | src/id.cc | 13 | ||||
-rw-r--r-- | src/id.hh | 4 | ||||
-rw-r--r-- | src/make.configuration.deps | 32 |
3 files changed, 36 insertions, 13 deletions
@@ -42,6 +42,9 @@ namespace Formaline + // Configuration ID + extern "C" char const config_id[]; + // Unique source ID extern "C" char const source_id[]; @@ -50,6 +53,15 @@ namespace Formaline + // Get the configuration id + char const * + get_config_id (cGH const * const cctkGH) + { + return config_id; + } + + + // Get the unique source id char const * get_source_id (cGH const * const cctkGH) @@ -214,6 +226,7 @@ namespace Formaline extern "C" int Formaline_PrintIDs () { + CCTK_VInfo (CCTK_THORNSTRING, "Configuration id: %s", get_config_id (0)); CCTK_VInfo (CCTK_THORNSTRING, "Source id: %s", get_source_id (0)); CCTK_VInfo (CCTK_THORNSTRING, "Build id: %s", get_build_id (0)); CCTK_VInfo (CCTK_THORNSTRING, "Simulation id: %s", get_simulation_id (0)); @@ -6,6 +6,10 @@ namespace Formaline { + // Get the configuration id + char const * + get_config_id (cGH const * const cctkGH); + // Get the unique source id char const * get_source_id (cGH const * const cctkGH); diff --git a/src/make.configuration.deps b/src/make.configuration.deps index d1657fe..51eb4a1 100644 --- a/src/make.configuration.deps +++ b/src/make.configuration.deps @@ -60,13 +60,16 @@ $(FRM-LIB): $(FRM-OBJS) .PHONY: $(TOP)/BUILD-ID .PRECIOUS: $(TOP)/BUILD-ID $(TOP)/BUILD-ID: $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)$(CCTK_LIBNAME_PREFIX)Formaline$(LIBNAME_SUFFIX) - config=`echo "$(EXE:cactus_%=%)" | $(TR_C) -d '[:alnum:]+-._]'`; \ - hostname=`$(TARBALL_DIR)/gethostname.pl`; \ - user="$$USER"; \ - timestamp=`date -u +%Y.%m.%d-%H.%M.%S`; \ - pid="$$$$"; \ - id="build-$$config-$$hostname-$$user-$$timestamp-$$pid"; \ - echo "$$id" > $@ + config=`echo "$(EXE:cactus_%=%)" | $(TR_C) -d '[:alnum:]+-._]'` && \ + hostname=`$(TARBALL_DIR)/gethostname.pl` && \ + user="$$USER" && \ + dirname=`echo "$(subst /,-,$(CCTK_HOME:/%=%))" | $(TR_C) -d '[:alnum:]+-._]'` && \ + timestamp=`date -u +%Y.%m.%d-%H.%M.%S` && \ + pid="$$$$" && \ + build_id="build-$$config-$$hostname-$$user-$$timestamp-$$pid" && \ + echo "$$build_id" > $@ && \ + config_id="config-$$config-$$hostname-$$dirname" && \ + echo "$$config_id" > $(TOP)/CONFIG-ID @@ -77,11 +80,13 @@ $(TARBALL_DIR)/build-id.o: $(TARBALL_DIR)/build-id.c .PRECIOUS: $(TARBALL_DIR)/build-id.c $(TARBALL_DIR)/build-id.c: $(TOP)/BUILD-ID $(TOP)/GIT-COMMIT-ID { \ - echo '/* This is an auto-generated file -- do not edit */'; \ - build_id="$$(cat $(TOP)/BUILD-ID)"; \ - echo 'char const build_id[] = "'$$build_id'";'; \ - git_commit_id="$$(cat $(TOP)/GIT-COMMIT-ID)"; \ - echo 'char const source_id[] = "git-'$$git_commit_id'";'; \ + echo '/* This is an auto-generated file -- do not edit */' && \ + build_id="$$(cat $(TOP)/BUILD-ID)" && \ + echo 'char const build_id[] = "'$$build_id'";' && \ + git_commit_id="$$(cat $(TOP)/GIT-COMMIT-ID)" && \ + echo 'char const source_id[] = "git-'$$git_commit_id'";' && \ + config_id="$$(cat $(TOP)/CONFIG-ID)" && \ + echo 'char const config_id[] = "'config_id'";'; \ } > $@ @@ -298,7 +303,8 @@ $(TOP)/GIT-COMMIT-ID: $(TOP)/BUILD-ID $(TARBALL_DIR)/cactus-flesh-source.files $ cp $@ $(CCTK_HOME)/GIT-COMMIT-IDS/$$(cat $@) && \ echo "Formaline: Git commit id is $$(cat $@)" && \ true "Update branch" && \ - $(GIT) branch -f $(EXE:cactus_%=%) $$(cat $@) && \ + config_id=$$(cat $(TOP)/CONFIG-ID) && \ + $(GIT) branch -f $$config_id $$(cat $@) && \ echo "Formaline: Cleaning up git repository..." && \ $(GIT) rm --cached -r . > /dev/null 2>&1 || true; \ true "Call git-gc for good measure" && \ |