This commit is contained in:
guinux
2017-06-03 14:46:08 +02:00
parent 57acdc25f3
commit bd81be2659
2 changed files with 46 additions and 50 deletions

View File

@@ -134,7 +134,7 @@ class AlpmConfig {
}
}
public Alpm.Handle? get_handle () {
public Alpm.Handle? get_handle (bool files_db = false) {
Alpm.Errno error;
Alpm.Handle? handle = new Alpm.Handle (rootdir, dbpath, out error);
if (error == Alpm.Errno.DB_VERSION) {
@@ -150,6 +150,9 @@ class AlpmConfig {
return null;
}
// define options
if (files_db) {
handle.dbext = ".files";
}
handle.logfile = logfile;
handle.gpgdir = gpgdir;
handle.arch = arch;
@@ -195,20 +198,6 @@ 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);