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
This commit is contained in:
parent
3c1dd03fb3
commit
bdb6bf5535
2 changed files with 74 additions and 0 deletions
|
@ -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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
|
53
utils/skinupdater/updatetheme.pl
Executable file
53
utils/skinupdater/updatetheme.pl
Executable file
|
@ -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");
|
Loading…
Reference in a new issue