FS#49840 - [urlwatch] Badly set up directories
Attached to Project:
Community Packages
Opened by felix (fstirlitz) - Saturday, 25 June 2016, 10:55 GMT
Last edited by Balló György (City-busz) - Tuesday, 05 July 2016, 18:47 GMT
Opened by felix (fstirlitz) - Saturday, 25 June 2016, 10:55 GMT
Last edited by Balló György (City-busz) - Tuesday, 05 July 2016, 18:47 GMT
|
Details
$ urlwatch --edit-hooks
Parsing failed: ====== [Errno 2] No such file or directory: '/usr/sbin/share/urlwatch/examples/hooks.py.example' ====== |
This task depends upon
drwxr-xr-x 6 root root 180224 29 jun 18:00 /usr/bin
lrwxrwxrwx 1 root root 3 30 sep 2015 /usr/sbin -> bin
$ sed -ne '56,70p' /usr/bin/urlwatch
# Check if we are installed in the system already
(prefix, bindir) = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0])))
if bindir == 'bin':
# Installed system-wide
examples_dir = os.path.join(prefix, 'share', pkgname, 'examples')
else:
# Assume we are not yet installed
sys.path.insert(0, os.path.join(prefix, bindir, 'lib'))
examples_dir = os.path.join(prefix, bindir, 'share', pkgname, 'examples')
urls_yaml_example = os.path.join(examples_dir, 'urls.yaml.example')
hooks_py_example = os.path.join(examples_dir, 'hooks.py.example')
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
$ ls -ld /usr/bin /usr/sbin
drwxr-xr-x 6 root root 180224 29 jun 18:00 /usr/bin
lrwxrwxrwx 1 root root 3 30 sep 2015 /usr/sbin -> bin
$
And so urlwatch discovers itself at /usr/sbin/urlwatch, which it fails to detect as a system directory.
The solution is to hardcode assuming system-wide installation, since my PATH is my own business.
https://github.com/thp/urlwatch/issues