Add support for same-owner config option

This commit is contained in:
Daniele Rondina
2020-02-01 17:58:23 +01:00
parent 96f4a6c0e3
commit 524bbf990e
6 changed files with 107 additions and 27 deletions

View File

@@ -31,6 +31,7 @@ import (
"strings"
"sync"
. "github.com/mudler/luet/pkg/config"
"github.com/mudler/luet/pkg/helpers"
. "github.com/mudler/luet/pkg/logger"
"github.com/mudler/luet/pkg/solver"
@@ -294,14 +295,15 @@ func (a *PackageArtifact) Unpack(dst string, keepPerms bool) error {
return errors.Wrap(err, "Cannot copy to "+a.GetPath()+".uncompressed")
}
err = helpers.Untar(a.GetPath()+".uncompressed", dst, keepPerms)
err = helpers.Untar(a.GetPath()+".uncompressed", dst,
LuetCfg.GetGeneral().SameOwner)
if err != nil {
return err
}
return nil
// Defaults to tar only (covers when "none" is supplied)
default:
return helpers.Untar(a.GetPath(), dst, keepPerms)
return helpers.Untar(a.GetPath(), dst, LuetCfg.GetGeneral().SameOwner)
}
return errors.New("Compression type must be supplied")
}