elementary / switchboard-plug-parental-controls

Switchboard Screen Time & Limits Plug
https://elementary.io
GNU General Public License v3.0
11 stars 14 forks source link

PATH in error message different #154

Open davidak opened 2 years ago

davidak commented 2 years ago

What Happened?

I try to build the package so that the config. is saved to /var/lib, because on NixOS /etc is only writable by NixOS itself.

I set the meson flag -Dsysconfdir=var/lib.

I get the runtime issue:

Oct 10 12:50:26 gaming systemd[1]: Starting Pantheon Screen Time & Limits Daemon...
Oct 10 12:50:26 gaming pantheon-parent[95630]: UserConfig.vala:76: Could not find daemon config file: /var/lib/pantheon-parental-controls/daemon.conf does not exist
Oct 10 12:50:26 gaming pantheon-parent[95630]: UserConfig.vala:167: Failed to create file “var/lib/pantheon-parental-controls/daemon.conf.UY40A1”: No such file or directory
Oct 10 12:50:26 gaming systemd[1]: Started Pantheon Screen Time & Limits Daemon.

And here is the issue. From the code, both paths (Constants.DAEMON_CONF_FILE) should be the same, but they are printed differently.

I think it's because file.get_path is used here:

https://github.com/elementary/switchboard-plug-parental-controls/blob/49355a30710be1d84e9241fd7b59e1e2d17a38ba/src/daemon/UserConfig.vala#L76

but not here:

https://github.com/elementary/switchboard-plug-parental-controls/blob/49355a30710be1d84e9241fd7b59e1e2d17a38ba/src/daemon/UserConfig.vala#L167

Having the correct output would make debugging the build way more easy.

Steps to Reproduce

  1. Build with meson flag -Dsysconfdir=var/lib
  2. Run
  3. See error

Expected Behavior

Error messages should show the actual path.

OS Version

Other Linux

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

vjr commented 2 years ago

Is there a missing leading slash in -Dsysconfdir=/var/lib before the var?

davidak commented 2 years ago

@vjr yes, but that's not the issue here.