Skip to content
Snippets Groups Projects
Commit a58abd08 authored by guinux's avatar guinux
Browse files

auto run pacman-db-upgrade if needed

parent 7c2aa359
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,14 @@ class AlpmConfig {
public Alpm.Handle? get_handle () {
Alpm.Errno error;
Alpm.Handle? handle = new Alpm.Handle (rootdir, dbpath, out error);
if (error == Alpm.Errno.DB_VERSION) {
try {
Process.spawn_command_line_sync ("pacman-db-upgrade", null, null, null);
} catch (SpawnError e) {
stdout.printf ("Error: %s\n", e.message);
}
handle = new Alpm.Handle (rootdir, dbpath, out error);
}
if (handle == null) {
stderr.printf ("Failed to initialize alpm library" + " (%s)\n".printf (Alpm.strerror (error)));
return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment