diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/release | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/tools/release b/tools/release new file mode 100755 index 0000000000..27c2c58ac2 --- /dev/null +++ b/tools/release | |||
@@ -0,0 +1,80 @@ | |||
1 | #!/usr/bin/env perl | ||
2 | |||
3 | $version = $ARGV[0]; | ||
4 | |||
5 | if($version eq "") { | ||
6 | print "Enter version number!\n"; | ||
7 | exit; | ||
8 | } | ||
9 | |||
10 | @files=`find . -name FILES`; | ||
11 | |||
12 | my @entries; | ||
13 | |||
14 | sub dirpart { | ||
15 | my ($file)=@_; | ||
16 | my @p=split("/", $file); | ||
17 | $p[$#p]=""; # blank the last one | ||
18 | my $dir=join("/", @p); | ||
19 | |||
20 | $dir =~ s/^\.\///; # cut off ./ beginnings | ||
21 | |||
22 | $dir =~ s/\/$//; # off / trailers | ||
23 | |||
24 | return $dir; | ||
25 | } | ||
26 | |||
27 | sub add { | ||
28 | my ($file)=@_; | ||
29 | |||
30 | my $dir=dirpart($file); | ||
31 | |||
32 | open(FILE, "<$file"); | ||
33 | while(<FILE>) { | ||
34 | chomp; | ||
35 | push @entries, "$dir/$_"; | ||
36 | } | ||
37 | close(FILE); | ||
38 | } | ||
39 | |||
40 | for(@files) { | ||
41 | chomp; | ||
42 | add($_); | ||
43 | } | ||
44 | |||
45 | sub mkalldir { | ||
46 | my ($dir) = @_; | ||
47 | |||
48 | my @parts = split("/", $dir); | ||
49 | |||
50 | #print "IN: $dir\n"; | ||
51 | |||
52 | my $sub=""; | ||
53 | for(@parts) { | ||
54 | #print "PART: $_\n"; | ||
55 | |||
56 | $sub .= "$_"; | ||
57 | if($_ eq "") { | ||
58 | next; | ||
59 | } | ||
60 | mkdir($sub, 0777); | ||
61 | #print "make $sub\n"; | ||
62 | $sub .= "/"; | ||
63 | } | ||
64 | |||
65 | } | ||
66 | |||
67 | #mkalldir("rockbox-1.0/firmware/malloc"); | ||
68 | #exit; | ||
69 | |||
70 | for(@entries) { | ||
71 | my $dir = dirpart("rockbox-$version/$_"); | ||
72 | #print "Create $dir\n"; | ||
73 | mkalldir($dir); | ||
74 | #print "Copy $_ to $dir\n"; | ||
75 | `cp -p $_ $dir`; | ||
76 | } | ||
77 | |||
78 | `tar -cf rockbox-$version.tar rockbox-$version`; | ||
79 | `gzip -9 rockbox-$version.tar`; | ||
80 | `rm -rf rockbox-$version`; | ||