Closed blshkv closed 4 years ago
There is a patch applied by the Debian package process (see debian/ directory) but it is quite hard to generalize for all distro.
well, we patched it as well, see https://github.com/pentoo/pentoo-overlay/blob/master/app-misc/gplaycli/gplaycli-3.27.ebuild#L27.
/etc is pretty common for all distros. As long as it doesn't go to ~
home folder is fine.
P.S. The software can still create whatever required during runtime in the home directory, or each user should be able to customise config in his local folder overriding the global settings.
The problem is that I need to distinguish whether the installation is running with --user or not (using pip).
That poses some issues:
/etc
and when to use ~/
?/etc
is probably not adapted for Windows and MacOS.Any workaround for this issue?
[INFO] GPlayCli version 3.27 [Python3.6.9]
[INFO] Configuration file is None
[INFO] Device is bacon
[ERROR] Cache file does not exists or is corrupted
[INFO] Retrieving token ...
[INFO] Token URL is https://matlink.fr/token/email/gsfid/bacon
[ERROR] Unknown error: Token-dispenser is unavailable due to IP blacklisted from Google
use your own credentials and disable token dispenser. And post in the correct issue please.
@blshkv I think it is should be required for the package manager to handle the config file, otherwise it will be overwritten by the installation process. Distutils provides a way to install it depending on the installation permissions (system or user) but they are located at /usr/local
and ~/.local
. When an update is release, pip
overwrites the configuration file.
Packet manager does handle it, if it is getting installed into a system dir.
So /usr/local/etc/gplaycli/gplaycli.conf
looks good to you?
check the 'dev' branch, the building process (make deb
) now install the config in /etc
.
I have reviewed the change, looks good. The code has been changed to the following:
data_files=[
['etc/gplaycli', ['gplaycli.conf']],
],
The current idea does not work for linux distro packaging.
If a regular user is installed it using
app_manager install gplaycli
, the config file will be in ~/root folder (most probably). It is even worse in Pentoo Linux (and may be others), because we install it in a sandbox under regular user "portage", so the config file is getting installed into non-existing "home" folder which goes nowhere.I suggest taking with are more common approach: install it into /etc folder by default. Each user can overwrite it with his own config if required.