fix path assertion error

This commit is contained in:
Chris Cromer 2019-07-19 08:32:30 -04:00
parent 3b66f68b2c
commit cd1f361c51
Signed by untrusted user: cromer
GPG Key ID: 39CC813FF3C8708A

View File

@ -306,12 +306,10 @@ namespace Pamac {
lockfile = GLib.File.new_for_path (daemon.get_lockfile ());
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
//try standard lock file
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
try_standard_lock ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
//try standard lock file
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
try_standard_lock ();
}
Timeout.add (200, check_extern_lock);
// wait 30 seconds before check updates
@ -325,6 +323,16 @@ namespace Pamac {
this.hold ();
}
private try_standard_lock () {
try {
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
}
public override void activate () {
// nothing to do
}