diff options
author | Steve Dibb <beandog@gentoo.org> | 2010-01-05 06:06:49 +0000 |
---|---|---|
committer | Steve Dibb <beandog@gentoo.org> | 2010-01-05 06:06:49 +0000 |
commit | 94035ee59f70fa3f97dd7635546a25a9f159fff8 (patch) | |
tree | 9ee16f15b2c47dc67a75194fcf3c5f4e224381a9 /import.ebuild_metadata.php | |
parent | Much more flexibliity on importing package masks, should be self-healing now (diff) | |
download | znurt-org-backend-94035ee59f70fa3f97dd7635546a25a9f159fff8.tar.gz znurt-org-backend-94035ee59f70fa3f97dd7635546a25a9f159fff8.tar.bz2 znurt-org-backend-94035ee59f70fa3f97dd7635546a25a9f159fff8.zip |
add comments; cleanup; cosmetics
git-svn-id: file:///var/svn/portage@65 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
Diffstat (limited to 'import.ebuild_metadata.php')
-rw-r--r-- | import.ebuild_metadata.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/import.ebuild_metadata.php b/import.ebuild_metadata.php index 2ccb6b7..1a39fee 100644 --- a/import.ebuild_metadata.php +++ b/import.ebuild_metadata.php @@ -5,28 +5,40 @@ // $debug = true; + /** + * It may seem a little odd, and to break normalization, to have a query to set the description on the package + * table when it can be queried from the ebuilds. The fact is this is just one of many shortcuts taken, since + * the site is a snapshot, and information like that is not required in realtime. Not to mention it makes + * life a whole lot easier. + */ + require_once 'header.php'; - require_once 'class.portage.tree.php'; + + if(!$tree) { + require_once 'class.portage.tree.php'; + $tree = new PortageTree(); + } + 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); + $arr = $db->getAll($sql); if($verbose) shell::msg(number_format(count($arr))." ebuilds to check"); - foreach($arr as $ebuild_id => $row) { + foreach($arr as $row) { extract($row); - $obj_ebuild = new PortageEbuild("$category/$pf"); + $e = new PortageEbuild("$category_name/$pf"); if($debug) - shell::msg("[$category/".$obj_ebuild->pn."]"); + shell::msg("[$category_name/".$e->pn."]"); - $arr_metadata = $obj_ebuild->metadata(); + $arr_metadata = $e->metadata(); if(count($arr_metadata)) { @@ -34,7 +46,7 @@ if(!empty($value)) { $arr_insert = array( - 'ebuild' => $ebuild_id, + 'ebuild' => $ebuild, 'keyword' => $keyword, 'value' => $value, ); @@ -44,7 +56,7 @@ } } else { if($verbose || $qa) - shell::msg("[QA] No metadata: $category/".$obj_ebuild->pf); + shell::msg("[QA] No metadata: $category_name/".$e->pf); } } |