From bdb6bf553596918d0d329670dcc8c370d645608e Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Fri, 28 May 2010 05:25:48 +0000 Subject: Add the beggingings of a perl script to run the update over a whole theme zip file... someoene who knows perl please finish this :D git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26351 a1c6a512-1295-4272-9138-f99709370657 --- utils/skinupdater/skinupdater.c | 21 ++++++++++++++++ utils/skinupdater/updatetheme.pl | 53 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100755 utils/skinupdater/updatetheme.pl diff --git a/utils/skinupdater/skinupdater.c b/utils/skinupdater/skinupdater.c index 982e36a5b7..c354234e27 100644 --- a/utils/skinupdater/skinupdater.c +++ b/utils/skinupdater/skinupdater.c @@ -1,3 +1,24 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: tag_table.c 26346 2010-05-28 02:30:27Z jdgordon $ + * + * Copyright (C) 2010 Jonathan Gordon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + #include #include #include diff --git a/utils/skinupdater/updatetheme.pl b/utils/skinupdater/updatetheme.pl new file mode 100755 index 0000000000..a6c3e20097 --- /dev/null +++ b/utils/skinupdater/updatetheme.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id: wpsbuild.pl 24813 2010-02-21 19:10:57Z kugel $ +# + +# usage: updatetheme.pl theme.zip workingdir [options passed to skinupdater] +use File::Basename; + +$numArgs = $#ARGV + 1; + +die "usage: updatetheme.pl theme.zip workingdir [options passed to skinupdater]" if ($numArgs < 2); + +$ARGV[0] =~ /.*\/(.*).(zip|ZIP)/; #fix this regex! +$theme_name = $1; +$tmp = $ARGV[1]; +$outdir = "$tmp/$theme_name"; + +if ($numArgs > 2) +{ + $args = $ARGV[2]; +} else { + $args = ""; +} + + +system("mkdir $outdir") and die "couldnt mkdir $outdir"; + +# step 1, unzip the theme zip +system("unzip $ARGV[0] -d $outdir") and die; + +#for each skin in the zip run skinupdater +@files = `find $outdir -iname "*.wps" -o -iname "*.sbs" -o -iname "*.fms" -o -iname "*.rwps" -o -iname "*.rsbs" -o -iname "*.rfms"`; +`touch $tmp/changes.diff`; +foreach (@files) +{ + chomp($_); + $file = $_; + $out = "$tmp/" . `basename $file`; chomp($out); + `./skinupdater $args $file $out`; + print "$out"; + `diff -u $file $out >> $tmp/changes.diff`; + `mv $out $file`; + # TODO zip up the new folder.. + +} + + +system("rm -Rf $outdir"); -- cgit v1.2.3