jw.pkg.App.proj_dir(): Return absolute path

Make App.proj_dir() return an absolute path. This looks like a good
idea, because some of the $(call proj_query xxx) paths end up being
relative, because they get proj_dir()'s idea of a directory
prepended. This prohibits caching them in $(TOPDIR)/make/.cache.mk
for make benefit glorious nation of performance.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-22 13:45:47 +01:00
commit c8c5788aeb

View file

@ -101,11 +101,11 @@ class App(Base):
def proj_dir(self, name):
if name == self.top_name:
return self.topdir
return os.path.abspath(self.topdir)
for d in [ self.projs_root, '/opt' ]:
r = d + '/' + name
if os.path.exists(r):
return r
return os.path.abspath(r)
if os.path.exists(f'/usr/share/doc/packages/{name}/VERSION'):
# The package exists but does not have a dedicated project directory
return None