summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'import.ebuilds.php')
-rw-r--r--import.ebuilds.php28
1 files changed, 23 insertions, 5 deletions
diff --git a/import.ebuilds.php b/import.ebuilds.php
index 450ff27..0eae3a5 100644
--- a/import.ebuilds.php
+++ b/import.ebuilds.php
@@ -20,17 +20,36 @@
* For now, you're going to have to manually flip some bits to get it to correct mistakes
* like that. It's too much of a pain to have it check for it (at this point).
*/
+
+ /**
+ * This script is similar to the package one, in that it will create a temporary file
+ * and set the mtime to the last package, and then look for any new changes. Makes the
+ * find utility do all the heavy lifting, and is much simpler.
+ *
+ * Also, this updates the DB with the mtime of both the actual ebuild and the cache file.
+ * It seems like they are usually the same mtime, though.
+ *
+ * While it may seem odd, any time an ebuild is "changed" (as in, the mtime is different), it is
+ * actually re-inserted as a new ebuild all over again. It would be too much work to go
+ * through all the scripts and compare differences between old and new data; it is far easier to
+ * simply re-import the data as if it was newly created. New ebuilds are flagged with a status of 1
+ * and should be ignored by the website. Unchanged ebuilds are flagged with a status of 0 and ones
+ * marked for removal with a 2. The website should always pull the ones where the status is 0 or 2.
+ *
+ */
// $verbose = true;
// $debug = false;
// $all = false;
- if($debug) {
- $verbose = true;
- }
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';
@@ -62,7 +81,6 @@
}
}
- $tree = new PortageTree();
$categories = $tree->getCategories();
$arr_import = array();