matlink / gplaycli

Google Play Downloader via Command line
Other
1.01k stars 178 forks source link

install gplaycli.conf into /etc #242

Closed blshkv closed 4 years ago

blshkv commented 4 years ago

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.

matlink commented 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.

blshkv commented 4 years ago

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.

blshkv commented 4 years ago

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.

matlink commented 4 years ago

The problem is that I need to distinguish whether the installation is running with --user or not (using pip).

matlink commented 4 years ago

That poses some issues:

enovella commented 4 years ago

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
matlink commented 4 years ago

use your own credentials and disable token dispenser. And post in the correct issue please.

matlink commented 4 years ago

@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.

blshkv commented 4 years ago

Packet manager does handle it, if it is getting installed into a system dir.

matlink commented 4 years ago

So /usr/local/etc/gplaycli/gplaycli.conf looks good to you?

matlink commented 4 years ago

check the 'dev' branch, the building process (make deb) now install the config in /etc.

blshkv commented 4 years ago

I have reviewed the change, looks good. The code has been changed to the following:

data_files=[
            ['etc/gplaycli', ['gplaycli.conf']],
        ],