"Trash Metal" should be "Thrash Metal". Reported as FS#6503, checked against Winamp.
[Rockbox.git] / tools / release
blob40a2b40bed520f355bae7c8b80e028b07f28c250
1 #!/usr/bin/env perl
3 $version = $ARGV[0];
5 if($version eq "") {
6 print "Enter version number!\n";
7 exit;
10 if(!-f "apps/version.h") {
11 print "run this script in the root dir\n";
12 exit;
15 @files=`find . -name FILES`;
17 my @entries;
19 sub dirpart {
20 my ($file)=@_;
21 my @p=split("/", $file);
22 $p[$#p]=""; # blank the last one
23 my $dir=join("/", @p);
25 $dir =~ s/^\.\///; # cut off ./ beginnings
27 $dir =~ s/\/$//; # off / trailers
29 return $dir;
32 sub add {
33 my ($file)=@_;
35 my $dir=dirpart($file);
37 open(FILE, "<$file");
38 while(<FILE>) {
39 if($_ =~ /^ *\#/) {
40 next;
42 chomp;
43 push @entries, "$dir/$_";
45 close(FILE);
48 for(@files) {
49 chomp;
50 add($_);
53 sub mkalldir {
54 my ($dir) = @_;
56 my @parts = split("/", $dir);
58 #print "IN: $dir\n";
60 my $sub="";
61 for(@parts) {
62 #print "PART: $_\n";
64 $sub .= "$_";
65 if($_ eq "") {
66 next;
68 mkdir($sub, 0777);
69 #print "make $sub\n";
70 $sub .= "/";
75 #mkalldir("rockbox-1.0/firmware/malloc");
76 #exit;
78 for(@entries) {
79 my $dir = dirpart("rockbox-$version/$_");
80 #print "Create $dir\n";
81 mkalldir($dir);
82 #print "Copy $_ to $dir\n";
83 `cp -p $_ $dir 2>/dev/null`;
87 if(!open(VERSION, "<apps/version.h")) {
88 print "Can't read version.h\n";
89 exit;
92 if(!open(THIS, ">rockbox-$version/apps/version.h")) {
93 print "Can't create a new version.h for this version\n";
94 exit;
96 while(<VERSION>) {
97 $_ =~ s/^\#define APPSVERSION .*/\#define APPSVERSION \"$version\"/;
98 print THIS $_;
100 close(VERSION);
101 close(THIS);
103 `tar -cjf rockbox-$version.tar.bz2 rockbox-$version`;
104 `rm -rf rockbox-$version`;