add files db support

This commit is contained in:
guinux
2017-03-03 12:21:27 +01:00
parent a00d5ca83c
commit bfee1fcc52
5 changed files with 109 additions and 32 deletions

View File

@@ -187,6 +187,20 @@ class AlpmConfig {
return handle;
}
public Alpm.Handle? get_files_handle () {
Alpm.Handle? handle = new Alpm.Handle (rootdir, dbpath, null);
if (handle == null) {
return null;
}
// define options
handle.dbext = ".files";
// register dbs
foreach (unowned AlpmRepo repo in repo_order) {
handle.register_syncdb (repo.name, 0);
}
return handle;
}
void parse_file (string path, string? section = null) {
string? current_section = section;
var file = GLib.File.new_for_path (path);