]>
code.delx.au - comingnext/blob - build.pl
10 use Archive
::Zip
qw( :ERROR_CODES );
15 rmtree
("comingNextB");
16 rmtree
("comingNextC");
19 sed
("comingNext/index.html", 'var version = \"(.*?)\";', 'var version = \"'.$version.'\";');
20 sed
("comingNext/Info.plist", '<key>DisplayName<\/key>(\s*?)<string>ComingNext (.*?)<\/string>', '<key>DisplayName<\/key>$1<string>ComingNext '.$version.'<\/string>');
21 sed
("comingNext/Info.plist", '<key>Version<\/key>(\s*?)<string>(.*?)<\/string>', '<key>Version<\/key>$1<string>'.$version.'<\/string>');
23 # add additional widget
24 copyrecursive
("comingNext", "comingNextB");
25 sed
("comingNextB/index.html", 'var panelNum = 0;', 'var panelNum = 1;');
26 sed
("comingNextB/Info.plist", '<key>DisplayName<\/key>(\s*?)<string>ComingNext (.*?)<\/string>', '<key>DisplayName<\/key>$1<string>ComingNext B $2<\/string>');
27 sed
("comingNextB/Info.plist", '<key>Identifier<\/key>(\s*?)<string>(.*?)<\/string>', '<key>Identifier<\/key>$1<string>$2b<\/string>');
29 # add additional widget
30 copyrecursive
("comingNext", "comingNextC");
31 sed
("comingNextC/index.html", 'var panelNum = 0;', 'var panelNum = 2;');
32 sed
("comingNextC/Info.plist", '<key>DisplayName<\/key>(\s*?)<string>ComingNext (.*?)<\/string>', '<key>DisplayName<\/key>$1<string>ComingNext C $2<\/string>');
33 sed
("comingNextC/Info.plist", '<key>Identifier<\/key>(\s*?)<string>(.*?)<\/string>', '<key>Identifier<\/key>$1<string>$2c<\/string>');
36 my $zip = Archive
::Zip
->new();
37 $zip->addTree("comingNext", "comingNext");
38 $zip->writeToFileNamed("comingNext.wgz");
40 $zip = Archive
::Zip
->new();
41 $zip->addTree("comingNextB", "comingNextB");
42 $zip->writeToFileNamed("comingNextB.wgz");
44 $zip = Archive
::Zip
->new();
45 $zip->addTree("comingNextC", "comingNextC");
46 $zip->writeToFileNamed("comingNextC.wgz");
48 $zip = Archive
::Zip
->new();
49 $zip->addFile("comingNext.wgz");
50 $zip->addFile("comingNextB.wgz");
51 $zip->addFile("comingNextC.wgz");
52 $zip->addFile("Readme.txt");
53 $zip->addFile("License.txt");
54 $zip->addFile("ComingNext_SkinFetcher_v1.5.sisx");
55 $zip->writeToFileNamed("comingNext_v$version.zip");
57 #########################################
62 my ($source, $target) = @_;
63 $copy_source = $source;
64 $copy_target = $target;
65 find
({ wanted
=> \
©_files
, follow
=> 1, no_chdir
=> 1 }, $copy_source );
68 my $targetdir = $File::Find
::dir
;
69 $targetdir =~ s/^$copy_source/$copy_target/o;
70 mkpath
( $targetdir, 1 ) if not -d
$targetdir;
71 return if -d
$File::Find
::name
;
72 my $targetfile = $File::Find
::name
;
73 $targetfile =~ s/^$copy_source/$copy_target/o;
74 print "copy $targetfile\n";
75 copy
($File::Find
::name
, $targetfile);
78 #########################################
81 my ($filename, $search, $replace) = @_;
82 my $delim = $^O
eq "MSWin32" ?
"\"" : "'";
83 system("perl -p -i.bak -e ".$delim."s/$search/$replace/;".$delim." $filename");
84 unlink <$filename.bak
>;