3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 # $Id: wpsbuild.pl 24813 2010-02-21 19:10:57Z kugel $
11 # usage: updatetheme.pl theme.zip workingdir [options passed to skinupdater]
14 $numArgs = $#ARGV + 1;
16 die "usage: updatetheme.pl theme.zip workingdir [options passed to skinupdater]" if ($numArgs < 2);
18 $ARGV[0] =~ /.*\/(.*).(zip
|ZIP
)/; #fix this regex!
21 $outdir = "$tmp/$theme_name";
31 system("mkdir $outdir") and die "couldnt mkdir $outdir";
33 # step 1, unzip the theme zip
34 system("unzip $ARGV[0] -d $outdir") and die;
36 #for each skin in the zip run skinupdater
37 @files = `find $outdir -iname "*.wps" -o -iname "*.sbs" -o -iname "*.fms" -o -iname "*.rwps" -o -iname "*.rsbs" -o -iname "*.rfms"`;
38 `touch $tmp/theme_name.diff`;
43 $out = "$tmp/" . `basename $file`; chomp($out);
44 `./skinupdater $args $file $out`;
45 `diff -u $file $out >> $tmp/$theme_name.diff`;
49 `cd $outdir && zip -r $tmp/$theme_name.zip .`;
52 system("rm -Rf $outdir");