From e70cdbaaf7b77098cb90e6cfde7f9e8bd054dc6c Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Sun, 8 Nov 2020 00:00:15 +0100 Subject: [PATCH] Respect rootfs on repositories urls --- pkg/installer/client/local.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/installer/client/local.go b/pkg/installer/client/local.go index 6e1a41cb..351c9145 100644 --- a/pkg/installer/client/local.go +++ b/pkg/installer/client/local.go @@ -38,15 +38,26 @@ func NewLocalClient(r RepoData) *LocalClient { func (c *LocalClient) DownloadArtifact(artifact compiler.Artifact) (compiler.Artifact, error) { var err error + rootfs := "" artifactName := path.Base(artifact.GetPath()) cacheFile := filepath.Join(config.LuetCfg.GetSystem().GetSystemPkgsCacheDirPath(), artifactName) + if !config.LuetCfg.ConfigFromHost { + rootfs, err = config.LuetCfg.GetSystem().GetRootFsAbs() + if err != nil { + return nil, err + } + } + // Check if file is already in cache if helpers.Exists(cacheFile) { Info("Use artifact", artifactName, "from cache.") } else { ok := false for _, uri := range c.RepoData.Urls { + + uri = filepath.Join(rootfs, uri) + Info("Downloading artifact", artifactName, "from", uri) //defer os.Remove(file.Name())