Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

817 lines
19 KiB

  1. @rem = '--*-Perl-*--
  2. @echo off
  3. if "%OS%" == "Windows_NT" goto WinNT
  4. perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. goto endofperl
  6. :WinNT
  7. perl -x -S "%0" %*
  8. if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
  9. if %errorlevel% == 9009 echo You do not have Perl in your PATH.
  10. goto endofperl
  11. @rem ';
  12. #!perl
  13. #line 14
  14. #
  15. # fusionsd.bat (Perl)
  16. #
  17. # a collection of source depot related utilities, mainly
  18. # involving the mainentance and building of a private branch
  19. #
  20. # example usages:
  21. # fusionsd $parentBranch='lab01_n' ; $branch='lab01_fusion' ; Integrate()
  22. # does some of the integration steps, and prints out what is left to be done manually
  23. # fusionsd $parentBranch='lab01_n' ; $branch='lab01_fusion' ; QueryIntegrate()
  24. # reports information as to when publics were last checked in and what build they correspond to
  25. # fusionsd LikePopulate(); # not implemented
  26. # fusionsd LikePopulatePlusSymbols(); # not implemented
  27. # fusionsd ReverseIntegrate(); # not implemented
  28. #
  29. # Integrate should be able to determine the branches from its environment, that
  30. # code is working, just not hooked up to Integrate.
  31. #
  32. # April 2001 Jay Krell (JayKrell)
  33. #
  34. #use strict;
  35. use English;
  36. @procs = qw(ia64 x86);
  37. @chkfres = qw(chk fre);
  38. sub CleanPath
  39. {
  40. #
  41. # a general ambiguously named function
  42. # for now removes .\ from the start, \. from the end and converts \.\ to \ in between
  43. # and lowercases, just in case
  44. #
  45. my($x) = ($ARG[0]);
  46. my($y) = (MakeLower($x));
  47. $y =~ s/\\\.$//;
  48. $y =~ s/\\\.\\/\\/g;
  49. $y =~ s/^.\\//;
  50. #Log('CleanPath(' . $x . ') is ' . $y);
  51. return $y;
  52. }
  53. sub TrimSpace
  54. {
  55. #
  56. # remove whitespace from start and end of a string
  57. #
  58. my($x) = ($ARG[0]);
  59. $x =~ s/^\s+//;
  60. $x =~ s/\s+$//;
  61. return $x;
  62. }
  63. sub NormalizeSpace
  64. {
  65. #
  66. # remove whitespace from start and end of a string
  67. # convert all whitespace (tab, newline, etc.) to space
  68. # convert runs of spaces to single spaces
  69. #
  70. my($x) = ($ARG[0]);
  71. $x =~ s/\s/ /g;
  72. $x =~ s/^ +//;
  73. $x =~ s/ +$//;
  74. $x =~ s/ +/ /;
  75. return $x;
  76. }
  77. sub JoinPaths
  78. {
  79. #
  80. # given an array of strings, put a path seperator between them
  81. #
  82. my($result) = join('\\', @ARG);
  83. $result = CleanPath($result);
  84. #Log('JoinPaths() is ' . $result);
  85. return $result;
  86. }
  87. #
  88. # not really used currently, but might be
  89. #
  90. %KnownSdVariables =
  91. (
  92. #
  93. # stuff in sd.map/sd.ini that are not names of projects
  94. #
  95. 'branch' => 1,
  96. 'client' => 1,
  97. 'codebase' => 1,
  98. 'codebasetype' => 1,
  99. 'depots' => 1,
  100. );
  101. #
  102. # unused -- comments later, it does not appear to be worth
  103. # making this distinction. We can derive branch graph from sd.
  104. #
  105. #%PublicBranches =
  106. #(
  107. # 'lab01_n' => '1',
  108. # 'lab02_n' => '1',
  109. # 'lab03_n' => '1',
  110. # 'lab04_n' => '1',
  111. # 'lab05_n' => '1',
  112. # 'lab06_n' => '1',
  113. # 'lab07_n' => '1',
  114. # 'lab08_n' => '1',
  115. # 'lab09_n' => '1',
  116. #);
  117. #
  118. # unused -- might be useful for Integrate, maybe only for
  119. # sanity checking. We have the data in "mixed" enlistments which
  120. # project is in which branch, but we don't use it.
  121. #
  122. # sdx integrate gives a nice quick error, so we may get by with doing nothing
  123. # (UNDONE: need to sync the other projects correctly)
  124. #
  125. #%ImportantProjectsForBranch =
  126. #(
  127. # 'lab01_n' => ( 'root' , 'base' ),
  128. #);
  129. $sdxroot = $ENV{'SDXROOT'};
  130. #
  131. # not used, see next (next)
  132. #
  133. # map private branch to parent public branch
  134. #
  135. #%PrivateBranches=
  136. #{
  137. # 'lab01_fusion' => 'lab01_n'
  138. #};
  139. #
  140. # not used, see next
  141. #
  142. #sub IsPublicBranch
  143. #{
  144. # my ($x) = ($ARG[0]);
  145. #
  146. # return $PublicBranches{$x};
  147. #}
  148. #
  149. # not used -- such an exact distinction is not worth making
  150. # instead, you can find a branch's parent, and you know if a branch
  151. # has an associated set of build machines.
  152. #
  153. #sub IsPrivateBranch
  154. #{
  155. # my ($x) = ($ARG[0]);
  156. # my($y);
  157. #
  158. # $y = $PrivateBranches{$x};
  159. # if ($y)
  160. # {
  161. # return $y;
  162. # }
  163. #
  164. # #
  165. # # we could look for 'private' in the name, but then how do we map to its parent?
  166. # #
  167. # return 0;
  168. #}
  169. #
  170. # unused -- we can determine this dynamically
  171. #
  172. #sub PublicParentOfPrivateBranch
  173. #{
  174. # my ($x) = ($ARG[0]);
  175. # my($y);
  176. #
  177. # $y = $PrivateBranches{$x};
  178. # return $y;
  179. #}
  180. sub MakeLower
  181. {
  182. my($x) = ($ARG[0]);
  183. $x =~ tr/A-Z/a-z/;
  184. return $x;
  185. }
  186. sub MakeUpper
  187. {
  188. my($x) = ($ARG[0]);
  189. $x =~ tr/a-z/A-Z/;
  190. return $x;
  191. }
  192. sub MakeTitlecase
  193. {
  194. my($x) = ($ARG[0]);
  195. $x = MakeUpper(substr($x, 0, 1)) . MakeLower(substr($x, 1));
  196. return $x;
  197. }
  198. sub SdxRoot { return $ENV{'SDXROOT'}; }
  199. sub SdMapPath { return JoinPaths(SdxRoot(),'sd.map'); }
  200. sub Log
  201. {
  202. my($x) = ($ARG[0]);
  203. $x =~ s/[ \t\n]+$//; # get rid of trailing whitespace, including new lines
  204. print('REM FusionSd.bat ' . $x . $endl);
  205. }
  206. sub Suggest
  207. {
  208. #
  209. # Tell the user to run a command.
  210. #
  211. my($x) = ($ARG[0]);
  212. $x =~ s/[ \t\n]+$//; # get rid of trailing whitespace, including new lines
  213. print('' . $x . $endl);
  214. }
  215. sub Error
  216. {
  217. my($x) = ($ARG[0]);
  218. $x =~ s/[ \t\n]+$//; # get rid of trailing whitespace, including new lines
  219. print('NMAKE : U1234 : FusionSd.bat ' . $x . $endl);
  220. }
  221. sub ErrorExit
  222. {
  223. my($x) = ($ARG[0]);
  224. Error($x);
  225. exit(-1);
  226. }
  227. sub ReadSdMap
  228. {
  229. my($sdmapFileHandle);
  230. if ($SdMap)
  231. {
  232. return;
  233. }
  234. open(sdmapFileHandle, '< ' . SdMapPath()) || Error('Unable to open ' . SdMapPath());
  235. #
  236. # the file is a bunch of
  237. # name = string
  238. # with some blank lines and # comments
  239. #
  240. # any line with a =, make the assignment happen in the $SdMap{} hashtable
  241. #
  242. while (<sdmapFileHandle>)
  243. {
  244. s/^ +//g;
  245. s/ +$//g;
  246. s/ +/ /g;
  247. if (!/^#/ && /(\w+) *= *(.+)/)
  248. {
  249. $SdMap{MakeLower($1)} = MakeLower($2);
  250. }
  251. }
  252. foreach (sort(keys(SdMap)))
  253. {
  254. if (!$KnownSdVariables{$ARG})
  255. {
  256. $Projects{$ARG} = $SdMap{$ARG};
  257. }
  258. else
  259. {
  260. Log(' ' . $ARG . ' = ' . $SdMap{$ARG});
  261. }
  262. }
  263. Log('enlisted in projects: ' . join(' ' , sort(keys(Projects))));
  264. foreach (sort(keys(Projects)))
  265. {
  266. Log(' project ' . $ARG . ' is at ' . JoinPaths(SdxRoot(), $Projects{$ARG}));
  267. }
  268. }
  269. sub GetBranch
  270. {
  271. my($x) = ($ARG[0]);
  272. my($y);
  273. $x = NormalizeSpace(MakeLower($x));
  274. $y = $x;
  275. #Log($y);
  276. $y =~ s/^\/\/depot\///i;
  277. #Log($y);
  278. $y =~ s/^\/?private\///i;
  279. #Log($y);
  280. $y =~ s/\/.+//i;
  281. #Log($y);
  282. #Log('GetBranch(' . $x . ') is ' . $y);
  283. return $y;
  284. }
  285. #
  286. # UNDONE This works. Integrate should use it.
  287. #
  288. sub GetParentBranch
  289. {
  290. my($project, $branchName) = ($ARG[0], $ARG[1]);
  291. my($cmd) = ' sd branch -o ' . $branchName;
  292. open(sdbranch, $cmd . ' | ') || Error('Unable to run ' . $cmd);
  293. Log($cmd);
  294. #Log(' project is ' . $project);
  295. while (<sdbranch>)
  296. {
  297. if (/^ *View: *$/)
  298. {
  299. return GetBranch(<sdbranch>);
  300. }
  301. }
  302. }
  303. #
  304. # UNDONE LikePopulate will use this
  305. #
  306. sub ReadBuildMachines
  307. {
  308. my($filepath) = JoinPaths(SdxRoot(), 'tools', 'buildmachines.txt');
  309. }
  310. #
  311. # UNDONE This works. Integrate should use it.
  312. #
  313. sub ReadClient
  314. {
  315. my($function) = 'ReadClient';
  316. my($sdclientName);
  317. my($sdinipath);
  318. my($project);
  319. my($sdmapRoot);
  320. my($sdclientRoot);
  321. #
  322. # UNDONE ping the depots
  323. #
  324. #
  325. # read in all the sd.ini files, make sure each
  326. # contains one and only one SDCLIENT=foo line.
  327. #
  328. foreach $project (sort(keys(Projects)))
  329. {
  330. $sdinipath = JoinPaths(SdxRoot(), $Projects{$project}, $sd_ini);
  331. open(sdini, '< ' . $sdinipath) || Error('Unable to open ' . $sdinipath);
  332. $sdclientName = '';
  333. while (<sdini>)
  334. {
  335. if (/^ *SDCLIENT *= *(.+)$/)
  336. {
  337. if ($Projects{$project}{'SDCLIENT'})
  338. {
  339. Error('Multiple SDCLIENTS in ' . $sdinipath);
  340. ErrorExit($function);
  341. }
  342. $sdclientName = $1;
  343. $Projects{$project}{'SDCLIENT'} = $sdclientName;
  344. }
  345. }
  346. if (!$sdclientName)
  347. {
  348. Error('SDCLIENT not found ' . $sdinipath);
  349. ErrorExit($function);
  350. }
  351. }
  352. #
  353. # check that project is using the same client (not sure we really care anymore)
  354. #
  355. foreach $project (sort(keys(Projects)))
  356. {
  357. if ($sdclientName ne $Projects{$project}{'SDCLIENT'})
  358. {
  359. Error('SDCLIENT is ' . $sdclientName);
  360. Error('SDCLIENT(' . $project . ') is ' . $Projects{$project}{'SDCLIENT'});
  361. Error('SDCLIENT not the same across all projects');
  362. ErrorExit($function);
  363. }
  364. }
  365. foreach $project (sort(keys(Projects)))
  366. {
  367. my($sdmapRoot) = JoinPaths(SdxRoot(), $Projects{$project});
  368. my($sdclientRoot);
  369. my($sdclientView);
  370. my($sdclientViewLocal);
  371. my($sdclientViewDepot);
  372. my($sdclientCommand);
  373. my($branch);
  374. my($parentBranch);
  375. chdir($sdmapRoot);
  376. Log('cd /d ' . $sdmapRoot);
  377. #$sdclientCommand = 'sd client -o ' . $sdclientName;
  378. $sdclientCommand = 'sd client -o ';
  379. open(sdclient, $sdclientCommand . ' | ');
  380. Log(' SDCLIENT is ' . $sdclientName);
  381. while (<sdclient>)
  382. {
  383. #Log;
  384. #
  385. # verify that the root is what we expect
  386. #
  387. if (/^ *Root: *(.+)$/)
  388. {
  389. $sdclientRoot = TrimSpace($1);
  390. Log(' sdmapRoot is ' . $sdmapRoot);
  391. Log(' sdclientRoot is ' . $sdclientRoot);
  392. if ($sdclientRoot ne JoinPaths(SdxRoot(), $Projects{$project}))
  393. {
  394. Error('sd.map and sd client roots do not agree (' . $sdmapRoot . ', ' . $sdclientRoot . ')');
  395. ErrorExit($function);
  396. }
  397. }
  398. #
  399. # and get the view
  400. #
  401. if (/^ *View: *$/)
  402. {
  403. $branch = GetBranch(<sdclient>);
  404. #Log(' branch is ' . $branch);
  405. $Projects{'branch'} = $branch;
  406. Log(' ' . $project . ' in ' . $branch . ' branch ');
  407. }
  408. }
  409. if (!$branch)
  410. {
  411. ErrorExit('branch not detected');
  412. }
  413. if ($branch eq 'main')
  414. {
  415. $parentBranch = 'main';
  416. }
  417. else
  418. {
  419. $parentBranch = GetParentBranch($project, $branch);
  420. }
  421. if (!$parentBranch)
  422. {
  423. ErrorExit('parentBranch not detected');
  424. }
  425. Log(' parent of ' . $branch . ' is ' . $parentBranch);
  426. #
  427. # enumerate all branches
  428. #
  429. open(sdbranches, 'sd branches | ');
  430. while (<sdbranches>)
  431. {
  432. $Projects{$project}{'branches'}{MakeLower((split(/ /))[1])} = 1;
  433. }
  434. $Projects{$project}{'branches'}{'main'} = 1; # this doesn't show up, and we do not care
  435. if (!$Projects{$project}{'branches'}{$branch})
  436. {
  437. ErrorExit('detected branch is ' . $branch . ' but it is not listed in sd branches ');
  438. }
  439. if (!$Projects{$project}{'branches'}{$parentBranch})
  440. {
  441. ErrorExit('detected parentBranch is ' . $parentBranch . ' but it is not listed in sd branches ');
  442. }
  443. $Projects{$project}{'parentBranch'} = $parentBranch;
  444. }
  445. }
  446. sub IsEnlistmentClean
  447. {
  448. my($cmd) = 'sdx opened';
  449. my($okFiles) = 0;
  450. my($opened) = 0;
  451. Log('START ' . $cmd);
  452. open(x, $cmd . ' | ') || ErrorExit('Unable to run ' . $cmd);
  453. while (<x>)
  454. {
  455. Log($ARG);
  456. if (/^\/\/depot/)
  457. {
  458. if (/[\\\/]([^\\\/]+\.bat)#\d+ - [^\\\/]+/)
  459. {
  460. $okFiles += 1;
  461. Log('opened tool ' . $1 . ' ok');
  462. }
  463. }
  464. elsif (/Open for .+:\s+(\d+)/)
  465. {
  466. }
  467. elsif (/Total:\s+(\d+)/)
  468. {
  469. $opened = $1;
  470. }
  471. }
  472. Log('END ' . $cmd);
  473. return (($opened - $okFiles) == 0);
  474. }
  475. sub TimeToRevision
  476. {
  477. my($y,$mon,$d,$h,$min,$sec) = (@ARG);
  478. my($s);
  479. #
  480. #Change 52625 on 2001/04/22 09:52:42 by NTDEV\ntvbl01@ROBSVBL4 'Public Changes for 010421-2000 '
  481. # => @yyyy/mm/dd:hh:mm:ss
  482. #
  483. $s = sprintf("@%04d/%02d/%02d:%02d:%02d:%02d", $y, $mon, $d, $h, $min, $sec);
  484. #Log('TimeToRevision is ' . $s);
  485. return $s;
  486. }
  487. sub TimeToInteger
  488. {
  489. #
  490. # This might be useful if 1) we need to compare dates, and 2) if it works, like if the numbers
  491. # produced don't overflow. We are unlikely to need second or even minute resolution.
  492. #
  493. my($y,$mon,$d,$h,$min,$s) = (@ARG);
  494. #Log('TimeToInteger year: ' . $y );
  495. #Log('TimeToInteger mont: ' . $mon );
  496. #Log('TimeToInteger date: ' . $d );
  497. #Log('TimeToInteger hour: ' . $h );
  498. #Log('TimeToInteger minu: ' . $min );
  499. #Log('TimeToInteger seco: ' . $s );
  500. $y -= 2000;
  501. #my ($i) = ($s + (60 * ($min + (60 * ($h + (24 * ($d + (31 * ($mon + (12 * $y))))))))));
  502. my ($i) = ($min + (60 * ($h + (24 * ($d + (31 * ($mon + (12 * $y))))))));
  503. #my ($i) = ($h + (24 * ($d + (31 * ($mon + (12 * $y))))));
  504. #Log('TimeToInteger() : ' . $i);
  505. return $i;
  506. }
  507. sub TimeFromSdChangeLine
  508. {
  509. #
  510. #Change 52625 on 2001/04/22 09:52:42 by NTDEV\ntvbl01@ROBSVBL4 'Public Changes for 010421-2000 '
  511. # ^^^^^^^^^^^^^^^^^^^
  512. my($x) = ($ARG[0]);
  513. #Log('TimeFromSdChangeLine x: ' . $x );
  514. my($y,$mon,$d,$h,$min,$s) = ($x =~ /^\s*Change\s+\d+\s+on\s+(\d+)\/(\d+)\/(\d+)\s+(\d+):(\d+):(\d+)\s+.+/i);
  515. #Log('TimeFromSdChangeLine year: ' . $y );
  516. #Log('TimeFromSdChangeLine mont: ' . $mon );
  517. #Log('TimeFromSdChangeLine date: ' . $d );
  518. #Log('TimeFromSdChangeLine hour: ' . $h );
  519. #Log('TimeFromSdChangeLine minu: ' . $min );
  520. #Log('TimeFromSdChangeLine seco: ' . $s );
  521. return ($y,$mon,$d,$h,$min,$s);
  522. }
  523. sub SdSyncCommandFromPublicChangeLine
  524. {
  525. }
  526. sub TimePartOfReleaseDirectoryNameFromSdChangeLine
  527. {
  528. #
  529. #Change 52625 on 2001/04/22 09:52:42 by NTDEV\ntvbl01@ROBSVBL4 'Public Changes for 010421-2000 '
  530. # ^^^^^^^^^^^
  531. my($x) = ($ARG[0]);
  532. my($y) = ($x);
  533. $y =~ s/'//g;
  534. $y = NormalizeSpace($y);
  535. ($y) = ($y =~ / ([0-9-]+)$/);
  536. #Log('TimePartOfReleaseDirectoryNameFromSdChangeLine(' . $x . ') => ' . $y);
  537. #Log('TimePartOfReleaseDirectoryNameFromSdChangeLine() => ' . $y);
  538. return $y;
  539. }
  540. sub GetLastPublicChangeLine
  541. {
  542. my($branch) = ($ARG[0]);
  543. my($cmd) = ' sd changes -m 1 //depot/' . $branch . '/root/public/... ';
  544. chdir(JoinPaths(SdxRoot(), 'public'));
  545. open(sdchange, $cmd . ' | ') || ErrorExit('Unable to run ' . $cmd);
  546. Log($cmd);
  547. my($x);
  548. my($y);
  549. $x = <sdchange>;
  550. Log($x);
  551. while ($y = <sdchange>)
  552. {
  553. Log($y);
  554. }
  555. $x = NormalizeSpace($x);
  556. Log('LastPublicChangeLine : ' . $x);
  557. return $x;
  558. }
  559. sub LikePopulatePlusSymbols
  560. {
  561. }
  562. sub LikePopulate
  563. {
  564. }
  565. sub RevertPublic
  566. {
  567. my($outline);
  568. chdir(JoinPaths(SdxRoot(), 'public')) || ErrorExit('unable to chdir public');
  569. Log('cd /d %sdxroot%\public');
  570. my($cmd) = 'sd revert ...';
  571. open(out, $cmd . ' 2>&1 | ') || ErrorExit('Unable to run ' . $cmd . $!);
  572. Log($cmd);
  573. while ($outline = <out>)
  574. {
  575. Log($outline);
  576. }
  577. return 1;
  578. }
  579. sub Pause
  580. {
  581. print('****************************************************************************' . $endl);
  582. print('*********** Press a key to continue. ******************' . $endl);
  583. print('*********** control-break maybe to abort (not control-c). ******************' . $endl);
  584. print('****************************************************************************' . $endl);
  585. my($cmd) = $ENV{'COMSPEC'} . ' /c pause ';
  586. open(x, $cmd . ' | ') || ErrorExit('Unable to run ' . $cmd);
  587. while (<x>)
  588. {
  589. }
  590. return 1;
  591. }
  592. sub IntegrateRun
  593. {
  594. my($cmd) = ($ARG[0]);
  595. Log('START ' . $cmd);
  596. Pause() || ErrorExit('aborted');
  597. open(out, $cmd . ' | ') || ErrorExit('Unable to run ' . $cmd);
  598. while (<out>)
  599. {
  600. print;
  601. }
  602. Log('END ' . $cmd);
  603. }
  604. sub IntegrateDoNotRun
  605. {
  606. my($cmd) = ($ARG[0]);
  607. Log($cmd);
  608. }
  609. sub GenericIntegrate
  610. {
  611. my($run) = ($ARG[0]);
  612. my($cmd);
  613. Log('START Integrate');
  614. RevertPublic() || ErrorExit('unable to RevertPublic');
  615. IsEnlistmentClean() || ErrorExit('enlistment is not clean');
  616. chdir(SdxRoot()) || ErrorExit('unable to chdir root');
  617. chdir(JoinPaths(SdxRoot(), 'public')) || ErrorExit('unable to chdir public');
  618. Log('cd /d %sdxroot%');
  619. my($lastPublicChange) = GetLastPublicChangeLine($parentBranch);
  620. my($releaseTimeName) = TimePartOfReleaseDirectoryNameFromSdChangeLine($lastPublicChange);
  621. my(@timeOfLastPublicChange) = TimeFromSdChangeLine($lastPublicChange);
  622. my($revision) = TimeToRevision(@timeOfLastPublicChange);
  623. Log('lastPublicChange is ' . $lastPublicChange);
  624. Log('releaseTimeName is ' . $releaseTimeName);
  625. Log('timeOfLastPublicChange is (' . NormalizeSpace(join(' ', @timeOfLastPublicChange)) . ')');
  626. #Log('integralTimeOfLastPublicChange is ' . TimeToInteger(@timeOfLastPublicChange));
  627. Log('revision is ' . $revision);
  628. $cmd = 'sdx integrate -b ' . $branch . ' ' . $revision;
  629. $run->($cmd);
  630. #
  631. # a side affect in the doNotRun case, oh well..
  632. #
  633. chdir(JoinPaths(SdxRoot(), 'public')) || ErrorExit('chdir public');
  634. Log('cd /d %sdxroot%\public');
  635. #
  636. # Take the parent branch's publics.
  637. #
  638. $cmd = 'sd resolve -at ... ';
  639. $run->($cmd);
  640. #
  641. # Do the simple merges automatically.
  642. #
  643. $cmd = 'sdx resolve -as ';
  644. $run->($cmd);
  645. #
  646. # Adventures in Babysitting..
  647. #
  648. $cmd = 'sdx resolve -n ';
  649. $run->($cmd);
  650. # UNDONE Write "Banner" / "Box"..
  651. Log('******************************************************');
  652. Log('***** *******');
  653. Log('***** manually sd resolve and build and submit *******');
  654. Log('***** *******');
  655. Log('******************************************************');
  656. # UNDONE This list should be parameterized..
  657. my(@PathsToBuild) = qw(published base\published base\crts base\ntos\rtl base\ntdll base\win32);
  658. my($pathToBuild);
  659. foreach $pathToBuild (@PathsToBuild)
  660. {
  661. Suggest('cd /d ' . JoinPaths(SdxRoot(), $pathToBuild));
  662. Suggest('build -cZ');
  663. }
  664. Suggest('sdx submit -# integrate from ' . $parentBranch);
  665. # UNDONE Learn the "format" feature to make these pretty
  666. Log('******************************************************');
  667. Log('***** lastPublicChange is ' . $lastPublicChange);
  668. Log('***** releaseTimeName is ' . $releaseTimeName);
  669. Log('***** timeOfLastPublicChange is (' . NormalizeSpace(join(' ', @timeOfLastPublicChange)) . ')');
  670. #Log('***** integralTimeOfLastPublicChange is ' . TimeToInteger(@timeOfLastPublicChange));
  671. Log('***** revision is ' . $revision);
  672. Log('******************************************************');
  673. }
  674. sub Integrate
  675. {
  676. GenericIntegrate(\&IntegrateRun);
  677. }
  678. sub QueryIntegrate
  679. {
  680. GenericIntegrate(\&IntegrateDoNotRun);
  681. }
  682. #
  683. # scary and done less often, probably not worth automating
  684. #
  685. sub ReverseIntegrate
  686. {
  687. }
  688. #
  689. # UNDONE (for LikePopulate and LikePopulatePlusSymbols)
  690. #
  691. sub FindDiskSpace
  692. {
  693. }
  694. sub Main
  695. {
  696. $endl = "\n";
  697. $sd_ini = $ENV{'SDCONFIG'};
  698. if (!$sd_ini)
  699. {
  700. $sd_ini = 'sd.ini';
  701. }
  702. if (!SdxRoot())
  703. {
  704. ErrorExit('SDXROOT} not known');
  705. }
  706. Log('$SDXROOT is ' . SdxRoot());
  707. Log('sd.map is ' . SdMapPath());
  708. ReadSdMap();
  709. #ReadClient();
  710. }
  711. Main();
  712. Log(join(";", @ARGV));
  713. eval(join(";", @ARGV));
  714. __END__
  715. :endofperl