diff options
author | Steve Dibb <beandog@gentoo.org> | 2009-12-15 20:44:20 +0000 |
---|---|---|
committer | Steve Dibb <beandog@gentoo.org> | 2009-12-15 20:44:20 +0000 |
commit | 09088aa9aee870ff3e9dc490683976d224a68b4b (patch) | |
tree | 99637a9cd8193a2c937a3efd0e09d6726055916a /import.arches.php | |
download | znurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.tar.gz znurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.tar.bz2 znurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.zip |
initial commit
git-svn-id: file:///var/svn/portage@1 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
Diffstat (limited to 'import.arches.php')
-rw-r--r-- | import.arches.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/import.arches.php b/import.arches.php new file mode 100644 index 0000000..7ef209b --- /dev/null +++ b/import.arches.php @@ -0,0 +1,29 @@ +<? + + require_once 'header.php'; + require_once '../class.portage.tree.php'; + + $tree = new PortageTree(); + + $arr_arches = $tree->getArches(); + + $arr = importDiff('arch', $arr_arches); + + if(count($arr['delete'])) { + foreach($arr['delete'] as $name) { + $sql = "DELETE FROM arch WHERE name = ".$db->quote($name).";"; + shell::msg($sql); + $db->query($sql); + } + } + + if(count($arr['insert'])) { + foreach($arr['insert'] as $name) { + $arr_insert = array('name' => $name); + $db->autoExecute('arch', $arr_insert, MDB2_AUTOQUERY_INSERT); + } + } + + unset($arr); + +?>
\ No newline at end of file |