summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEudyptula <eitan@mosenkis.net>2009-07-06 16:08:33 -0400
committerEudyptula <eitan@mosenkis.net>2009-07-06 16:08:33 -0400
commit8142c45b618eaa99f3380c2e0714e95d87e14ee2 (patch)
treeec1461d218b966307dd0239dbf362888ed600b55 /update_gentoo_profiles.php
parentAdd javascript-based searching to package adding stage (diff)
downloadingenue-8142c45b618eaa99f3380c2e0714e95d87e14ee2.tar.gz
ingenue-8142c45b618eaa99f3380c2e0714e95d87e14ee2.tar.bz2
ingenue-8142c45b618eaa99f3380c2e0714e95d87e14ee2.zip
Stored all data from Packages files in the db to allow frontend/backend separation; created script to update db cache of available packages; renamed profiles -> gentoo_profiles for proper modularity
Diffstat (limited to 'update_gentoo_profiles.php')
-rwxr-xr-xupdate_gentoo_profiles.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/update_gentoo_profiles.php b/update_gentoo_profiles.php
new file mode 100755
index 0000000..545b08f
--- /dev/null
+++ b/update_gentoo_profiles.php
@@ -0,0 +1,14 @@
+#!/usr/bin/php
+<?php
+require_once(dirname(__FILE__).'/shared/include/includes.php'); // USE __DIR__ in 5.3.0
+require_once(SHARED.'/config.php');
+require_once(SHARED.'/include/dbinit.php');
+$pdo=&$S['pdo'];
+$r=$pdo->query('SELECT * FROM `gentoo_profiles`'.(isset($argv[1])?' WHERE `name` LIKE "%'.$argv[1].'%" OR `pkgdir` LIKE "%'.$argv[1].'%"':''));
+while ($p=$r->fetch(PDO::FETCH_ASSOC)) {
+ $p=new sql_gentoo_profile($p);
+ echo 'Updating from '.$conf['pkgdir_root'].'/'.$p->pkgdir.'/Packages...';
+ list($new, $updated)=$p->read_Packages(true);
+ echo "done\nPackages: $new new, $updated updated.\n";
+}
+?>