Rockbox mail archive
Subject: Re: Plan for skin changeover?
Re: Plan for skin changeover?
Op 01-06-10 16:04, Jonathan Gordon schreef:
> On 1 June 2010 21:56, Maurus Cuelenaere <mcuelenaere_at_gmail.com> wrote:
>
>> That shouldn't be really hard, just do something like 'SELECT * FROM targets', assemble the path to the zip and pass it to your converter along with the right args.
>>
>>
> "$ ./updatetheme.pl <zip filename> <working directory>" is the command
> for colour and grey targets. it uses working directory for temp files
> and the output zip file. mono targets just need to add "-m" after the
> <working directory>.
> That script also creates a text diff of the changed files which might
> be useful to email to authors (or at least keep incase somehing breaks
> later) in <working dir>/<theme name>.diff
>
I just tried this on the theme server, it seems to work OK:
<?php
$r = sqlite_open("private/themes.db");
$q = sqlite_query($r, "SELECT * FROM targets");
foreach (sqlite_fetch_all($q, SQLITE_ASSOC) as $row) {
/* This depends on targets with same resolution having same depth */
$targets[$row['mainlcd']] = $row['depth'];
}
$q = sqlite_query($r, "SELECT * FROM themes");
foreach (sqlite_fetch_all($q, SQLITE_ASSOC) as $row) {
$name = sprintf("private/themes/%s/%s/%s", $row['mainlcd'], $row['shortname'], $row['zipfile']);
if (file_exists($name)) {
$cmd = sprintf("updatetheme.pl %s %s/tmp", $name, $targets[$row['mainlcd']] == 1 ? "-m " : "");
echo $cmd."\n"; /* Replace this with exec() */
/* Do something with the diff */
}
}
sqlite_close($r);
?>
--
Maurus Cuelenaere
Received on 2010-06-02
Page was last modified "Jan 10 2012" The Rockbox Crew
|