mirror of
https://github.com/mudler/luet.git
synced 2025-06-28 08:18:46 +00:00
Respect rootfs on repositories urls
This commit is contained in:
parent
eea9dad2c6
commit
e70cdbaaf7
@ -38,15 +38,26 @@ func NewLocalClient(r RepoData) *LocalClient {
|
|||||||
func (c *LocalClient) DownloadArtifact(artifact compiler.Artifact) (compiler.Artifact, error) {
|
func (c *LocalClient) DownloadArtifact(artifact compiler.Artifact) (compiler.Artifact, error) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
rootfs := ""
|
||||||
artifactName := path.Base(artifact.GetPath())
|
artifactName := path.Base(artifact.GetPath())
|
||||||
cacheFile := filepath.Join(config.LuetCfg.GetSystem().GetSystemPkgsCacheDirPath(), artifactName)
|
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
|
// Check if file is already in cache
|
||||||
if helpers.Exists(cacheFile) {
|
if helpers.Exists(cacheFile) {
|
||||||
Info("Use artifact", artifactName, "from cache.")
|
Info("Use artifact", artifactName, "from cache.")
|
||||||
} else {
|
} else {
|
||||||
ok := false
|
ok := false
|
||||||
for _, uri := range c.RepoData.Urls {
|
for _, uri := range c.RepoData.Urls {
|
||||||
|
|
||||||
|
uri = filepath.Join(rootfs, uri)
|
||||||
|
|
||||||
Info("Downloading artifact", artifactName, "from", uri)
|
Info("Downloading artifact", artifactName, "from", uri)
|
||||||
|
|
||||||
//defer os.Remove(file.Name())
|
//defer os.Remove(file.Name())
|
||||||
|
Loading…
Reference in New Issue
Block a user