- Timestamp:
- Aug 25, 2010, 12:12:14 PM (14 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r552 r553 1 2010-08-25 <rybkin@lal.in2p3.fr> 438 2 3 * source/cmt_parser.cxx: In class Cmt, in functions install_setup_scripts, 4 install_cleanup_scripts, install_test_setup_scripts, 5 install_test_cleanup_scripts, dos_script_prefix, ensure that in 6 setup/cleanup scripts, shell variable name holding temporary file name 7 - with script contents - contains package name, so as to avoid name clashes 8 in case user provided scripts invoke CMT generated setup/cleanup scripts 9 from other packages (which lead to temporary file not being cleaned up). 10 In functions do_config, do_relocate, do not use functions 11 install_test_setup_scripts, install_test_cleanup_scripts for standalone 12 package, use install_setup_scripts, install_cleanup_scripts instead as for 13 standard packages 14 1 15 2010-08-24 <rybkin@lal.in2p3.fr> 437 2 16 -
CMT/HEAD/source/cmt_parser.cxx
r550 r553 2803 2803 } 2804 2804 2805 install_test_setup_scripts (); 2806 install_test_cleanup_scripts (); 2805 install_setup_scripts (); 2806 install_cleanup_scripts (); 2807 //install_test_setup_scripts (); 2808 //install_test_cleanup_scripts (); 2807 2809 2808 2810 Generator::build_default_makefile (); … … 2986 2988 cout << "------------------------------------------" << endl; 2987 2989 } 2988 install_test_setup_scripts (); 2989 install_test_cleanup_scripts (); 2990 install_setup_scripts (); 2991 install_cleanup_scripts (); 2992 //install_test_setup_scripts (); 2993 //install_test_cleanup_scripts (); 2990 2994 2991 2995 Generator::build_default_makefile (); … … 5143 5147 const cmt_string& cmt_root, 5144 5148 const cmt_string& package, 5149 const cmt_string& mangled_package, 5145 5150 const cmt_string& version, 5146 5151 const cmt_string& path, … … 5176 5181 fprintf (f, "if NOT DEFINED CMTROOT set CMTROOT=%s& set PATH=%%CMTROOT%%\\%%CMTBIN%%;%%PATH%%& set CMTBIN=VisualC& if not defined CMTCONFIG set CMTCONFIG=%%CMTBIN%%\n", cmt_root.c_str ()); 5177 5182 fprintf (f, "\n"); 5178 fprintf (f, "set cmt tempfile=\"%%TEMP%%\\tmpsetup.bat\"\n");5183 fprintf (f, "set cmt%stempfile=\"%%TEMP%%\\cmt%stempfile.bat\"\n", mangled_package.c_str (), mangled_package.c_str ()); 5179 5184 fprintf (f, "%%CMTROOT%%\\%%CMTBIN%%\\cmt.exe %s -bat " 5180 5185 " -pack=%s -version=%s -path=\"%%~d0%%~p0%s\" " 5181 5186 " %s " 5182 "%%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 >%%cmt tempfile%%\n",5187 "%%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 >%%cmt%stempfile%%\n", 5183 5188 action.c_str (), 5184 5189 package.c_str (), 5185 5190 version.c_str (), 5186 5191 no_device.c_str (), 5187 option.c_str ()); 5188 fprintf (f, "if exist %%cmttempfile%% call %%cmttempfile%%\n"); 5189 fprintf (f, "if exist %%cmttempfile%% del %%cmttempfile%%\n"); 5190 fprintf (f, "set cmttempfile=\n"); 5192 option.c_str (), mangled_package.c_str ()); 5193 fprintf (f, "if exist %%cmt%stempfile%% call %%cmt%stempfile%%\n", mangled_package.c_str (), mangled_package.c_str ()); 5194 fprintf (f, "if exist %%cmt%stempfile%% del %%cmt%stempfile%%\n", mangled_package.c_str (), mangled_package.c_str ()); 5195 fprintf (f, "set cmt%stempfile=\n", mangled_package.c_str ()); 5196 } 5197 5198 //---------------------------------------------------------- 5199 // Mangle text so that it consists solely of 5200 // letters, numbers, and underscores 5201 // (any other characters are replaced with X). 5202 // Then text, prefixed with a letter or underscore, 5203 // can be used as shell variable name 5204 //---------------------------------------------------------- 5205 static cmt_string mangle (const cmt_string& text) 5206 { 5207 cmt_string result; 5208 int allocated = text.size (); 5209 char* const buffer = (char*) malloc (allocated + 1); 5210 char* b (buffer); 5211 const char* t = text.c_str (); 5212 while (*t) 5213 { 5214 if (isalnum (*t) || *t == '_') 5215 *b++ = *t++; 5216 else 5217 { 5218 *b++ = 'X'; t++; 5219 } 5220 } 5221 *b = '\0'; 5222 result = buffer; 5223 free (buffer); 5224 return result; 5191 5225 } 5192 5226 … … 5231 5265 cmt_string version = Me.m_current_version; 5232 5266 if (version == "v*") version = ""; 5267 cmt_string mangled_package = mangle (Me.m_current_package); 5233 5268 5234 5269 for (i = 0; i < modes; i++) … … 5249 5284 fprintf (f, "endif\n"); 5250 5285 fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n"); 5251 fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n");5252 fprintf (f, "if $status != 0 then\n set tempfile=/tmp/cmt.$$\nendif\n");5286 fprintf (f, "set cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5287 fprintf (f, "if $status != 0 then\n set cmt%stempfile=/tmp/cmt.$$\nendif\n", mangled_package.c_str ()); 5253 5288 fprintf (f, "${CMTROOT}/mgr/cmt cleanup -%s " 5254 "-pack=%s -version=%s -path=%s $* >${ tempfile}\n",5289 "-pack=%s -version=%s -path=%s $* >${cmt%stempfile}\n", 5255 5290 suffix[i].c_str (), 5256 5291 Me.m_current_package.c_str (), 5257 5292 version.c_str (), 5258 Me.m_current_path.c_str () );5293 Me.m_current_path.c_str (), mangled_package.c_str ()); 5259 5294 fprintf (f, 5260 5295 "if ( $status != 0 ) then\n" 5261 5296 " echo \"${CMTROOT}/mgr/cmt cleanup -%s " 5262 "-pack=%s -version=%s -path=%s $* >${ tempfile}\"\n"5297 "-pack=%s -version=%s -path=%s $* >${cmt%stempfile}\"\n" 5263 5298 " set cmtcleanupstatus=2\n" 5264 " /bin/rm -f ${tempfile}\n" 5299 " /bin/rm -f ${cmt%stempfile}\n" 5300 " unset cmt%stempfile\n" 5265 5301 " exit $cmtcleanupstatus\n" 5266 5302 "endif\n" 5267 5303 "set cmtcleanupstatus=0\n" 5268 "source ${ tempfile}\n"5304 "source ${cmt%stempfile}\n" 5269 5305 "if ( $status != 0 ) then\n" 5270 5306 " set cmtcleanupstatus=2\n" 5271 5307 "endif\n" 5272 "/bin/rm -f ${tempfile}\n" 5308 "/bin/rm -f ${cmt%stempfile}\n" 5309 "unset cmt%stempfile\n" 5273 5310 "exit $cmtcleanupstatus\n", 5274 5311 suffix[i].c_str (), 5275 5312 Me.m_current_package.c_str (), 5276 5313 version.c_str (), 5277 Me.m_current_path.c_str () );5314 Me.m_current_path.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5278 5315 } 5279 5316 else if (mode[i] == Sh) … … 5283 5320 fprintf (f, "fi\n"); 5284 5321 fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n"); 5285 fprintf (f, " tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n");5286 fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n");5322 fprintf (f, "cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5323 fprintf (f, "if test ! $? = 0 ; then cmt%stempfile=/tmp/cmt.$$; fi\n", mangled_package.c_str ()); 5287 5324 fprintf (f, "${CMTROOT}/mgr/cmt cleanup -%s " 5288 "-pack=%s -version=%s -path=%s $* >${ tempfile}\n",5325 "-pack=%s -version=%s -path=%s $* >${cmt%stempfile}\n", 5289 5326 suffix[i].c_str (), 5290 5327 Me.m_current_package.c_str (), 5291 5328 version.c_str (), 5292 Me.m_current_path.c_str () );5329 Me.m_current_path.c_str (), mangled_package.c_str ()); 5293 5330 fprintf (f, 5294 5331 "if test $? != 0 ; then\n" 5295 5332 " echo >&2 \"${CMTROOT}/mgr/cmt cleanup -%s " 5296 "-pack=%s -version=%s -path=%s $* >${ tempfile}\"\n"5333 "-pack=%s -version=%s -path=%s $* >${cmt%stempfile}\"\n" 5297 5334 " cmtcleanupstatus=2\n" 5298 " /bin/rm -f ${tempfile}\n" 5335 " /bin/rm -f ${cmt%stempfile}\n" 5336 " unset cmt%stempfile\n" 5299 5337 " return $cmtcleanupstatus\n" 5300 5338 "fi\n" 5301 5339 "cmtcleanupstatus=0\n" 5302 ". ${ tempfile}\n"5340 ". ${cmt%stempfile}\n" 5303 5341 "if test $? != 0 ; then\n" 5304 5342 " cmtcleanupstatus=2\n" 5305 5343 "fi\n" 5306 "/bin/rm -f ${tempfile}\n" 5344 "/bin/rm -f ${cmt%stempfile}\n" 5345 "unset cmt%stempfile\n" 5307 5346 "return $cmtcleanupstatus\n", 5308 5347 suffix[i].c_str (), 5309 5348 Me.m_current_package.c_str (), 5310 5349 version.c_str (), 5311 Me.m_current_path.c_str () );5350 Me.m_current_path.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5312 5351 } 5313 5352 else if (mode[i] == Bat) 5314 5353 { 5315 5354 dos_script_prefix (f, Me.m_cmt_root, 5316 Me.m_current_package, version, Me.m_current_path,5355 Me.m_current_package, mangled_package, version, Me.m_current_path, 5317 5356 "cleanup"); 5318 5357 } … … 5383 5422 cmt_string version = Me.m_current_version; 5384 5423 if (version == "v*") version = ""; 5424 cmt_string mangled_package = mangle (Me.m_current_package); 5385 5425 5386 5426 for (i = 0; i < modes; i++) … … 5407 5447 fprintf (f, "endif\n"); 5408 5448 fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n"); 5409 fprintf (f, "\n"); 5410 fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n"); 5411 fprintf (f, "if $status != 0 then\n set tempfile=/tmp/cmt.$$\nendif\n"); 5449 fprintf (f, "set cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5450 fprintf (f, "if $status != 0 then\n set cmt%stempfile=/tmp/cmt.$$\nendif\n", mangled_package.c_str ()); 5412 5451 fprintf (f, "${CMTROOT}/mgr/cmt setup -%s " 5413 "-pack=%s -version=%s -path=%s %s $* >${ tempfile}\n",5452 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\n", 5414 5453 suffix[i].c_str (), 5415 5454 Me.m_current_package.c_str (), 5416 5455 version.c_str (), 5417 5456 Me.m_current_path.c_str (), 5418 no_cleanup_opt.c_str () );5457 no_cleanup_opt.c_str (), mangled_package.c_str ()); 5419 5458 fprintf (f, 5420 5459 "if ( $status != 0 ) then\n" 5421 5460 " echo \"${CMTROOT}/mgr/cmt setup -%s " 5422 "-pack=%s -version=%s -path=%s %s $* >${ tempfile}\"\n"5461 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\"\n" 5423 5462 " set cmtsetupstatus=2\n" 5424 " /bin/rm -f ${tempfile}\n" 5463 " /bin/rm -f ${cmt%stempfile}\n" 5464 " unset cmt%stempfile\n" 5425 5465 " exit $cmtsetupstatus\n" 5426 5466 "endif\n" 5427 5467 "set cmtsetupstatus=0\n" 5428 "source ${ tempfile}\n"5468 "source ${cmt%stempfile}\n" 5429 5469 "if ( $status != 0 ) then\n" 5430 5470 " set cmtsetupstatus=2\n" 5431 5471 "endif\n" 5432 "/bin/rm -f ${tempfile}\n" 5472 "/bin/rm -f ${cmt%stempfile}\n" 5473 "unset cmt%stempfile\n" 5433 5474 "exit $cmtsetupstatus\n", 5434 5475 suffix[i].c_str (), … … 5436 5477 version.c_str (), 5437 5478 Me.m_current_path.c_str (), 5438 no_cleanup_opt.c_str () );5479 no_cleanup_opt.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5439 5480 } 5440 5481 else if (mode[i] == Sh) … … 5450 5491 fprintf (f, "fi\n"); 5451 5492 fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n"); 5452 fprintf (f, "\n"); 5453 fprintf (f, "tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n"); 5454 fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n"); 5493 fprintf (f, "cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5494 fprintf (f, "if test ! $? = 0 ; then cmt%stempfile=/tmp/cmt.$$; fi\n", mangled_package.c_str ()); 5455 5495 fprintf (f, "${CMTROOT}/mgr/cmt setup -%s " 5456 "-pack=%s -version=%s -path=%s %s $* >${ tempfile}\n",5496 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\n", 5457 5497 suffix[i].c_str (), 5458 5498 Me.m_current_package.c_str (), 5459 5499 version.c_str (), 5460 5500 Me.m_current_path.c_str (), 5461 no_cleanup_opt.c_str () );5501 no_cleanup_opt.c_str (), mangled_package.c_str ()); 5462 5502 fprintf (f, 5463 5503 "if test $? != 0 ; then\n" 5464 5504 " echo >&2 \"${CMTROOT}/mgr/cmt setup -%s " 5465 "-pack=%s -version=%s -path=%s %s $* >${ tempfile}\"\n"5505 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\"\n" 5466 5506 " cmtsetupstatus=2\n" 5467 " /bin/rm -f ${tempfile}\n" 5507 " /bin/rm -f ${cmt%stempfile}\n" 5508 " unset cmt%stempfile\n" 5468 5509 " return $cmtsetupstatus\n" 5469 5510 "fi\n" 5470 5511 "cmtsetupstatus=0\n" 5471 ". ${ tempfile}\n"5512 ". ${cmt%stempfile}\n" 5472 5513 "if test $? != 0 ; then\n" 5473 5514 " cmtsetupstatus=2\n" 5474 5515 "fi\n" 5475 "/bin/rm -f ${tempfile}\n" 5516 "/bin/rm -f ${cmt%stempfile}\n" 5517 "unset cmt%stempfile\n" 5476 5518 "return $cmtsetupstatus\n", 5477 5519 suffix[i].c_str (), … … 5479 5521 version.c_str (), 5480 5522 Me.m_current_path.c_str (), 5481 no_cleanup_opt.c_str () );5523 no_cleanup_opt.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5482 5524 } 5483 5525 else if (mode[i] == Bat) … … 5487 5529 version.c_str ()); 5488 5530 dos_script_prefix (f, Me.m_cmt_root, 5489 Me.m_current_package, version, Me.m_current_path,5531 Me.m_current_package, mangled_package, version, Me.m_current_path, 5490 5532 "setup", no_cleanup_opt); 5491 5533 } … … 5549 5591 cmt_string version = Me.m_current_version; 5550 5592 if (version == "v*") version = ""; 5593 cmt_string mangled_package = mangle (Me.m_current_package); 5551 5594 5552 5595 for (i = 0; i < modes; i++) … … 5567 5610 fprintf (f, "endif\n"); 5568 5611 fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n"); 5569 fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n");5570 fprintf (f, "if $status != 0 then\n set tempfile=/tmp/cmt.$$\nendif\n");5571 fprintf (f, "${CMTROOT}/mgr/cmt cleanup -%s -pack=cmt_standalone -path=%s $* >${ tempfile}\n",5612 fprintf (f, "set cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5613 fprintf (f, "if $status != 0 then\n set cmt%stempfile=/tmp/cmt.$$\nendif\n", mangled_package.c_str ()); 5614 fprintf (f, "${CMTROOT}/mgr/cmt cleanup -%s -pack=cmt_standalone -path=%s $* >${cmt%stempfile}\n", 5572 5615 suffix[i].c_str (), 5573 Me.m_current_path.c_str () );5616 Me.m_current_path.c_str (), mangled_package.c_str ()); 5574 5617 fprintf (f, 5575 5618 "if ( $status != 0 ) then\n" 5576 5619 " echo \"${CMTROOT}/mgr/cmt cleanup -%s " 5577 "-pack=cmt_standalone -path=%s $* >${ tempfile}\"\n"5620 "-pack=cmt_standalone -path=%s $* >${cmt%stempfile}\"\n" 5578 5621 " set cmtcleanupstatus=2\n" 5579 " /bin/rm -f ${tempfile}\n" 5622 " /bin/rm -f ${cmt%stempfile}\n" 5623 " unset cmt%stempfile\n" 5580 5624 " exit $cmtcleanupstatus\n" 5581 5625 "endif\n" 5582 5626 "set cmtcleanupstatus=0\n" 5583 "source ${ tempfile}\n"5627 "source ${cmt%stempfile}\n" 5584 5628 "if ( $status != 0 ) then\n" 5585 5629 " set cmtcleanupstatus=2\n" 5586 5630 "endif\n" 5587 "/bin/rm -f ${tempfile}\n" 5631 "/bin/rm -f ${cmt%stempfile}\n" 5632 "unset cmt%stempfile\n" 5588 5633 "exit $cmtcleanupstatus\n", 5589 5634 suffix[i].c_str (), 5590 Me.m_current_path.c_str () );5635 Me.m_current_path.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5591 5636 } 5592 5637 else if (mode[i] == Sh) … … 5596 5641 fprintf (f, "fi\n"); 5597 5642 fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n"); 5598 fprintf (f, " tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n");5599 fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n");5600 fprintf (f, "${CMTROOT}/mgr/cmt cleanup -%s -pack=cmt_standalone -path=%s $* >${ tempfile}\n",5643 fprintf (f, "cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5644 fprintf (f, "if test ! $? = 0 ; then cmt%stempfile=/tmp/cmt.$$; fi\n", mangled_package.c_str ()); 5645 fprintf (f, "${CMTROOT}/mgr/cmt cleanup -%s -pack=cmt_standalone -path=%s $* >${cmt%stempfile}\n", 5601 5646 suffix[i].c_str (), 5602 Me.m_current_path.c_str () );5647 Me.m_current_path.c_str (), mangled_package.c_str ()); 5603 5648 fprintf (f, 5604 5649 "if test $? != 0 ; then\n" 5605 5650 " echo >&2 \"${CMTROOT}/mgr/cmt cleanup -%s " 5606 "-pack=cmt_standalone -path=%s $* >${ tempfile}\"\n"5651 "-pack=cmt_standalone -path=%s $* >${cmt%stempfile}\"\n" 5607 5652 " cmtcleanupstatus=2\n" 5608 " /bin/rm -f ${tempfile}\n" 5653 " /bin/rm -f ${cmt%stempfile}\n" 5654 " unset cmt%stempfile\n" 5609 5655 " return $cmtcleanupstatus\n" 5610 5656 "fi\n" 5611 5657 "cmtcleanupstatus=0\n" 5612 ". ${ tempfile}\n"5658 ". ${cmt%stempfile}\n" 5613 5659 "if test $? != 0 ; then\n" 5614 5660 " cmtcleanupstatus=2\n" 5615 5661 "fi\n" 5616 "/bin/rm -f ${tempfile}\n" 5662 "/bin/rm -f ${cmt%stempfile}\n" 5663 "unset cmt%stempfile\n" 5617 5664 "return $cmtcleanupstatus\n", 5618 5665 suffix[i].c_str (), 5619 Me.m_current_path.c_str () );5666 Me.m_current_path.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5620 5667 } 5621 else 5668 else if (mode[i] == Bat) 5622 5669 { 5623 5670 dos_script_prefix (f, Me.m_cmt_root, 5624 "cmt_standalone", " ", Me.m_current_path,5671 "cmt_standalone", "cmt_standalone", "", Me.m_current_path, 5625 5672 "cleanup"); 5626 5673 } … … 5721 5768 int i; 5722 5769 5770 cmt_string version = Me.m_current_version; 5771 if (version == "v*") version = ""; 5772 cmt_string mangled_package = mangle (Me.m_current_package); 5773 5723 5774 for (i = 0; i < modes; i++) 5724 5775 { … … 5741 5792 fprintf (f, "endif\n"); 5742 5793 fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n"); 5743 fprintf (f, "set tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n");5744 fprintf (f, "if $status != 0 then\n set tempfile=/tmp/cmt.$$\nendif\n");5745 fprintf (f, "${CMTROOT}/mgr/cmt setup -%s -pack=cmt_standalone -path=%s %s $* >${ tempfile}\n",5794 fprintf (f, "set cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5795 fprintf (f, "if $status != 0 then\n set cmt%stempfile=/tmp/cmt.$$\nendif\n", mangled_package.c_str ()); 5796 fprintf (f, "${CMTROOT}/mgr/cmt setup -%s -pack=cmt_standalone -path=%s %s $* >${cmt%stempfile}\n", 5746 5797 suffix[i].c_str (), 5747 5798 Me.m_current_path.c_str (), 5748 no_cleanup_opt.c_str () );5799 no_cleanup_opt.c_str (), mangled_package.c_str ()); 5749 5800 fprintf (f, 5750 5801 "if ( $status != 0 ) then\n" 5751 5802 " echo \"${CMTROOT}/mgr/cmt setup -%s " 5752 "-pack=cmt_standalone -path=%s %s $* >${ tempfile}\"\n"5803 "-pack=cmt_standalone -path=%s %s $* >${cmt%stempfile}\"\n" 5753 5804 " set cmtsetupstatus=2\n" 5754 " /bin/rm -f ${tempfile}\n" 5805 " /bin/rm -f ${cmt%stempfile}\n" 5806 " unset cmt%stempfile\n" 5755 5807 " exit $cmtsetupstatus\n" 5756 5808 "endif\n" 5757 5809 "set cmtsetupstatus=0\n" 5758 "source ${ tempfile}\n"5810 "source ${cmt%stempfile}\n" 5759 5811 "if ( $status != 0 ) then\n" 5760 5812 " set cmtsetupstatus=2\n" 5761 5813 "endif\n" 5762 "/bin/rm -f ${tempfile}\n" 5814 "/bin/rm -f ${cmt%stempfile}\n" 5815 "unset cmt%stempfile\n" 5763 5816 "exit $cmtsetupstatus\n", 5764 5817 suffix[i].c_str (), 5765 5818 Me.m_current_path.c_str (), 5766 no_cleanup_opt.c_str () );5819 no_cleanup_opt.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5767 5820 } 5768 5821 else if (mode[i] == Sh) … … 5775 5828 fprintf (f, "fi\n"); 5776 5829 fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n"); 5777 fprintf (f, "\n"); 5778 fprintf (f, "tempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n"); 5779 fprintf (f, "if test ! $? = 0 ; then tempfile=/tmp/cmt.$$; fi\n"); 5780 fprintf (f, "${CMTROOT}/mgr/cmt setup -%s -pack=cmt_standalone -path=%s %s $* >${tempfile}\n", 5830 fprintf (f, "cmt%stempfile=`${CMTROOT}/mgr/cmt -quiet build temporary_name`\n", mangled_package.c_str ()); 5831 fprintf (f, "if test ! $? = 0 ; then cmt%stempfile=/tmp/cmt.$$; fi\n", mangled_package.c_str ()); 5832 fprintf (f, "${CMTROOT}/mgr/cmt setup -%s -pack=cmt_standalone -path=%s %s $* >${cmt%stempfile}\n", 5781 5833 suffix[i].c_str (), 5782 5834 Me.m_current_path.c_str (), 5783 no_cleanup_opt.c_str () );5835 no_cleanup_opt.c_str (), mangled_package.c_str ()); 5784 5836 fprintf (f, 5785 5837 "if test $? != 0 ; then\n" 5786 5838 " echo >&2 \"${CMTROOT}/mgr/cmt setup -%s " 5787 "-pack=cmt_standalone -path=%s %s $* >${ tempfile}\"\n"5839 "-pack=cmt_standalone -path=%s %s $* >${cmt%stempfile}\"\n" 5788 5840 " cmtsetupstatus=2\n" 5789 " /bin/rm -f ${tempfile}\n" 5841 " /bin/rm -f ${cmt%stempfile}\n" 5842 " unset cmt%stempfile\n" 5790 5843 " return $cmtsetupstatus\n" 5791 5844 "fi\n" 5792 5845 "cmtsetupstatus=0\n" 5793 ". ${ tempfile}\n"5846 ". ${cmt%stempfile}\n" 5794 5847 "if test $? != 0 ; then\n" 5795 5848 " cmtsetupstatus=2\n" 5796 5849 "fi\n" 5797 "/bin/rm -f ${tempfile}\n" 5850 "/bin/rm -f ${cmt%stempfile}\n" 5851 "unset cmt%stempfile\n" 5798 5852 "return $cmtsetupstatus\n", 5799 5853 suffix[i].c_str (), 5800 5854 Me.m_current_path.c_str (), 5801 no_cleanup_opt.c_str () );5855 no_cleanup_opt.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str (), mangled_package.c_str ()); 5802 5856 } 5803 else 5857 else if (mode[i] == Bat) 5804 5858 { 5805 5859 fprintf (f, "rem Setting standalone package\n"); 5806 5860 dos_script_prefix (f, Me.m_cmt_root, 5807 "cmt_standalone", " ", Me.m_current_path,5861 "cmt_standalone", "cmt_standalone", "", Me.m_current_path, 5808 5862 "setup", no_cleanup_opt); 5809 5863 }
Note: See TracChangeset
for help on using the changeset viewer.