]>
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>Coming Next (.*?)<\/string>' , '<key>DisplayName<\/key> $1 <string>Coming Next ' . $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>Coming Next (.*?)<\/string>' , '<key>DisplayName<\/key> $1 <string>Coming Next 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>Coming Next (.*?)<\/string>' , '<key>DisplayName<\/key> $1 <string>Coming Next 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.3.sisx" );
55 $zip -> writeToFileNamed ( "comingNext_v $version .zip" );
57 #########################################
62 my ( $source , $target ) = @_ ;
63 $copy_source = $source ;
64 $copy_target = $target ;
65 find
({ wanted
=> \
& copy_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 ) if not - e
$targetdir ;
71 my $targetfile = $File :: Find
:: name
;
72 $targetfile =~ s/^$copy_source/$copy_target/o ;
73 copy
( $File :: Find
:: name
, $targetfile );
76 #########################################
79 my ( $filename , $search , $replace ) = @_ ;
80 system ( "perl -p -i.bak -e \" s/$search/$replace/; \" $filename " );
81 unlink < $filename . bak
>;