Browse Source

fix path assertion error

tags/v7.0.1
Chris Cromer 3 months ago
parent
commit
cd1f361c51
Signed by: Chris Cromer <chris@cromer.cl> GPG Key ID: 39CC813FF3C8708A
1 changed files with 12 additions and 4 deletions
  1. 12
    4
      src/pamac-tray/tray.vala

+ 12
- 4
src/pamac-tray/tray.vala 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
}

Loading…
Cancel
Save