Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.24 KB | None | 0 0
  1. From 180ebdffe6adbdb000caaa27f987791fd7880eaa Mon Sep 17 00:00:00 2001
  2. From: Liang Qi <liang.qi@nokia.com>
  3. Date: Fri, 18 Feb 2011 15:13:48 +0100
  4. Subject: [PATCH] to be reviewed
  5.  
  6. ---
  7. modularize | 36 ++++++++++--
  8. scripts/780_symbianpkgrules | 51 ++++++++++++++++
  9. scripts/800_git_split | 132 ++++++++++++++++++++++++++++++++++++++++++
  10. scripts/810_qtwebkit_patches | 36 +++++++++++
  11. scripts/880_symbianpkgrules | 51 ----------------
  12. scripts/900_git_split | 132 ------------------------------------------
  13. scripts/910_qtwebkit_patches | 36 -----------
  14. scripts/999_modularized | 71 ++++++++++++++++++++++
  15. 8 files changed, 321 insertions(+), 224 deletions(-)
  16. create mode 100644 scripts/780_symbianpkgrules
  17. create mode 100644 scripts/800_git_split
  18. create mode 100644 scripts/810_qtwebkit_patches
  19. delete mode 100644 scripts/880_symbianpkgrules
  20. delete mode 100644 scripts/900_git_split
  21. delete mode 100644 scripts/910_qtwebkit_patches
  22. create mode 100644 scripts/999_modularized
  23.  
  24. diff --git a/modularize b/modularize
  25. index 7570d89..b90ec8d 100755
  26. --- a/modularize
  27. +++ b/modularize
  28. @@ -297,8 +297,8 @@ sub patchHasChanges
  29.  
  30. sub showUsage {
  31. print "$0 usage:\n";
  32. - print " -no-modularize Don't run the 0xx-8xx script range\n";
  33. - print " -no-split Don't run the 9xx script range\n";
  34. + print " -no-modularize Don't run the 0xx-7xx script range\n";
  35. + print " -no-split Don't run the 8xx script range\n";
  36. print " -no-commit Do not commit the changes\n";
  37. print " -move <dest> Copy the new folder in the given destination \n";
  38. print " -symlinks Uses symlinks for the mother repo instead of repo copies\n";
  39. @@ -315,6 +315,8 @@ sub showUsage {
  40. print " to current HEAD\n";
  41. print " -regenerate-patches Automatically regenerate all the patches for the\n";
  42. print " modularization project (does not copy to the repo!)\n";
  43. + print " -modularized <dest> Run the 999 script, \n";
  44. + print " and will copy all repos to the given destination\n";
  45. print " -? This help\n";
  46. }
  47. # -- End functions ---------------------------------------------------------------------------------
  48. @@ -323,6 +325,8 @@ sub showUsage {
  49. $OStype = checkOS;
  50. our $run_split = 1;
  51. our $run_rest = 1;
  52. +our $run_final = 0;
  53. +our $final_dest = "";
  54. our $commit_changes = 1;
  55. our $redo = 0;
  56. our $move = 0;
  57. @@ -378,6 +382,16 @@ while ( @ARGV ) {
  58. $rebase_patches = 1;
  59. } elsif ($arg eq "-regenerate-patches") {
  60. $regenerate_patches = 1;
  61. + } elsif($arg eq "-modularized") {
  62. + if (@ARGV) {
  63. + $run_final = 1;
  64. + $final_dest = shift @ARGV;
  65. + }
  66. + else {
  67. + print "Missing destination\n\n";
  68. + showUsage();
  69. + exit 1;
  70. + }
  71. } else {
  72. print "Unknown option: $arg\n\n";
  73. showUsage();
  74. @@ -495,11 +509,13 @@ if ($redo) {
  75. }
  76.  
  77. my @scripts;
  78. -push @scripts, sort(findFiles("$basepath/scripts", '^[0-7]\d+_.*[^~]', 0)) if ($run_rest);
  79. +push @scripts, sort(findFiles("$basepath/scripts", '^[0-6]\d+_.*[^~]', 0)) if ($run_rest);
  80. my @scripts_generated_commits;
  81. -push @scripts_generated_commits, sort(findFiles("$basepath/scripts", '^8\d+_.*[^~]', 0)) if ($run_rest);
  82. +push @scripts_generated_commits, sort(findFiles("$basepath/scripts", '^7\d+_.*[^~]', 0)) if ($run_rest);
  83. my @scripts_split;
  84. -push @scripts_split, sort(findFiles("$basepath/scripts", '^9\d+_.*[^~]', 0)) if ($run_split);
  85. +push @scripts_split, sort(findFiles("$basepath/scripts", '^8\d+_.*[^~]', 0)) if ($run_split);
  86. +my @scripts_final;
  87. +push @scripts_final, sort(findFiles("$basepath/scripts", '999', 0)) if ($run_final);
  88. print "Scripts to execute (in order):\n ".join(", ", (@scripts, @scripts_generated_commits))."\n";
  89.  
  90. # Remember that each script need to end with a "return 1;" on success, and "return 0;" when unsuccessful
  91. @@ -574,5 +590,15 @@ if($run_split) {
  92. }
  93. chdir($qtdir);
  94.  
  95. +#create the final repository for git server
  96. +if($run_final) {
  97. + foreach my $script (@scripts_final) {
  98. + print "--> $script\n";
  99. + chdir($qtdir);
  100. + require("$basepath/scripts/$script");
  101. + }
  102. +}
  103. +chdir($qtdir);
  104. +
  105. print "===\n";
  106. print "Modularization done!\n";
  107. diff --git a/scripts/780_symbianpkgrules b/scripts/780_symbianpkgrules
  108. new file mode 100644
  109. index 0000000..a5820ac
  110. --- /dev/null
  111. +++ b/scripts/780_symbianpkgrules
  112. @@ -0,0 +1,51 @@
  113. +#--------------------------------------------------------------------------------------------------
  114. +# Standard modularization template
  115. +# --------------------------------
  116. +#
  117. +# The script will start execution from <QTDIR>.
  118. +#
  119. +# Available variables:
  120. +# $qtdir = <QTDIR> or where you started the modularize script from
  121. +# $basepath = path for the modularize script, and basepath for the modularization repo
  122. +# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
  123. +#
  124. +# To execute a command:
  125. +# run("git mv foo bar") # runs command, reports error possition and dies
  126. +# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
  127. +# and continues. Use ($? >> 8) to get the real exit code.
  128. +# ensureDir("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
  129. +# it if it does not exist.
  130. +#--------------------------------------------------------------------------------------------------
  131. +
  132. +sub fixSymbianPkgFile {
  133. + my $profile = $_[0];
  134. + my $readFd;
  135. + my $writeFd;
  136. + my @stat = stat($profile);
  137. + open($readFd, "< $profile") or die("Could not open $profile");
  138. + open($writeFd, "> $profile.tmp") or die("Could not open $profile.tmp");
  139. + while (<$readFd>) {
  140. + s,include\(\$\$QT_SOURCE_TREE/demos/symbianpkgrules\.pri\),CONFIG += qt_demo,;
  141. + s,include\(\$\$QT_SOURCE_TREE/examples/symbianpkgrules\.pri\),CONFIG += qt_example,;
  142. + print($writeFd $_);
  143. + }
  144. + close($readFd);
  145. + close($writeFd);
  146. + unlink($profile);
  147. + rename("$profile.tmp", $profile) or die("Could not rename $profile.tmp -> $profile");
  148. + chmod($stat[2], $profile) or die("Could not chmod $profile") if ($OStype != 0);
  149. +}
  150. +
  151. +my @demosAndExamples;
  152. +foreach my $repo (@repos) {
  153. + push(@demosAndExamples, findFiles("$repo", ".*\\.pr[iof]", 1));
  154. +}
  155. +
  156. +foreach my $profile (@demosAndExamples) {
  157. + fixSymbianPkgFile($profile);
  158. +}
  159. +
  160. +# axis wrote this script, so he should be the author.
  161. +run("git commit -a -q \"--author=axis <qt-info\@nokia.com>\" -m \"Moved to using a feature profile instead of direct inclusion.\"") if ($commit_changes);
  162. +
  163. +return 1;
  164. diff --git a/scripts/800_git_split b/scripts/800_git_split
  165. new file mode 100644
  166. index 0000000..2e615bd
  167. --- /dev/null
  168. +++ b/scripts/800_git_split
  169. @@ -0,0 +1,132 @@
  170. +#--------------------------------------------------------------------------------------------------
  171. +# Standard modularization template
  172. +# --------------------------------
  173. +#
  174. +# The script will start execution from <QTDIR>.
  175. +#
  176. +# Available variables:
  177. +# $qtdir = <QTDIR> or where you started the modularize script from
  178. +# $basepath = path for the modularize script, and basepath for the modularization repo
  179. +# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
  180. +#
  181. +# To execute a command:
  182. +# run("git mv foo bar") # runs command, reports error possition and dies
  183. +# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
  184. +# and continues. Use ($? >> 8) to get the real exit code.
  185. +# ensureDir("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
  186. +# it if it does not exist.
  187. +#--------------------------------------------------------------------------------------------------
  188. +
  189. +# Ensure that nothing is left out
  190. +chdir("src");
  191. +fsRmdirWithParents("plugins/imageformats");
  192. +fsRmdir("tools");
  193. +fsRmdir("3rdparty");
  194. +chdir("..");
  195. +fsRmdir("src");
  196. +fsRmdir("tools");
  197. +
  198. +# Ensure that the mother repo <QTDIR>/qt is created
  199. +# any by default use that as the repo base for the modules
  200. +my $motherdir = "qt";
  201. +my $repos_base = $qtdir . "/" . $motherdir;
  202. +ensureDir($motherdir);
  203. +my $cacheDir = $qtWebKitType;
  204. +
  205. +
  206. +# if we told it to move, ensure that the move to directory is created
  207. +# and point the module repo base to that
  208. +if ($move) {
  209. + ensureDir($move_dest);
  210. + $repos_base = $move_dest;
  211. +}
  212. +
  213. +# Ensure that lns is compile before we can symlink/hardlink
  214. +if ($link_type != COPY) {
  215. + if($OStype == WINDOWS) {
  216. + my $lnsPath = "$basepath/src/lns";
  217. + $lnsPath =~ s,/,\\,g;
  218. + run("cd $lnsPath && nmake /f Makefile.win32");
  219. + } else {
  220. + run("cd $basepath/src/lns && make");
  221. + }
  222. +}
  223. +
  224. +# do a full copy/symlink/hardlink of each module into the repo base
  225. +# and initialize the module repo there
  226. +foreach my $module (@repos) {
  227. + my $i = "$qtdir/$module";
  228. + my $o = "$repos_base/$module";
  229. +
  230. + if ($link_type == SYMLINKS) {
  231. + print "Creating symlink from '$i' to '$o'\n";
  232. + run("$basepath/lns -v $o $i");
  233. + } elsif ($link_type == HARDLINKS) {
  234. + print "Creating hardlinks from '$i' to '$o'\n";
  235. + run("$basepath/lns -h -v $o $i");
  236. + } else {
  237. + print "Copying files from '$i' to '$o'\n";
  238. + fsCopy("-r", "$module", "$o");
  239. + }
  240. +
  241. + # initiate the Git repo here in the copy
  242. + chdir("$repos_base/$module");
  243. + run("git init . -q");
  244. + run("git add .");
  245. + run("git commit -F $basepath/misc/import-commit-msg --author \"Qt by Nokia <qt-info\@nokia.com>\" -q");
  246. + chdir($qtdir);
  247. +}
  248. +
  249. +#-- generate mother repo
  250. +chdir($motherdir);
  251. +run ("git init . -q");
  252. +fsCopy("-r", "$basepath/mother/*", ".");
  253. +if ($link_type == COPY) {
  254. + foreach my $module (@repos) {
  255. + # module repo will either be inside the mother repo already
  256. + # or in the move destination directory
  257. + run("git submodule -q add $repos_base/$module");
  258. + }
  259. +}
  260. +if (-d "$basepath/$cacheDir") {
  261. + # Check for a stale version of WebKit, in case the URL has been updated.
  262. + chdir("$basepath/$cacheDir");
  263. + my $remoteUrl = `git config --get remote.origin.url`;
  264. + chdir($repos_base);
  265. + if ($remoteUrl !~ $qtWebKitCloneUrl) {
  266. + print("Deleting cached qtwebkit clone because URLs don't match. remoteUrl=$remoteUrl, qtWebKitCloneUrl=$qtWebKitCloneUrl \n");
  267. + if ($OStype == WINDOWS) {
  268. + my $webkitPath = "$basepath/$cacheDir";
  269. + $webkitPath =~ s,/,\\,g;
  270. + run("rmdir /S/Q $webkitPath");
  271. + } else {
  272. + run("rm -rf $basepath/$cacheDir");
  273. + }
  274. + }
  275. +}
  276. +if (! -d "$basepath/$cacheDir") {
  277. + print("Note: Creating a cached clone of WebKit in\n");
  278. + print(" $basepath/$cacheDir.\n");
  279. + print(" This will be reused next time unless you delete it yourself.\n");
  280. + if (runNotDie("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir") != 0) {
  281. + # Try one more time. The gitorious server often works on the second attempt,
  282. + # when its caches are warm.
  283. + print("Retrying qtwebkit clone one more time...\n");
  284. + run("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir");
  285. + }
  286. +} else {
  287. + chdir("$basepath/$cacheDir");
  288. + # Update with latest objects.
  289. + run("git fetch");
  290. + chdir("$qtdir/$motherdir");
  291. +}
  292. +run("git submodule -q add --reference $basepath/$cacheDir $qtWebKitCloneUrl qtwebkit");
  293. +chdir("qtwebkit");
  294. +run("git reset --hard $qtWebKitCheckoutRef");
  295. +chdir("..");
  296. +run("git submodule init");
  297. +run ("git add . "); #
  298. +run("git commit -m \"Long live the mother Qt repository\" -q");
  299. +
  300. +
  301. +return 1;
  302. diff --git a/scripts/810_qtwebkit_patches b/scripts/810_qtwebkit_patches
  303. new file mode 100644
  304. index 0000000..f852dd2
  305. --- /dev/null
  306. +++ b/scripts/810_qtwebkit_patches
  307. @@ -0,0 +1,36 @@
  308. +#--------------------------------------------------------------------------------------------------
  309. +# Standard modularization template
  310. +# --------------------------------
  311. +#
  312. +# The script will start execution from <QTDIR>.
  313. +#
  314. +# Available variables:
  315. +# $qtdir = <QTDIR> or where you started the modularize script from
  316. +# $basepath = path for the modularize script, and basepath for the modularization repo
  317. +# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
  318. +#
  319. +# To execute a command:
  320. +# run("git mv foo bar") # runs command, reports error possition and dies
  321. +# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
  322. +# and continues. Use ($? >> 8) to get the real exit code.
  323. +# ensureDir("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
  324. +# it if it does not exist.
  325. +#--------------------------------------------------------------------------------------------------
  326. +
  327. +chdir("qt/qtwebkit");
  328. +my @patches = findFiles("$basepath/patches/qtwebkit", '^\d+-.*\.patch', 0);
  329. +my @patchesForTrunk = findFiles("$basepath/patches/qtwebkit/webkit", '^\d+-.*\.patch', 0);
  330. +my @patchesToApply;
  331. +foreach (@patchesForTrunk) { $inPatchesForTrunk{$_} = 1; }
  332. +foreach my $patch (@patches) {
  333. + if ($qtWebKitType =~ /^webkit$/ && $inPatchesForTrunk{$patch}) {
  334. + push(@patchesToApply, "$basepath/patches/qtwebkit/webkit/$patch");
  335. + } else {
  336. + push(@patchesToApply, "$basepath/patches/qtwebkit/$patch");
  337. + }
  338. +}
  339. +run("git am --ignore-whitespace " . join(" ", @patchesToApply));
  340. +chdir("..");
  341. +run("git commit -a -m \"Committed Qt Modularization patches to QtWebKit.\" --author \"axis <qt-info\@nokia.com>\"");
  342. +
  343. +return 1;
  344. diff --git a/scripts/880_symbianpkgrules b/scripts/880_symbianpkgrules
  345. deleted file mode 100644
  346. index a5820ac..0000000
  347. --- a/scripts/880_symbianpkgrules
  348. +++ /dev/null
  349. @@ -1,51 +0,0 @@
  350. -#--------------------------------------------------------------------------------------------------
  351. -# Standard modularization template
  352. -# --------------------------------
  353. -#
  354. -# The script will start execution from <QTDIR>.
  355. -#
  356. -# Available variables:
  357. -# $qtdir = <QTDIR> or where you started the modularize script from
  358. -# $basepath = path for the modularize script, and basepath for the modularization repo
  359. -# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
  360. -#
  361. -# To execute a command:
  362. -# run("git mv foo bar") # runs command, reports error possition and dies
  363. -# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
  364. -# and continues. Use ($? >> 8) to get the real exit code.
  365. -# ensureDir("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
  366. -# it if it does not exist.
  367. -#--------------------------------------------------------------------------------------------------
  368. -
  369. -sub fixSymbianPkgFile {
  370. - my $profile = $_[0];
  371. - my $readFd;
  372. - my $writeFd;
  373. - my @stat = stat($profile);
  374. - open($readFd, "< $profile") or die("Could not open $profile");
  375. - open($writeFd, "> $profile.tmp") or die("Could not open $profile.tmp");
  376. - while (<$readFd>) {
  377. - s,include\(\$\$QT_SOURCE_TREE/demos/symbianpkgrules\.pri\),CONFIG += qt_demo,;
  378. - s,include\(\$\$QT_SOURCE_TREE/examples/symbianpkgrules\.pri\),CONFIG += qt_example,;
  379. - print($writeFd $_);
  380. - }
  381. - close($readFd);
  382. - close($writeFd);
  383. - unlink($profile);
  384. - rename("$profile.tmp", $profile) or die("Could not rename $profile.tmp -> $profile");
  385. - chmod($stat[2], $profile) or die("Could not chmod $profile") if ($OStype != 0);
  386. -}
  387. -
  388. -my @demosAndExamples;
  389. -foreach my $repo (@repos) {
  390. - push(@demosAndExamples, findFiles("$repo", ".*\\.pr[iof]", 1));
  391. -}
  392. -
  393. -foreach my $profile (@demosAndExamples) {
  394. - fixSymbianPkgFile($profile);
  395. -}
  396. -
  397. -# axis wrote this script, so he should be the author.
  398. -run("git commit -a -q \"--author=axis <qt-info\@nokia.com>\" -m \"Moved to using a feature profile instead of direct inclusion.\"") if ($commit_changes);
  399. -
  400. -return 1;
  401. diff --git a/scripts/900_git_split b/scripts/900_git_split
  402. deleted file mode 100644
  403. index c45523a..0000000
  404. --- a/scripts/900_git_split
  405. +++ /dev/null
  406. @@ -1,132 +0,0 @@
  407. -#--------------------------------------------------------------------------------------------------
  408. -# Standard modularization template
  409. -# --------------------------------
  410. -#
  411. -# The script will start execution from <QTDIR>.
  412. -#
  413. -# Available variables:
  414. -# $qtdir = <QTDIR> or where you started the modularize script from
  415. -# $basepath = path for the modularize script, and basepath for the modularization repo
  416. -# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
  417. -#
  418. -# To execute a command:
  419. -# run("git mv foo bar") # runs command, reports error possition and dies
  420. -# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
  421. -# and continues. Use ($? >> 8) to get the real exit code.
  422. -# ensureDir("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
  423. -# it if it does not exist.
  424. -#--------------------------------------------------------------------------------------------------
  425. -
  426. -# Ensure that nothing is left out
  427. -chdir("src");
  428. -fsRmdirWithParents("plugins/imageformats");
  429. -fsRmdir("tools");
  430. -fsRmdir("3rdparty");
  431. -chdir("..");
  432. -fsRmdir("src");
  433. -fsRmdir("tools");
  434. -
  435. -# Ensure that the mother repo <QTDIR>/qt is created
  436. -# any by default use that as the repo base for the modules
  437. -my $motherdir = "qt";
  438. -my $repos_base = $qtdir . "/" . $motherdir;
  439. -ensureDir($motherdir);
  440. -my $cacheDir = $qtWebKitType;
  441. -
  442. -
  443. -# if we told it to move, ensure that the move to directory is created
  444. -# and point the module repo base to that
  445. -if ($move) {
  446. - ensureDir($move_dest);
  447. - $repos_base = $move_dest;
  448. -}
  449. -
  450. -# Ensure that lns is compile before we can symlink/hardlink
  451. -if ($link_type != COPY) {
  452. - if($OStype == WINDOWS) {
  453. - my $lnsPath = "$basepath/src/lns";
  454. - $lnsPath =~ s,/,\\,g;
  455. - run("cd $lnsPath && nmake /f Makefile.win32");
  456. - } else {
  457. - run("cd $basepath/src/lns && make");
  458. - }
  459. -}
  460. -
  461. -# do a full copy/symlink/hardlink of each module into the repo base
  462. -# and initialize the module repo there
  463. -foreach my $module (@repos) {
  464. - my $i = "$qtdir/$module";
  465. - my $o = "$repos_base/$module";
  466. -
  467. - if ($link_type == SYMLINKS) {
  468. - print "Creating symlink from '$i' to '$o'\n";
  469. - run("$basepath/lns -v $o $i");
  470. - } elsif ($link_type == HARDLINKS) {
  471. - print "Creating hardlinks from '$i' to '$o'\n";
  472. - run("$basepath/lns -h -v $o $i");
  473. - } else {
  474. - print "Copying files from '$i' to '$o'\n";
  475. - fsCopy("-r", "$module", "$o");
  476. - }
  477. -
  478. - # initiate the Git repo here in the copy
  479. - chdir("$repos_base/$module");
  480. - run("git init . -q");
  481. - run("git add .");
  482. - run("git commit -F $basepath/misc/import-commit-msg --author \"Qt by Nokia <qt-info\@nokia.com>\" -q");
  483. - chdir($qtdir);
  484. -}
  485. -
  486. -#-- generate mother repo
  487. -chdir($motherdir);
  488. -run ("git init . -q");
  489. -fsCopy("-r", "$basepath/mother/*", ".");
  490. -if ($link_type == COPY) {
  491. - foreach my $module (@repos) {
  492. - # module repo will either be inside the mother repo already
  493. - # or in the move destination directory
  494. - run("git submodule -q add $repos_base/$module");
  495. - }
  496. -}
  497. -if (-d "$basepath/$cacheDir") {
  498. - # Check for a stale version of WebKit, in case the URL has been updated.
  499. - chdir("$basepath/$cacheDir");
  500. - my $remoteUrl = `git config --get remote.origin.url`;
  501. - chdir($repos_base);
  502. - if ($remoteUrl !~ $qtWebKitCloneUrl) {
  503. - print("Deleting cached qtwebkit clone because URLs don't match.\n");
  504. - if ($OStype == WINDOWS) {
  505. - my $webkitPath = "$basepath/$cacheDir";
  506. - $webkitPath =~ s,/,\\,g;
  507. - run("rmdir /S/Q $webkitPath");
  508. - } else {
  509. - run("rm -rf $basepath/$cacheDir");
  510. - }
  511. - }
  512. -}
  513. -if (! -d "$basepath/$cacheDir") {
  514. - print("Note: Creating a cached clone of WebKit in\n");
  515. - print(" $basepath/$cacheDir.\n");
  516. - print(" This will be reused next time unless you delete it yourself.\n");
  517. - if (runNotDie("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir") != 0) {
  518. - # Try one more time. The gitorious server often works on the second attempt,
  519. - # when its caches are warm.
  520. - print("Retrying qtwebkit clone one more time...\n");
  521. - run("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir");
  522. - }
  523. -} else {
  524. - chdir("$basepath/$cacheDir");
  525. - # Update with latest objects.
  526. - run("git fetch");
  527. - chdir("$qtdir/$motherdir");
  528. -}
  529. -run("git submodule -q add --reference $basepath/$cacheDir $qtWebKitCloneUrl qtwebkit");
  530. -chdir("qtwebkit");
  531. -run("git reset --hard $qtWebKitCheckoutRef");
  532. -chdir("..");
  533. -run("git submodule init");
  534. -run ("git add . "); #
  535. -run("git commit -m \"Long live the mother Qt repository\" -q");
  536. -
  537. -
  538. -return 1;
  539. diff --git a/scripts/910_qtwebkit_patches b/scripts/910_qtwebkit_patches
  540. deleted file mode 100644
  541. index f852dd2..0000000
  542. --- a/scripts/910_qtwebkit_patches
  543. +++ /dev/null
  544. @@ -1,36 +0,0 @@
  545. -#--------------------------------------------------------------------------------------------------
  546. -# Standard modularization template
  547. -# --------------------------------
  548. -#
  549. -# The script will start execution from <QTDIR>.
  550. -#
  551. -# Available variables:
  552. -# $qtdir = <QTDIR> or where you started the modularize script from
  553. -# $basepath = path for the modularize script, and basepath for the modularization repo
  554. -# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
  555. -#
  556. -# To execute a command:
  557. -# run("git mv foo bar") # runs command, reports error possition and dies
  558. -# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
  559. -# and continues. Use ($? >> 8) to get the real exit code.
  560. -# ensureDir("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
  561. -# it if it does not exist.
  562. -#--------------------------------------------------------------------------------------------------
  563. -
  564. -chdir("qt/qtwebkit");
  565. -my @patches = findFiles("$basepath/patches/qtwebkit", '^\d+-.*\.patch', 0);
  566. -my @patchesForTrunk = findFiles("$basepath/patches/qtwebkit/webkit", '^\d+-.*\.patch', 0);
  567. -my @patchesToApply;
  568. -foreach (@patchesForTrunk) { $inPatchesForTrunk{$_} = 1; }
  569. -foreach my $patch (@patches) {
  570. - if ($qtWebKitType =~ /^webkit$/ && $inPatchesForTrunk{$patch}) {
  571. - push(@patchesToApply, "$basepath/patches/qtwebkit/webkit/$patch");
  572. - } else {
  573. - push(@patchesToApply, "$basepath/patches/qtwebkit/$patch");
  574. - }
  575. -}
  576. -run("git am --ignore-whitespace " . join(" ", @patchesToApply));
  577. -chdir("..");
  578. -run("git commit -a -m \"Committed Qt Modularization patches to QtWebKit.\" --author \"axis <qt-info\@nokia.com>\"");
  579. -
  580. -return 1;
  581. diff --git a/scripts/999_modularized b/scripts/999_modularized
  582. new file mode 100644
  583. index 0000000..eec4c99
  584. --- /dev/null
  585. +++ b/scripts/999_modularized
  586. @@ -0,0 +1,71 @@
  587. +#--------------------------------------------------------------------------------------------------
  588. +# Standard modularization template
  589. +# --------------------------------
  590. +#
  591. +# The script will start execution from <QTDIR>.
  592. +#
  593. +# Available variables:
  594. +# $qtdir = <QTDIR> or where you started the modularize script from
  595. +# $basepath = path for the modularize script, and basepath for the modularization repo
  596. +# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
  597. +#
  598. +# To execute a command:
  599. +# run("git mv foo bar") # runs command, reports error possition and dies
  600. +# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
  601. +# and continues. Use ($? >> 8) to get the real exit code.
  602. +# ensureDir("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
  603. +# it if it does not exist.
  604. +#--------------------------------------------------------------------------------------------------
  605. +
  606. +# Ensure that the mother repo <QTDIR>/qt is created
  607. +# any by default use that as the repo base for the modules
  608. +my $motherdir1 = "qt";
  609. +my $modularizeddir = "modularized";
  610. +my $modularized_base = $qtdir . "/" . $modularizeddir;
  611. +ensureDir($modularizeddir);
  612. +my $cacheDir = $qtWebKitType;
  613. +
  614. +#generate --bare repo for each module
  615. +chdir($modularizeddir);
  616. +foreach my $module (@repos) {
  617. + print("Modularized for $module.\n");
  618. + run("git clone --bare ../$motherdir1/$module $module.git");
  619. +}
  620. +
  621. +#scp module repos to dest
  622. +chdir($modularizeddir);
  623. +print("Copy all modularized modules to $final_dest.\n");
  624. +run("scp -r *.git $final_dest");
  625. +
  626. +#generate mother repo locally
  627. +print("Create mother repo based on remote submodule.\n");
  628. +my $motherdir = "mother";
  629. +my $motherdir_base = $modularized_base . "/" . $motherdir;
  630. +ensureDir($motherdir);
  631. +
  632. +chdir($motherdir);
  633. +run ("git init . -q");
  634. +fsCopy("-r", "$basepath/mother/*", ".");
  635. +foreach my $module (@repos) {
  636. + # module repo will either be inside the mother repo already
  637. + # or in the move destination directory
  638. + run("git submodule -q add $final_dest/$module $module");
  639. +}
  640. +run("git submodule -q add --reference $basepath/$cacheDir $qtWebKitCloneUrl qtwebkit");
  641. +chdir("qtwebkit");
  642. +run("git reset --hard $qtWebKitCheckoutRef");
  643. +chdir("..");
  644. +run("git submodule init");
  645. +run ("git add . "); #
  646. +run("git commit -m \"Long live the mother Qt repository\" -q");
  647. +
  648. +#generate --bare repo for mother
  649. +chdir("..");
  650. +print("Modularized for mother repo.\n");
  651. +run("git clone --bare $motherdir mother.git");
  652. +
  653. +#scp mother repo to dest
  654. +print("Copy all modularized mother to $final_dest.\n");
  655. +run("scp -r mother.git $final_dest");
  656. +
  657. +return 1;
  658. --
  659. 1.7.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement