- Timestamp:
- Jan 6, 2012, 3:57:31 PM (12 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r599 r600 1 2012-01-06 <rybkin@lal.in2p3.fr> 477 2 3 * mgr/fragments/packages_header: Allow LOG_SUFFIX to be configured with 4 environment variable, simplify expressions for Package_failure_handler 5 * mgr/fragments/nmake/packages_header: idem 6 * mgr/fragments/package: Introduce use of Package_failure_handler in case 7 NO_ALL_GROUPS is set, for clean, binclean, uninstall, check targets, 8 capture stderr and stdout into log file in case BCAST_CMD is list of 9 commands or compound command, for clean, uninstall, check targets, use 10 simplified Package_failure_handler 11 * mgr/fragments/nmake/package: idem 12 * src/Makefile.header: Add <package>clean target to help message 13 1 14 2011-12-23 <rybkin@lal.in2p3.fr> 476 2 15 -
CMT/HEAD/mgr/fragments/nmake/package
r599 r600 31 31 !endif 32 32 !if "$(NO_ALL_GROUPS)" != "" 33 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(${PACKAGE}OutErr) 34 !else 35 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 36 $(BCAST_CMD) all $(${PACKAGE}OutErr) \ 37 $(Package_failure_handler) 33 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 34 ( $(BCAST_CMD) $(Package_failure_handler) ) \ 35 $(${PACKAGE}OutErr) 36 !else 37 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 38 ( $(BCAST_CMD) all $(Package_failure_handler) ) \ 39 $(${PACKAGE}OutErr) 38 40 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 39 41 for /F "usebackq" %%g in (`$(cmtexe) show groups`) do \ 40 $(silent)( ($(Cmt_actions_handler) \41 $(BCAST_CMD) %%g $(${PACKAGE}OutErr))\42 $(Package_failure_handler))42 $(silent)( $(Cmt_actions_handler) \ 43 ( $(BCAST_CMD) %%g $(Package_failure_handler) ) ) \ 44 $(${PACKAGE}OutErr) 43 45 !endif 44 46 !else … … 54 56 !endif 55 57 !if "$(NO_ALL_GROUPS)" != "" 56 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(${PACKAGE}OutErr) 57 !else 58 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 59 $(BCAST_CMD) all $(${PACKAGE}OutErr) \ 60 $(Package_failure_handler) 58 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 59 ( $(BCAST_CMD) $(Package_failure_handler) ) \ 60 $(${PACKAGE}OutErr) 61 !else 62 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 63 ( $(BCAST_CMD) all $(Package_failure_handler) ) \ 64 $(${PACKAGE}OutErr) 61 65 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 62 66 for /F "usebackq" %%g in (`$(cmtexe) show groups`) do \ 63 $(silent)( ($(Cmt_actions_handler) \64 $(BCAST_CMD) %%g $(${PACKAGE}OutErr))\65 $(Package_failure_handler))67 $(silent)( $(Cmt_actions_handler) \ 68 ( $(BCAST_CMD) %%g $(Package_failure_handler) ) ) \ 69 $(${PACKAGE}OutErr) 66 70 !endif 67 71 !else … … 96 100 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \ 97 101 && echo "#--------------------------------------------------------------" 98 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) clean 99 !else 100 !if "$(BCAST_GLOBAL)" != "" 101 @echo "#--------------------------------------------------------------" \ 102 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \ 103 && echo "#--------------------------------------------------------------" 104 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) clean 102 !if "$(LOG_LOCATION)" != "" 103 @( echo "#--------------------------------------------------------------" \ 104 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \ 105 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 106 !endif 107 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 108 ( $(BCAST_CMD) clean $(Package_failure_handler) ) \ 109 $(${PACKAGE}OutErr) 110 !else 111 !if "$(BCAST_GLOBAL)" != "" 112 @echo "#--------------------------------------------------------------" \ 113 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \ 114 && echo "#--------------------------------------------------------------" 115 !if "$(LOG_LOCATION)" != "" 116 @( echo "#--------------------------------------------------------------" \ 117 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \ 118 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 119 !endif 120 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 121 ( $(BCAST_CMD) clean $(Package_failure_handler) ) \ 122 $(${PACKAGE}OutErr) 105 123 !else 106 124 … … 113 131 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \ 114 132 && echo "#--------------------------------------------------------------" 115 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) binclean 116 !else 117 !if "$(BCAST_GLOBAL)" != "" 118 @echo "#--------------------------------------------------------------" \ 119 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \ 120 && echo "#--------------------------------------------------------------" 121 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) binclean 133 !if "$(LOG_LOCATION)" != "" 134 @( echo "#--------------------------------------------------------------" \ 135 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \ 136 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 137 !endif 138 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 139 ( $(BCAST_CMD) binclean $(Package_failure_handler) ) \ 140 $(${PACKAGE}OutErr) 141 !else 142 !if "$(BCAST_GLOBAL)" != "" 143 @echo "#--------------------------------------------------------------" \ 144 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \ 145 && echo "#--------------------------------------------------------------" 146 !if "$(LOG_LOCATION)" != "" 147 @( echo "#--------------------------------------------------------------" \ 148 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \ 149 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 150 !endif 151 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 152 ( $(BCAST_CMD) binclean $(Package_failure_handler) ) \ 153 $(${PACKAGE}OutErr) 122 154 !else 123 155 … … 130 162 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \ 131 163 && echo "#--------------------------------------------------------------" 132 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) uninstall 133 !else 134 !if "$(BCAST_GLOBAL)" != "" 135 @echo "#--------------------------------------------------------------" \ 136 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \ 137 && echo "#--------------------------------------------------------------" 138 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) uninstall 164 !if "$(LOG_LOCATION)" != "" 165 @( echo "#--------------------------------------------------------------" \ 166 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \ 167 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 168 !endif 169 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 170 ( $(BCAST_CMD) uninstall $(Package_failure_handler) ) \ 171 $(${PACKAGE}OutErr) 172 !else 173 !if "$(BCAST_GLOBAL)" != "" 174 @echo "#--------------------------------------------------------------" \ 175 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \ 176 && echo "#--------------------------------------------------------------" 177 !if "$(LOG_LOCATION)" != "" 178 @( echo "#--------------------------------------------------------------" \ 179 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \ 180 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 181 !endif 182 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 183 ( $(BCAST_CMD) uninstall $(Package_failure_handler) ) \ 184 $(${PACKAGE}OutErr) 139 185 !else 140 186 … … 147 193 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \ 148 194 && echo "#--------------------------------------------------------------" 149 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) check 150 !else 151 !if "$(BCAST_GLOBAL)" != "" 152 @echo "#--------------------------------------------------------------" \ 153 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \ 154 && echo "#--------------------------------------------------------------" 155 $(silent) cd /d $(${PACKAGE}MgrPath) && $(BCAST_CMD) check 195 !if "$(LOG_LOCATION)" != "" 196 @( echo "#--------------------------------------------------------------" \ 197 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \ 198 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 199 !endif 200 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 201 ( $(BCAST_CMD) check $(Package_failure_handler) ) \ 202 $(${PACKAGE}OutErr) 203 !else 204 !if "$(BCAST_GLOBAL)" != "" 205 @echo "#--------------------------------------------------------------" \ 206 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \ 207 && echo "#--------------------------------------------------------------" 208 !if "$(LOG_LOCATION)" != "" 209 @( echo "#--------------------------------------------------------------" \ 210 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \ 211 && echo "#--------------------------------------------------------------" ) $(${PACKAGE}OutErr) 212 !endif 213 $(silent) cd /d $(${PACKAGE}MgrPath) && \ 214 ( $(BCAST_CMD) check $(Package_failure_handler) ) \ 215 $(${PACKAGE}OutErr) 156 216 !else 157 217 -
CMT/HEAD/mgr/fragments/nmake/packages_header
r599 r600 9 9 10 10 !if "$(LOG_LOCATION)" != "" 11 !if "$(LOG_SUFFIX)" == "" 11 12 LOG_SUFFIX = .log 13 !endif 12 14 !endif 13 15 … … 26 28 # (may result in duplicated errors within a package) 27 29 # Unix version taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt (Modified) 28 Package_failure_handler = & if errorlevel 1 exit 130 Package_failure_handler = || exit 29 31 !if "$(PACKAGE_FAILURE_POLICY)" != "" 30 32 !if "$(PACKAGE_FAILURE_POLICY)" == "stop" 31 Package_failure_handler = & if errorlevel 1 exit 133 Package_failure_handler = || exit 32 34 !else if "$(PACKAGE_FAILURE_POLICY)" == "skip" 33 Package_failure_handler = & if errorlevel 1exit 035 Package_failure_handler = || exit 0 34 36 !else if "$(PACKAGE_FAILURE_POLICY)" == "ignore" 35 Package_failure_handler = & (if errorlevel 1 type nul > nul)37 Package_failure_handler = || type nul > nul 36 38 !else 37 39 !error "Unknown PACKAGE_FAILURE_POLICY $(PACKAGE_FAILURE_POLICY). Allowed values: stop (default), skip, ignore" -
CMT/HEAD/mgr/fragments/package
r599 r600 31 31 endif 32 32 ifdef NO_ALL_GROUPS 33 +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(${PACKAGE}OutErr) 33 +$(silent) cd $(${PACKAGE}MgrPath) && \ 34 { $(BCAST_CMD) $(Package_failure_handler); } \ 35 $(${PACKAGE}OutErr) 34 36 else 35 37 +$(silent) cd $(${PACKAGE}MgrPath) && \ 36 38 for group in all $$($(cmtexe) show groups); do \ 37 39 $(Cmt_actions_handler) \ 38 $(BCAST_CMD) $$group $(${PACKAGE}OutErr); BUILD_RESULT=$$? ; \ 39 $(Package_failure_handler) \ 40 done 40 $(BCAST_CMD) $$group $(Package_failure_handler) ; \ 41 done $(${PACKAGE}OutErr) 41 42 endif 42 43 else … … 52 53 endif 53 54 ifdef NO_ALL_GROUPS 54 +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(${PACKAGE}OutErr) 55 +$(silent) cd $(${PACKAGE}MgrPath) && \ 56 { $(BCAST_CMD) $(Package_failure_handler); } \ 57 $(${PACKAGE}OutErr) 55 58 else 56 59 +$(silent) cd $(${PACKAGE}MgrPath) && \ 57 60 for group in all $$($(cmtexe) show groups); do \ 58 61 $(Cmt_actions_handler) \ 59 $(BCAST_CMD) $$group $(${PACKAGE}OutErr); BUILD_RESULT=$$? ; \ 60 $(Package_failure_handler) \ 61 done 62 $(BCAST_CMD) $$group $(Package_failure_handler) ; \ 63 done $(${PACKAGE}OutErr) 62 64 endif 63 65 else … … 92 94 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \ 93 95 && echo "#--------------------------------------------------------------" 94 +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@) 96 ifdef LOG_LOCATION 97 @{ echo "#--------------------------------------------------------------" \ 98 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \ 99 && echo "#--------------------------------------------------------------"; } $(${PACKAGE}OutErr) 100 endif 101 +$(silent) cd $(${PACKAGE}MgrPath) && \ 102 { $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@) $(Package_failure_handler); } \ 103 $(${PACKAGE}OutErr) 95 104 else 96 105 ifdef BCAST_GLOBAL … … 98 107 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \ 99 108 && echo "#--------------------------------------------------------------" 100 +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@) 109 ifdef LOG_LOCATION 110 @{ echo "#--------------------------------------------------------------" \ 111 && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \ 112 && echo "#--------------------------------------------------------------"; } $(${PACKAGE}OutErr) 113 endif 114 +$(silent) cd $(${PACKAGE}MgrPath) && \ 115 { $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@) $(Package_failure_handler); } \ 116 $(${PACKAGE}OutErr) 101 117 else 102 118 -
CMT/HEAD/mgr/fragments/packages_header
r599 r600 24 24 25 25 ifdef LOG_LOCATION 26 ifndef LOG_SUFFIX 26 27 LOG_SUFFIX = .log 28 endif 27 29 endif 28 30 … … 41 43 # (may result in duplicated errors within a package) 42 44 # Taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt (Modified) 43 Package_failure_handler = test $$BUILD_RESULT -eq 0 || exit $$BUILD_RESULT ;45 Package_failure_handler = || exit 44 46 ifdef PACKAGE_FAILURE_POLICY 45 47 ifeq ($(PACKAGE_FAILURE_POLICY),stop) 46 Package_failure_handler = test $$BUILD_RESULT -eq 0 || exit $$BUILD_RESULT ;48 Package_failure_handler = || exit 47 49 else 48 50 ifeq ($(PACKAGE_FAILURE_POLICY),skip) 49 Package_failure_handler = test $$BUILD_RESULT -eq 0 || break ;51 Package_failure_handler = || exit 0 50 52 else 51 53 ifeq ($(PACKAGE_FAILURE_POLICY),ignore) 52 Package_failure_handler = test $$BUILD_RESULT -eq 0 || : ;54 Package_failure_handler = || : 53 55 else 54 56 $(error Unknown PACKAGE_FAILURE_POLICY "$(PACKAGE_FAILURE_POLICY)". Allowed values: "stop" (default), "skip", "ignore") -
CMT/HEAD/src/Makefile.header
r595 r600 205 205 echo "$${u}binclean : fast erase of binary directory in package $${u}"; \ 206 206 echo "$${u}uninstall : remove everything installed in the installation area from package $${u}"; \ 207 echo "$${u}check : run all applications defined with the -check option in package $${u}"; \ 207 208 done 208 209 else … … 214 215 echo "$${u}binclean : fast erase of binary directory in package $${u}"; \ 215 216 echo "$${u}uninstall : remove everything installed in the installation area from package $${u}"; \ 217 echo "$${u}check : run all applications defined with the -check option in package $${u}"; \ 216 218 done 217 219 endif
Note: See TracChangeset
for help on using the changeset viewer.