summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2010-01-05 06:06:49 +0000
committerSteve Dibb <beandog@gentoo.org>2010-01-05 06:06:49 +0000
commit94035ee59f70fa3f97dd7635546a25a9f159fff8 (patch)
tree9ee16f15b2c47dc67a75194fcf3c5f4e224381a9 /import.ebuild_homepage.php
parentMuch more flexibliity on importing package masks, should be self-healing now (diff)
downloadznurt-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_homepage.php')
-rw-r--r--import.ebuild_homepage.php43
1 files changed, 23 insertions, 20 deletions
diff --git a/import.ebuild_homepage.php b/import.ebuild_homepage.php
index 57250f1..85a64c1 100644
--- a/import.ebuild_homepage.php
+++ b/import.ebuild_homepage.php
@@ -1,39 +1,42 @@
<?
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 id, metadata FROM missing_homepage;";
- $arr = $db->getAssoc($sql);
+ $arr_missing_homepage = $db->getAssoc($sql);
if($verbose)
shell::msg(count($arr)." ebuilds to check");
- foreach($arr as $ebuild_id => $homepages) {
-
- if(!empty($homepages))
- $arr = arrHomepages($homepages);
- else {
- $arr = array();
- }
-
- if(count($arr)) {
- foreach($arr as $homepage) {
+ if(count($arr_missing_homepage)) {
+ foreach($arr_missing_homepage as $ebuild => $str) {
+
+ if(!empty($str)) {
+ $arr = arrHomepages($str);
- $arr_insert = array(
- 'ebuild' => $ebuild_id,
- 'homepage' => $homepage,
- );
-
- $db->autoExecute('ebuild_homepage', $arr_insert, MDB2_AUTOQUERY_INSERT);
+ if(count($arr)) {
+ foreach($arr as $url) {
+
+ $arr_insert = array(
+ 'ebuild' => $ebuild,
+ 'homepage' => $url,
+ );
+
+ $db->autoExecute('ebuild_homepage', $arr_insert, MDB2_AUTOQUERY_INSERT);
+ }
+ }
}
}
-
-
}
/**