sources: source itself controls cache sub-dir
Instead of supplying the full cache dir, i.e. the directory in the store where the source will place the fetched resources, to the source, only supply the root folder of the cache and let the source itself create the desired sub-directory. This allows the source to determine what type of resource it provides. This makes the final directory independent of the name of the source: a `org.osbuild.curl` source can place file-like resource in the `org.osbuild.files` sub-directory. Then the `org.osbuild.files` input can be used to get those from the cache directory.
This commit is contained in:
parent
dd9099c53a
commit
fa9c288988
3 changed files with 4 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ class Source:
|
|||
|
||||
def download(self, store: ObjectStore, libdir: PathLike):
|
||||
source = self.info.name
|
||||
cache = os.path.join(store.store, "sources", source)
|
||||
cache = os.path.join(store.store, "sources")
|
||||
msg = {
|
||||
"items": self.items,
|
||||
"options": self.options,
|
||||
|
|
@ -73,7 +73,7 @@ class SourcesServer(api.BaseAPI):
|
|||
msg = {
|
||||
"items": {},
|
||||
"options": self.options.get(source, {}),
|
||||
"cache": f"{self.cache}/{source}",
|
||||
"cache": self.cache,
|
||||
"output": f"{self.output}/{source}",
|
||||
"checksums": checksums,
|
||||
"libdir": self.libdir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue