From 9f3d8b58161d37ae50e66261bf50111aedf17040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= Date: Sun, 7 Jul 2024 17:06:31 +0200 Subject: [PATCH 1/2] archive: user path expansion for local archive Apply user path expansion to the given path of a "file" archive backend. This could be used to place an artifact cache in the user directory, e.g. in "~/.cache/bob/artifacts". --- pym/bob/archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/bob/archive.py b/pym/bob/archive.py index fea7eb37..bd62fc3d 100644 --- a/pym/bob/archive.py +++ b/pym/bob/archive.py @@ -646,7 +646,7 @@ def close(self): class LocalArchive(BaseArchive): def __init__(self, spec): super().__init__(spec) - self.__basePath = os.path.abspath(spec["path"]) + self.__basePath = os.path.abspath(os.path.expanduser(spec["path"])) self.__fileMode = spec.get("fileMode") self.__dirMode = spec.get("directoryMode") From d1f9ebc0023edda1f6c44ed09f342b4cc35d1811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= Date: Sun, 7 Jul 2024 17:10:55 +0200 Subject: [PATCH 2/2] doc: document user path expansion in file archive backend --- doc/manual/configuration.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/manual/configuration.rst b/doc/manual/configuration.rst index 547f71d6..069c438d 100644 --- a/doc/manual/configuration.rst +++ b/doc/manual/configuration.rst @@ -2085,9 +2085,11 @@ azure Microsoft Azure Blob storage backend. The account must be specified Finally the container must be given in ``container``. Requires the ``azure-storage-blob`` Python3 library to be installed. file Use a local directory as binary artifact repository. The directory - is specified in the ``path`` key as absolute path. The optional - ``fileMode`` and ``directoryMode`` keys take the desired access - modes as numeric value to override the default umask derived modes. + should be specified in the ``path`` key as absolute path. An + initial ``~`` or ``~user`` component is replaced by the users home + directory. The optional ``fileMode`` and ``directoryMode`` keys + take the desired access modes as numeric value to override the + default umask derived modes. http Uses a HTTP server as binary artifact repository. The server has to support the HEAD, PUT and GET methods. The base URL is given in the ``url`` key. The optional ``sslVerify`` boolean key controls