summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2009-12-15 20:44:20 +0000
committerSteve Dibb <beandog@gentoo.org>2009-12-15 20:44:20 +0000
commit09088aa9aee870ff3e9dc490683976d224a68b4b (patch)
tree99637a9cd8193a2c937a3efd0e09d6726055916a /import.ebuild_metadata.php
downloadznurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.tar.gz
znurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.tar.bz2
znurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.zip
initial commit
git-svn-id: file:///var/svn/portage@1 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
Diffstat (limited to 'import.ebuild_metadata.php')
-rw-r--r--import.ebuild_metadata.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/import.ebuild_metadata.php b/import.ebuild_metadata.php
new file mode 100644
index 0000000..7192995
--- /dev/null
+++ b/import.ebuild_metadata.php
@@ -0,0 +1,53 @@
+<?
+
+ $verbose = true;
+ $qa = true;
+
+// $debug = true;
+
+ require_once 'header.php';
+ require_once '../class.portage.tree.php';
+ require_once '../class.portage.category.php';
+ require_once '../class.portage.package.php';
+ require_once '../class.portage.ebuild.php';
+
+ // Find all the ebuilds that are missing ebuild arch
+ $sql = "SELECT * FROM missing_metadata;";
+ $arr = $db->getAssoc($sql);
+
+ if($verbose)
+ shell::msg(number_format(count($arr))." ebuilds to check");
+
+ foreach($arr as $ebuild_id => $row) {
+ extract($row);
+
+ $obj_ebuild = new PortageEbuild("$category/$pf");
+
+ if($debug)
+ shell::msg("[$category/".$obj_ebuild->pn."]");
+
+ $arr_metadata = $obj_ebuild->metadata();
+
+ if(count($arr_metadata)) {
+
+ foreach($arr_metadata as $keyword => $value) {
+
+ if(!empty($value)) {
+ $arr_insert = array(
+ 'ebuild' => $ebuild_id,
+ 'keyword' => $keyword,
+ 'value' => $value,
+ );
+
+ $db->autoExecute('ebuild_metadata', $arr_insert, MDB2_AUTOQUERY_INSERT);
+ }
+ }
+ } else {
+ if($verbose || $qa)
+ shell::msg("[QA] No metadata: $category/".$obj_ebuild->pf);
+ }
+
+
+ }
+
+?> \ No newline at end of file