summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2009-03-07 02:36:13 +0000
committerJonas Häggqvist <rasher@rasher.dk>2009-03-07 02:36:13 +0000
commita88d5f045f054347a33320a417177f71bb2c3a91 (patch)
treeab7da935d3d8b161ed685a26764802e8ae9711d8
parent9a6d91940c6e3c58bdeb015855e3177bcb382c72 (diff)
downloadrockbox-a88d5f045f054347a33320a417177f71bb2c3a91.tar.gz
rockbox-a88d5f045f054347a33320a417177f71bb2c3a91.zip
Remove some more debug output. Add an option to strip binaries. Fix quoting at the zip stage.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20225 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xtools/release/sims.pl32
1 files changed, 24 insertions, 8 deletions
diff --git a/tools/release/sims.pl b/tools/release/sims.pl
index fbf868f541..c84041c056 100755
--- a/tools/release/sims.pl
+++ b/tools/release/sims.pl
@@ -4,7 +4,7 @@ use File::Basename;
4use File::Path; 4use File::Path;
5use Cwd; 5use Cwd;
6 6
7my $verbose, $update, $doonly, $version; 7my $verbose, $strip, $update, $doonly, $version;
8my @doonly; 8my @doonly;
9 9
10my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); 10my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time());
@@ -23,6 +23,7 @@ Usage: w32sims [-v] [-u] [-r VERSION] [-f filename] [buildonly]
23 -u Run svn up before building 23 -u Run svn up before building
24 -r Use the specified version string for filenames (defaults to SVN 24 -r Use the specified version string for filenames (defaults to SVN
25 revision) 25 revision)
26 -s Strip binaries before zipping them up.
26 -f Filename format string (without extension). This can include a 27 -f Filename format string (without extension). This can include a
27 filepath (relative or absolute) May include the following special 28 filepath (relative or absolute) May include the following special
28 strings: 29 strings:
@@ -45,6 +46,9 @@ MOO
45 elsif ($ARGV[0] eq "-u") { 46 elsif ($ARGV[0] eq "-u") {
46 $update =1; 47 $update =1;
47 } 48 }
49 elsif ($ARGV[0] eq "-s") {
50 $strip =1;
51 }
48 elsif ($ARGV[0] eq "-r") { 52 elsif ($ARGV[0] eq "-r") {
49 $version =$ARGV[1]; 53 $version =$ARGV[1];
50 shift @ARGV; 54 shift @ARGV;
@@ -55,8 +59,6 @@ MOO
55 } 59 }
56 else { 60 else {
57 push(@doonly,$ARGV[0]); 61 push(@doonly,$ARGV[0]);
58 # This will only be printed if the -v flag comes earler
59 print "only build ${ARGV[0]}\n" if($verbose);
60 } 62 }
61 shift @ARGV; 63 shift @ARGV;
62} 64}
@@ -76,6 +78,10 @@ $rev = `tools/version.sh .`;
76chomp $rev; 78chomp $rev;
77print "rev $rev\n" if($verbose); 79print "rev $rev\n" if($verbose);
78 80
81if (@doonly) {
82 printf("Build only %s\n", join(', ', @doonly)) if($verbose);
83}
84
79if (!defined($version)) { 85if (!defined($version)) {
80 $version = $rev; 86 $version = $rev;
81} 87}
@@ -96,6 +102,19 @@ sub runone {
96 # build the target 102 # build the target
97 $a = buildit($dir, $confnum, $extra); 103 $a = buildit($dir, $confnum, $extra);
98 104
105 if ($strip) {
106 print "Stripping binaries\n" if ($verbose);
107 # find \( -name "*.exe" -o -name "*.rock" -o -name "*.codec" \) -exec ls -l "{}" ";"
108 open(MAKE, "Makefile");
109 my $AS=(grep(/^export AS=/, <MAKE>))[0];
110 chomp($AS);
111 (my $striptool = $AS) =~ s/^export AS=(.*)as$/$1strip/;
112
113 $cmd = "find \\( -name 'rockboxui*' -o -iname '*dll' -o -name '*.rock' -o -name '*.codec' \\) -exec $striptool '{}' ';'";
114 print("$cmd\n") if ($verbose);
115 `$cmd`;
116 }
117
99 chdir ".."; 118 chdir "..";
100 119
101 my $newo=$filename; 120 my $newo=$filename;
@@ -110,8 +129,6 @@ sub runone {
110 129
111 130
112 print "Zip up the sim and associated files\n" if ($verbose); 131 print "Zip up the sim and associated files\n" if ($verbose);
113 print("Output: $newo\n");
114 print("Dir: " . dirname($newo) . "\n");
115 mkpath(dirname($newo)); 132 mkpath(dirname($newo));
116 system("mv build-$dir $newo"); 133 system("mv build-$dir $newo");
117 if (-f "$newo/rockboxui.exe") { 134 if (-f "$newo/rockboxui.exe") {
@@ -120,9 +137,8 @@ sub runone {
120 } 137 }
121 my $toplevel = getcwd(); 138 my $toplevel = getcwd();
122 chdir(dirname($newo)); 139 chdir(dirname($newo));
123 print(getcwd()."\n"); 140 $cmd = "zip -9 -r -q \"".basename($newo)."\" \"".basename($newo)."\"/{rockboxui*,UI256.bmp,SDL.dll,simdisk}";
124 $cmd = "zip -9 -r -q ".basename($newo)." ".basename($newo)."/{rockboxui*,UI256.bmp,SDL.dll,simdisk}"; 141 print("$cmd\n") if($verbose);
125 print("$cmd\n");
126 `$cmd`; 142 `$cmd`;
127 chdir($toplevel); 143 chdir($toplevel);
128 144