getCategories(); $arr_diff = importDiff($table, $arr); if(count($arr_diff['delete'])) { foreach($arr_diff['delete'] as $name) { $sql = "DELETE FROM $table WHERE name = ".$db->quote($name).";"; shell::msg($sql); $db->query($sql); } } if(count($arr_diff['insert'])) { foreach($arr_diff['insert'] as $name) { $arr_insert = array('name' => $name); $db->autoExecute($table, $arr_insert, MDB2_AUTOQUERY_INSERT); } } // FIXME I should check the mtimes of the directories // instead, just to get an idea of when things were // last changed. Also, store the metadata mtime. // Update descriptions if($verbose) shell::msg("Updating descriptions"); $sql = "SELECT name, id FROM category;"; $arr = $db->getAssoc($sql); foreach($arr as $category_name => $category) { $db_category = new DBCategory($category); $c = new PortageCategory($category_name); if($db_category->description != $c->description['en']) $db_category->description = $c->description['en']; } ?>