diff options
author | 2010-01-04 21:06:43 +0000 | |
---|---|---|
committer | 2010-01-04 21:06:43 +0000 | |
commit | e111b2deae1f83462b14cdaf912b81f00711aa54 (patch) | |
tree | 1810e5fc5d2e4042f79a1ca7963f88997d9532b9 | |
parent | package_recent changes (diff) | |
download | znurt-org-backend-e111b2deae1f83462b14cdaf912b81f00711aa54.tar.gz znurt-org-backend-e111b2deae1f83462b14cdaf912b81f00711aa54.tar.bz2 znurt-org-backend-e111b2deae1f83462b14cdaf912b81f00711aa54.zip |
checks on package_recent; store finish import time in db
git-svn-id: file:///var/svn/portage@58 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
-rw-r--r-- | import.final.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/import.final.php b/import.final.php index a407695..1312083 100644 --- a/import.final.php +++ b/import.final.php @@ -38,6 +38,17 @@ $db->query($sql); } + $sql = "SELECT COUNT(1) FROM package_recent_arch WHERE status = 1;"; + $count = $db->getOne($sql); + + if($count) { + $sql = "DELETE FROM package_recent_arch WHERE status = 0;"; + $db->query($sql); + + $sql = "UPDATE package_recent_arch SET status = 0 WHERE status = 1;"; + $db->query($sql); + } + // Check for package_mask replacements $sql = "SELECT COUNT(1) FROM package_mask WHERE status = 1;"; $count = $db->getOne($sql); @@ -50,9 +61,17 @@ $sql = "UPDATE package_mask SET status = 0 WHERE status = 1;"; $db->query($sql); - $sql = "UPDATE ebuild_mask SET status = 0 WHERE status = 1;"; - $db->query($sql); } + + $sql = "UPDATE ebuild_mask SET status = 0 WHERE status = 1;"; + $db->query($sql); + // Update the arches to make sure the ones who have ebuilds are active + $sql = "UPDATE arch SET active = (SELECT CASE WHEN id IN (SELECT DISTINCT a.id FROM arch a JOIN ebuild_arch ea ON a.id = ea.arch AND ea.status != 2) THEN true ELSE false END);"; + $db->query($sql); + + // Finalize the import + $sql = "INSERT INTO znurt (action) VALUES ('finish_import');"; + $db->query($sql); ?>
\ No newline at end of file |