summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2010-03-25 09:36:56 -0600
committerSteve Dibb <beandog@gentoo.org>2010-03-25 09:36:56 -0600
commit21a8170b0108a308ade3e3a09c48bd7e39730aa2 (patch)
treef96cefcf7daec38945917604f0fbed470c30b6fb
parentTrack import status in DB (diff)
downloadznurt-org-backend-21a8170b0108a308ade3e3a09c48bd7e39730aa2.tar.gz
znurt-org-backend-21a8170b0108a308ade3e3a09c48bd7e39730aa2.tar.bz2
znurt-org-backend-21a8170b0108a308ade3e3a09c48bd7e39730aa2.zip
Properly flag ebuilds to be deleted, using class (also fixes bug where wrong var was being passed in, and not deleted at all)
-rw-r--r--import.ebuild_depend.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/import.ebuild_depend.php b/import.ebuild_depend.php
new file mode 100644
index 0000000..d7817be
--- /dev/null
+++ b/import.ebuild_depend.php
@@ -0,0 +1,24 @@
+<?
+
+ require_once 'header.php';
+
+// $sql = "SELECT REGEXP_SPLIT_TO_TABLE(value, E'(\\\\(|\\\\))') AS value FROM ebuild_metadata WHERE keyword IN ('depend', 'rdepend') LIMIT 22;";
+//
+// $sql = "SELECT REGEXP_SPLIT_TO_TABLE(value, E'(!?\\[0-9a-z_-]+\\\\?|\\\\(|\\\\))') AS value FROM ebuild_metadata WHERE keyword IN ('depend', 'rdepend') LIMIT 22;";
+//
+// $arr = $db->getCol($sql);
+//
+// print_r($arr);
+// die;
+
+// $sql = "CREATE TEMP TABLE tmp_depend AS SELECT ebuild, REGEXP_SPLIT_TO_TABLE(value, E'\\\\s+') AS value, keyword FROM ebuild_metadata WHERE keyword IN ('depend', 'rdepend');";
+ $sql = "CREATE TEMP TABLE tmp_depend AS SELECT id AS ebuild, REGEXP_SPLIT_TO_TABLE(metadata, E'\\\\s+') AS value, type AS keyword FROM missing_depend;";
+ $db->query($sql);
+
+ $sql= "DELETE FROM tmp_depend WHERE value NOT LIKE '%/%';";
+ $db->query($sql);
+
+ $sql = "INSERT INTO ebuild_depend (ebuild, package, type) SELECT ebuild, package_id(value), keyword FROM tmp_depend WHERE package_id(value) IS NOT NULL;";
+ $db->query($sql);
+
+?> \ No newline at end of file