summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-11-15 16:22:26 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-11-15 16:22:26 -0500
commit0da284dec075c8fb1fa9c78289e336132f348882 (patch)
treea4812fc3607ab113c5de68048b4c20a2b58e2c8c
parent445148827d8f0d144085a19bcb47bc84d0c8b599 (diff)
downloadthemesite-0da284dec075c8fb1fa9c78289e336132f348882.tar.gz
themesite-0da284dec075c8fb1fa9c78289e336132f348882.zip
checkwps: Only check _new_ themes against the last release
For the nightly/post-build stuff, only check the latest wps builds.
-rwxr-xr-xprivate/runcheckwps.php2
-rw-r--r--private/themesite.class.php13
2 files changed, 9 insertions, 6 deletions
diff --git a/private/runcheckwps.php b/private/runcheckwps.php
index 8908e67..627a23e 100755
--- a/private/runcheckwps.php
+++ b/private/runcheckwps.php
@@ -8,5 +8,5 @@ class preconfig {
}
require_once('preamble.inc.php');
-$results = $site->checkallthemes();
+$results = $site->checkallthemes(0, 0); // change the second '0' to '1' to check release too
?>
diff --git a/private/themesite.class.php b/private/themesite.class.php
index 8e6bc6d..8acfaf5 100644
--- a/private/themesite.class.php
+++ b/private/themesite.class.php
@@ -96,7 +96,7 @@ class themesite {
/*
* Run checkwps on all our themes
*/
- public function checkallthemes($id = 0) {
+ public function checkallthemes($id = 0, $release = 0) {
$this->log('Running checkwps');
$sql = 'SELECT * FROM themes WHERE themeid=:id OR (:wmtf AND approved > 0)';
$args = array(':id' => $id, ':wmtf' => $id === 0 ? 1 : 0);
@@ -110,7 +110,7 @@ class themesite {
$theme['shortname'],
$theme['zipfile']
);
- $result = $this->checkwps($zipfile, $theme['mainlcd'], $theme['remotelcd']);
+ $result = $this->checkwps($zipfile, $theme['mainlcd'], $theme['remotelcd'], $release);
/*
* Store the results and check if at least one check passed (for
@@ -626,7 +626,7 @@ END;
$mainlcd,
$shortname
);
-
+
/* Prepend wps- and menu- to screenshots */
$sshot_wps['name'] = empty($sshot_wps['name']) ? '' : 'wps-'.$sshot_wps['name'];
$sshot_menu['name'] = empty($sshot_menu['name']) ? '' : 'menu-'.$sshot_menu['name'];
@@ -680,7 +680,7 @@ END;
);
$result = $this->db->query($sql, $args);
$id = $result->insertid();
- $this->checkallthemes($id);
+ $this->checkallthemes($id, 1); // We want to check it against stable!
$this->log(sprintf("Added theme %d (email: %s)", $id, $email));
return $id;
}
@@ -834,7 +834,7 @@ END;
/*
* Check a WPS against two revisions: current and the latest release
*/
- public function checkwps($zipfile, $mainlcd, $remotelcd) {
+ public function checkwps($zipfile, $mainlcd, $remotelcd, $release = 0) {
$return = array();
/* First, create a temporary dir */
@@ -859,6 +859,9 @@ END;
while($target = $targets->next()){
/* for both versions */
foreach(array('release', 'current') as $version) {
+ if ($release == 0 && $version == 'release') {
+ continue;
+ }
/* for every skin file in the theme */
foreach(glob('.rockbox/wps/*{wps,sbs,fms}',GLOB_BRACE) as $file) {
$p = $this->my_pathinfo($file);