diff options
author | 2010-01-02 19:23:05 +0000 | |
---|---|---|
committer | 2010-01-02 19:23:05 +0000 | |
commit | 26e48d6b1d8b00a34b7042fe3d0fe6a53c713ee7 (patch) | |
tree | 390a1dcee335741b48959626d6f8d3d93f6b8804 | |
parent | new function, package_description (diff) | |
download | znurt-org-backend-26e48d6b1d8b00a34b7042fe3d0fe6a53c713ee7.tar.gz znurt-org-backend-26e48d6b1d8b00a34b7042fe3d0fe6a53c713ee7.tar.bz2 znurt-org-backend-26e48d6b1d8b00a34b7042fe3d0fe6a53c713ee7.zip |
cleanup
git-svn-id: file:///var/svn/portage@43 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
-rw-r--r-- | import.use_local.php | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/import.use_local.php b/import.use_local.php index 36db97e..5b7f6ca 100644 --- a/import.use_local.php +++ b/import.use_local.php @@ -5,9 +5,9 @@ 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 'class.db.mtime.php'; + require_once 'class.db.use.php'; + require_once 'class.db.package_use.php'; require_once 'File/Find.php'; $tree = new PortageTree(); @@ -21,29 +21,35 @@ $dbmtime = new DBMtime($u->filename); + $import = false; + if(is_null($dbmtime->mtime)) { $dbmtime->mtime = $dbmtime->filemtime; + $import = true; } elseif($filemtime > $dbmtime->mtime) { $dbmtime->mtime = $filemtime; + $import = true; } - 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; - - - } - } + if($import) { + 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 |