Closed RunningDroid closed 1 year ago
It seems to be that in your case, urlwatch
is installed into /usr/sbin/urlwatch
instead of /usr/bin/urlwatch
(or that /usr/sbin
appears first in your $PATH
, and on Void Linux, /usr/sbin
is a symlink to /usr/bin
?).
In order to determine whether the program is run from a source checkout or a system-wide installation, this is used (the assumption here is that if the urlwatch
script is in a folder named bin
, assume system-wide installation, otherwise assume a source checkout):
Both prefix
and bindir
from the code snippet above are then used to construct a path to the examples:
There are multiple ways to fix this:
/usr/bin
appears before /usr/sbin
in your $PATH
== 'bin'
to in ('bin', 'sbin')
to support cases where it's launched from sbin
os.path.realpath()
to remove symlinks in the pathbin
, try to detect a source checkout insteadI'll try to come up with a workaround. This isn't really a regression, but has been like that since ~ 2008 in urlwatch (according to git blame
), and probably affects Void Linux since July 2015 (according to the blog post linked above) :)
Additional information for the fix in 6b68afbb047060277b00f570345e7e1969266712: Since the urlwatch
script that gets installed system-wide (or in $HOME
if installed via pip install --user
) is different from the urlwatch
script in the source checkout, the special-case handling of that can just go into the urlwatch
script. Also cleaned up some other things (e.g. sys.path.insert()
wasn't necessary, as the urlwatch
script was already doing this).
This isn't really a regression, but has been like that since ~ 2008 in urlwatch (according to
git blame
), and probably affects Void Linux since July 2015 (according to the blog post linked above) :)
My bad, I assumed it was a regression because it worked on one machine with urlwatch 2.25 but not on a different machine that I'd updated to urlwatch 2.26. Apparently urlwatch behaved differently because the machine running urlwatch 2.25 had /usr/bin
before /usr/sbin
and the one I'd updated had /usr/sbin
before /usr/bin
.
(I don't know why the paths are ordered differently when all the relevant config files are identical, but that's a separate problem.)
It also opens a blank file instead of opening the example urls.yaml:
Doing
cp /usr/share/urlwatch/examples/urls.yaml.example ~/.config/urlwatch/urls.yaml
works around this for users that have urlwatch installed as a system package.