]> git.ipfire.org Git - pbs.git/commitdiff
buildservice: Fix converting paths to URLs
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Jul 2025 18:31:03 +0000 (18:31 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Jul 2025 18:31:03 +0000 (18:31 +0000)
The relpath() function only works on absolute URLs. If we did not get
one of those, we need to call path() first to make it absolute.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/__init__.py

index 1fd18ebba4b8330ba5ae3c064482eb451d9aeb78..eb7073edc8717cddbb9317eddad188f0e860953d 100644 (file)
@@ -194,6 +194,10 @@ class Backend(object):
                """
                        Takes a path to a file on the file system and converts it into a URL
                """
+               # Make the path absolute
+               if not path.startswith("/"):
+                       path = self.path(path)
+
                # Make the path relative
                path = self.relpath(path)