Changeset 600 for CMT


Ignore:
Timestamp:
Jan 6, 2012, 3:57:31 PM (12 years ago)
Author:
rybkin
Message:

See C.L. 477

Location:
CMT/HEAD
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r599 r600  
     12012-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       
    1142011-12-23    <rybkin@lal.in2p3.fr> 476
    215
  • CMT/HEAD/mgr/fragments/nmake/package

    r599 r600  
    3131!endif
    3232!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)
    3840        $(silent) cd /d $(${PACKAGE}MgrPath) && \
    3941          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)
    4345!endif
    4446!else
     
    5456!endif
    5557!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)
    6165        $(silent) cd /d $(${PACKAGE}MgrPath) && \
    6266          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)
    6670!endif
    6771!else
     
    96100          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) clean] in $(${PACKAGE}MgrPath)" \
    97101          && 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)
    105123!else
    106124       
     
    113131          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) binclean] in $(${PACKAGE}MgrPath)" \
    114132          && 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)
    122154!else
    123155       
     
    130162          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) uninstall] in $(${PACKAGE}MgrPath)" \
    131163          && 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)
    139185!else
    140186       
     
    147193          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) check] in $(${PACKAGE}MgrPath)" \
    148194          && 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)
    156216!else
    157217       
  • CMT/HEAD/mgr/fragments/nmake/packages_header

    r599 r600  
    99
    1010!if "$(LOG_LOCATION)" != ""
     11!if "$(LOG_SUFFIX)" == ""
    1112LOG_SUFFIX = .log
     13!endif
    1214!endif
    1315
     
    2628#            (may result in duplicated errors within a package)
    2729# Unix version taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt (Modified)
    28 Package_failure_handler = & if errorlevel 1 exit 1
     30Package_failure_handler = || exit
    2931!if "$(PACKAGE_FAILURE_POLICY)" != ""
    3032!if "$(PACKAGE_FAILURE_POLICY)" == "stop"
    31 Package_failure_handler = & if errorlevel 1 exit 1
     33Package_failure_handler = || exit
    3234!else if "$(PACKAGE_FAILURE_POLICY)" == "skip"
    33 Package_failure_handler = & if errorlevel 1 exit 0
     35Package_failure_handler = || exit 0
    3436!else if "$(PACKAGE_FAILURE_POLICY)" == "ignore"
    35 Package_failure_handler = & (if errorlevel 1 type nul > nul)
     37Package_failure_handler = || type nul > nul
    3638!else
    3739!error "Unknown PACKAGE_FAILURE_POLICY $(PACKAGE_FAILURE_POLICY). Allowed values: stop (default), skip, ignore"
  • CMT/HEAD/mgr/fragments/package

    r599 r600  
    3131endif
    3232ifdef 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)
    3436else
    3537        +$(silent) cd $(${PACKAGE}MgrPath) && \
    3638          for group in all $$($(cmtexe) show groups); do \
    3739            $(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)
    4142endif
    4243else
     
    5253endif
    5354ifdef 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)
    5558else
    5659        +$(silent) cd $(${PACKAGE}MgrPath) && \
    5760          for group in all $$($(cmtexe) show groups); do \
    5861            $(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)
    6264endif
    6365else
     
    9294          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
    9395          && echo "#--------------------------------------------------------------"
    94         +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)
     96ifdef LOG_LOCATION
     97        @{ echo "#--------------------------------------------------------------" \
     98          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
     99          && echo "#--------------------------------------------------------------"; } $(${PACKAGE}OutErr)
     100endif
     101        +$(silent) cd $(${PACKAGE}MgrPath) && \
     102          { $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@) $(Package_failure_handler); } \
     103          $(${PACKAGE}OutErr)
    95104else
    96105ifdef BCAST_GLOBAL
     
    98107          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
    99108          && echo "#--------------------------------------------------------------"
    100         +$(silent) cd $(${PACKAGE}MgrPath) && $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)
     109ifdef LOG_LOCATION
     110        @{ echo "#--------------------------------------------------------------" \
     111          && echo "# ${PACKAGE} $(${PACKAGEPREFIX}VERSION) $(${PACKAGE}_offset): Now trying [$(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@)] in $(${PACKAGE}MgrPath)" \
     112          && echo "#--------------------------------------------------------------"; } $(${PACKAGE}OutErr)
     113endif
     114        +$(silent) cd $(${PACKAGE}MgrPath) && \
     115          { $(BCAST_CMD) $(patsubst ${PACKAGE}%,%,$@) $(Package_failure_handler); } \
     116          $(${PACKAGE}OutErr)
    101117else
    102118       
  • CMT/HEAD/mgr/fragments/packages_header

    r599 r600  
    2424
    2525ifdef LOG_LOCATION
     26ifndef LOG_SUFFIX
    2627LOG_SUFFIX = .log
     28endif
    2729endif
    2830
     
    4143#            (may result in duplicated errors within a package)
    4244# 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 ;
     45Package_failure_handler = || exit
    4446ifdef PACKAGE_FAILURE_POLICY
    4547ifeq ($(PACKAGE_FAILURE_POLICY),stop)
    46 Package_failure_handler = test $$BUILD_RESULT -eq 0 || exit $$BUILD_RESULT ;
     48Package_failure_handler = || exit
    4749else
    4850ifeq ($(PACKAGE_FAILURE_POLICY),skip)
    49 Package_failure_handler = test $$BUILD_RESULT -eq 0 || break ;
     51Package_failure_handler = || exit 0
    5052else
    5153ifeq ($(PACKAGE_FAILURE_POLICY),ignore)
    52 Package_failure_handler = test $$BUILD_RESULT -eq 0 || : ;
     54Package_failure_handler = || :
    5355else
    5456$(error Unknown PACKAGE_FAILURE_POLICY "$(PACKAGE_FAILURE_POLICY)". Allowed values: "stop" (default), "skip", "ignore")
  • CMT/HEAD/src/Makefile.header

    r595 r600  
    205205            echo "$${u}binclean : fast erase of binary directory in package $${u}"; \
    206206            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}"; \
    207208          done
    208209else
     
    214215            echo "$${u}binclean : fast erase of binary directory in package $${u}"; \
    215216            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}"; \
    216218          done
    217219endif
Note: See TracChangeset for help on using the changeset viewer.