Add support for local packages cache

This commit is contained in:
Daniele Rondina
2020-02-01 19:35:30 +01:00
parent 524bbf990e
commit 78b5963a4f
5 changed files with 75 additions and 53 deletions

View File

@@ -42,3 +42,18 @@ func GetSystemRepoDatabaseDirPath() string {
}
return dbpath
}
func GetSystemPkgsCacheDirPath() (ans string) {
cachepath := "packages"
if config.LuetCfg.GetSystem().PkgsCachePath != "" {
cachepath = config.LuetCfg.GetSystem().PkgsCachePath
}
if filepath.IsAbs(cachepath) {
ans = cachepath
} else {
ans = filepath.Join(GetSystemRepoDatabaseDirPath(), cachepath)
}
return
}