diff options
author | 2009-12-18 05:56:38 +0000 | |
---|---|---|
committer | 2009-12-18 05:56:38 +0000 | |
commit | 80a889bb3bc5c614de2c6e9591eba271a4f431e9 (patch) | |
tree | 40e19f98d6b69c6265d5d7456f40e6977cde108c /import.use_local.php | |
parent | git-svn-id: file:///var/svn/portage@2 3218660a-b0cf-4799-a991-8ddcc5b9e0f3 (diff) | |
download | znurt-org-backend-80a889bb3bc5c614de2c6e9591eba271a4f431e9.tar.gz znurt-org-backend-80a889bb3bc5c614de2c6e9591eba271a4f431e9.tar.bz2 znurt-org-backend-80a889bb3bc5c614de2c6e9591eba271a4f431e9.zip |
updates
git-svn-id: file:///var/svn/portage@3 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
Diffstat (limited to 'import.use_local.php')
-rw-r--r-- | import.use_local.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/import.use_local.php b/import.use_local.php new file mode 100644 index 0000000..36db97e --- /dev/null +++ b/import.use_local.php @@ -0,0 +1,49 @@ +<? + + require_once 'header.php'; + require_once 'class.portage.tree.php'; + require_once 'class.portage.use_flag.php'; + require_once 'class.portage.ebuild.php'; + require_once 'class.portage.atom.php'; + require_once '/home/steve/svn/znurt/class.db.mtime.php'; + require_once '/home/steve/svn/znurt/class.db.use.php'; + require_once '/home/steve/svn/znurt/class.db.package_use.php'; + require_once 'File/Find.php'; + + $tree = new PortageTree(); + + // Local use flags + $type = 'local'; + $u = new PortageUseFlag($type); + $filemtime = filemtime($u->filename); + $arr_use_flags[$type] = $u->getUseFlags(); + $keys = array_keys($arr_use_flags[$type]); + + $dbmtime = new DBMtime($u->filename); + + if(is_null($dbmtime->mtime)) { + $dbmtime->mtime = $dbmtime->filemtime; + } elseif($filemtime > $dbmtime->mtime) { + $dbmtime->mtime = $filemtime; + } + + foreach($arr_use_flags[$type] as $cp => $arr_package_use_flags) { + + $sql = "SELECT package FROM view_package WHERE cp = ".$db->quote($cp).";"; + $package = $db->getOne($sql); + + foreach($arr_package_use_flags as $name => $arr) { + extract($arr); + + $dbuse = new DBUse($name, 'local', $cp); + + $dbpackage_use = new DBPackageUse($package, $dbuse->id); + + if($dbpackage_use->description != $description) + $dbpackage_use->description = $description; + + + } + } + +?>
\ No newline at end of file |