Changeset 529 for CMT


Ignore:
Timestamp:
Nov 27, 2009, 6:37:16 PM (15 years ago)
Author:
rybkin
Message:

See C.L. 416

Location:
CMT/HEAD
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r528 r529  
     12009-11-27    <rybkin@lal.in2p3.fr> 416
     2
     3        * source/cmt_symbol.cxx: In function Symbol::action, resolve relative
     4        script path without using PACKAGEROOT environment variable in case
     5        SetupRoot strategy is not enabled (no_root), in function Symbol::print, set
     6        cmtsetupstatus shell variable to 1 in case script specified via
     7        setup_script statement exits with non-zero status, similarly, in function
     8        Symbol::print_clean, set cmtcleanupstatus shell variable to 1 in case
     9        script specified via cleanup_script statement exits with non-zero status
     10        * source/cmt_parser.cxx: Make use of cmtsetupstatus, cmtcleanupstatus shell
     11        variables in setup.[c]sh, cleanup.[c]sh scripts in order to exit with a
     12        non-zero status on failure, which takes into account failures of user
     13        provided setup, cleanup scripts
     14       
    1152009-11-25    <rybkin@lal.in2p3.fr> 415
    216
  • CMT/HEAD/source/cmt_parser.cxx

    r528 r529  
    48384838                       Me.m_current_path.c_str ());
    48394839              fprintf (f,
    4840                        "if ( $status == 0 ) then\n"
    4841                        "  source ${tempfile}\n"
    4842                        "  /bin/rm -f ${tempfile}\n"
    4843                        "else\n"
     4840                       "if ( $status != 0 ) then\n"
    48444841                       "  echo \"${CMTROOT}/mgr/cmt cleanup -%s "
    48454842                       "-pack=%s -version=%s -path=%s $* >${tempfile}\"\n"
     4843                       "  set cmtcleanupstatus=2\n"
    48464844                       "  /bin/rm -f ${tempfile}\n"
    4847                        "  false\n"
    4848                        "endif\n",
     4845                       "  exit $cmtcleanupstatus\n"
     4846                       "endif\n"
     4847                       "set cmtcleanupstatus=0\n"
     4848                       "source ${tempfile}\n"
     4849                       "if ( $status != 0 ) then\n"
     4850                       "  set cmtcleanupstatus=2\n"
     4851                       "endif\n"
     4852                       "/bin/rm -f ${tempfile}\n"
     4853                       "exit $cmtcleanupstatus\n",
    48494854                       suffix[i].c_str (),
    48504855                       Me.m_current_package.c_str (),
     
    48674872                       Me.m_current_path.c_str ());
    48684873              fprintf (f,
    4869                        "if test $? = 0 ; then\n"
    4870                        "  . ${tempfile}\n"
    4871                        "  /bin/rm -f ${tempfile}\n"
    4872                        "else\n"
     4874                       "if test $? != 0 ; then\n"
    48734875                       "  echo >&2 \"${CMTROOT}/mgr/cmt cleanup -%s "
    48744876                       "-pack=%s -version=%s -path=%s $* >${tempfile}\"\n"
     4877                       "  cmtcleanupstatus=2\n"
    48754878                       "  /bin/rm -f ${tempfile}\n"
    4876                        "  false\n"
    4877                        "fi\n",
     4879                       "  return $cmtcleanupstatus\n"
     4880                       "fi\n"
     4881                       "cmtcleanupstatus=0\n"
     4882                       ". ${tempfile}\n"
     4883                       "if test $? != 0 ; then\n"
     4884                       "  cmtcleanupstatus=2\n"
     4885                       "fi\n"
     4886                       "/bin/rm -f ${tempfile}\n"
     4887                       "return $cmtcleanupstatus\n",
    48784888                       suffix[i].c_str (),
    48794889                       Me.m_current_package.c_str (),
     
    49884998                       no_cleanup_opt.c_str ());
    49894999              fprintf (f,
    4990                        "if ( $status == 0 ) then\n"
    4991                        "  source ${tempfile}\n"
    4992                        "  /bin/rm -f ${tempfile}\n"
    4993                        "else\n"
     5000                       "if ( $status != 0 ) then\n"
    49945001                       "  echo \"${CMTROOT}/mgr/cmt setup -%s "
    49955002                       "-pack=%s -version=%s -path=%s %s $* >${tempfile}\"\n"
     5003                       "  set cmtsetupstatus=2\n"
    49965004                       "  /bin/rm -f ${tempfile}\n"
    4997                        "  false\n"
    4998                        "endif\n",
     5005                       "  exit $cmtsetupstatus\n"
     5006                       "endif\n"
     5007                       "set cmtsetupstatus=0\n"
     5008                       "source ${tempfile}\n"
     5009                       "if ( $status != 0 ) then\n"
     5010                       "  set cmtsetupstatus=2\n"
     5011                       "endif\n"
     5012                       "/bin/rm -f ${tempfile}\n"
     5013                       "exit $cmtsetupstatus\n",
    49995014                       suffix[i].c_str (),
    50005015                       Me.m_current_package.c_str (),
     
    50265041                       no_cleanup_opt.c_str ());
    50275042              fprintf (f,
    5028                        "if test $? = 0 ; then\n"
    5029                        "  . ${tempfile}\n"
    5030                        "  /bin/rm -f ${tempfile}\n"
    5031                        "else\n"
     5043                       "if test $? != 0 ; then\n"
    50325044                       "  echo >&2 \"${CMTROOT}/mgr/cmt setup -%s "
    50335045                       "-pack=%s -version=%s -path=%s %s $* >${tempfile}\"\n"
     5046                       "  cmtsetupstatus=2\n"
    50345047                       "  /bin/rm -f ${tempfile}\n"
    5035                        "  false\n"
    5036                        "fi\n",
     5048                       "  return $cmtsetupstatus\n"
     5049                       "fi\n"
     5050                       "cmtsetupstatus=0\n"
     5051                       ". ${tempfile}\n"
     5052                       "if test $? != 0 ; then\n"
     5053                       "  cmtsetupstatus=2\n"
     5054                       "fi\n"
     5055                       "/bin/rm -f ${tempfile}\n"
     5056                       "return $cmtsetupstatus\n",
    50375057                       suffix[i].c_str (),
    50385058                       Me.m_current_package.c_str (),
     
    51335153                       Me.m_current_path.c_str ());
    51345154              fprintf (f,
    5135                        "if ( $status == 0 ) then\n"
    5136                        "  source ${tempfile}\n"
     5155                       "if ( $status != 0 ) then\n"
     5156                       "  echo \"${CMTROOT}/mgr/cmt cleanup -%s "
     5157                       "-pack=cmt_standalone -path=%s $* >${tempfile}\"\n"
     5158                       "  set cmtcleanupstatus=2\n"
    51375159                       "  /bin/rm -f ${tempfile}\n"
    5138                        "else\n"
    5139                        "  echo \"${CMTROOT}/mgr/cmt cleanup -%s -pack=cmt_standalone -path=%s $* >${tempfile}\"\n"
    5140                        "  /bin/rm -f ${tempfile}\n"
    5141                        "  false\n"
    5142                        "endif\n",
     5160                       "  exit $cmtcleanupstatus\n"
     5161                       "endif\n"
     5162                       "set cmtcleanupstatus=0\n"
     5163                       "source ${tempfile}\n"
     5164                       "if ( $status != 0 ) then\n"
     5165                       "  set cmtcleanupstatus=2\n"
     5166                       "endif\n"
     5167                       "/bin/rm -f ${tempfile}\n"
     5168                       "exit $cmtcleanupstatus\n",
    51435169                       suffix[i].c_str (),
    51445170                       Me.m_current_path.c_str ());
     
    51565182                       Me.m_current_path.c_str ());
    51575183              fprintf (f,
    5158                        "if test $? = 0 ; then\n"
    5159                        "  . ${tempfile}\n"
     5184                       "if test $? != 0 ; then\n"
     5185                       "  echo >&2 \"${CMTROOT}/mgr/cmt cleanup -%s "
     5186                       "-pack=cmt_standalone -path=%s $* >${tempfile}\"\n"
     5187                       "  cmtcleanupstatus=2\n"
    51605188                       "  /bin/rm -f ${tempfile}\n"
    5161                        "else\n"
    5162                        "  echo >&2 \"${CMTROOT}/mgr/cmt cleanup -%s -pack=cmt_standalone -path=%s $* >${tempfile}\"\n"
    5163                        "  /bin/rm -f ${tempfile}\n"
    5164                        "  false\n"
    5165                        "fi\n",
     5189                       "  return $cmtcleanupstatus\n"
     5190                       "fi\n"
     5191                       "cmtcleanupstatus=0\n"
     5192                       ". ${tempfile}\n"
     5193                       "if test $? != 0 ; then\n"
     5194                       "  cmtcleanupstatus=2\n"
     5195                       "fi\n"
     5196                       "/bin/rm -f ${tempfile}\n"
     5197                       "return $cmtcleanupstatus\n",
    51665198                       suffix[i].c_str (),
    51675199                       Me.m_current_path.c_str ());
     
    52965328                       no_cleanup_opt.c_str ());
    52975329              fprintf (f,
    5298                        "if ( $status == 0 ) then\n"
    5299                        "  source ${tempfile}\n"
     5330                       "if ( $status != 0 ) then\n"
     5331                       "  echo \"${CMTROOT}/mgr/cmt setup -%s "
     5332                       "-pack=cmt_standalone -path=%s %s $* >${tempfile}\"\n"
     5333                       "  set cmtsetupstatus=2\n"
    53005334                       "  /bin/rm -f ${tempfile}\n"
    5301                        "else\n"
    5302                        "  echo \"${CMTROOT}/mgr/cmt setup -%s -pack=cmt_standalone -path=%s %s $* >${tempfile}\"\n"
    5303                        "  /bin/rm -f ${tempfile}\n"
    5304                        "  false\n"
    5305                        "endif\n",
     5335                       "  exit $cmtsetupstatus\n"
     5336                       "endif\n"
     5337                       "set cmtsetupstatus=0\n"
     5338                       "source ${tempfile}\n"
     5339                       "if ( $status != 0 ) then\n"
     5340                       "  set cmtsetupstatus=2\n"
     5341                       "endif\n"
     5342                       "/bin/rm -f ${tempfile}\n"
     5343                       "exit $cmtsetupstatus\n",
    53065344                       suffix[i].c_str (),
    53075345                       Me.m_current_path.c_str (),
     
    53255363                       no_cleanup_opt.c_str ());
    53265364              fprintf (f,
    5327                        "if test $? = 0 ; then\n"
    5328                        "  . ${tempfile}\n"
     5365                       "if test $? != 0 ; then\n"
     5366                       "  echo >&2 \"${CMTROOT}/mgr/cmt setup -%s "
     5367                       "-pack=cmt_standalone -path=%s %s $* >${tempfile}\"\n"
     5368                       "  cmtsetupstatus=2\n"
    53295369                       "  /bin/rm -f ${tempfile}\n"
    5330                        "else\n"
    5331                        "  echo >&2 \"${CMTROOT}/mgr/cmt setup -%s -pack=cmt_standalone -path=%s %s $* >${tempfile}\"\n"
    5332                        "  /bin/rm -f ${tempfile}\n"
    5333                        "  false\n"
    5334                        "fi\n",
     5370                       "  return $cmtsetupstatus\n"
     5371                       "fi\n"
     5372                       "cmtsetupstatus=0\n"
     5373                       ". ${tempfile}\n"
     5374                       "if test $? != 0 ; then\n"
     5375                       "  cmtsetupstatus=2\n"
     5376                       "fi\n"
     5377                       "/bin/rm -f ${tempfile}\n"
     5378                       "return $cmtsetupstatus\n",
    53355379                       suffix[i].c_str (),
    53365380                       Me.m_current_path.c_str (),
  • CMT/HEAD/source/cmt_symbol.cxx

    r467 r529  
    972972          else
    973973            {
     974              if (use->get_strategy ("SetupRoot"))
     975                {
    974976#ifdef WIN32
    975977              full_name = "%";
     
    984986              full_name += "}";
    985987#endif
     988                }
     989              else
     990                {
     991              full_name = use->get_full_path ();
     992                }
    986993              full_name += CmtSystem::file_separator ();
    987994              if (use->style == cmt_style) full_name += "cmt";
     
    16301637          cout << "if ( -f " << name << ".csh ) then" << endl;
    16311638          cout << "  source " << name << ".csh" << endl;
     1639          cout <<
     1640            "if ( $status != 0 ) then\n"
     1641            "    set cmtcleanupstatus=1\n"
     1642            "endif\n";
    16321643          cout << "endif" << endl;
    16331644          result = 1;
     
    16361647          cout << "if test -f " << name << ".sh; then" << endl;
    16371648          cout << "  . " << name << ".sh" << endl;
     1649          cout <<
     1650            "if test $? != 0; then\n"
     1651            "    cmtcleanupstatus=1\n"
     1652            "fi\n";
    16381653          cout << "fi" << endl;
    16391654          result = 1;
     
    17251740                  cout << "if ( -f " << name << ".csh ) then" << endl;
    17261741                  cout << "  source " << name << ".csh" << endl;
     1742                  cout <<
     1743                    "if ( $status != 0 ) then\n"
     1744                    "    set cmtsetupstatus=1\n"
     1745                    "endif\n";
    17271746                  cout << "endif" << endl;
    17281747                  result = 1;
     
    17311750                  cout << "if test -f " << name << ".sh; then" << endl;
    17321751                  cout << "  . " << name << ".sh" << endl;
     1752                  cout <<
     1753                    "if test $? != 0; then\n"
     1754                    "    cmtsetupstatus=1\n"
     1755                    "fi\n";
    17331756                  cout << "fi" << endl;
    17341757                  result = 1;
Note: See TracChangeset for help on using the changeset viewer.