Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Plan for skin changeover?

Re: Plan for skin changeover?

From: Maurus Cuelenaere <mcuelenaere_at_gmail.com>
Date: Wed, 02 Jun 2010 00:06:38 +0200

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
aaa