Refactor
This commit is contained in:
parent
599ce03ca4
commit
9b987bcc82
@ -2,7 +2,6 @@ package debian
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"os/user"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -128,13 +127,7 @@ var (
|
|||||||
|
|
||||||
func MatchImagePkg(km config.KernelMask) (pkgs []string, err error) {
|
func MatchImagePkg(km config.KernelMask) (pkgs []string, err error) {
|
||||||
if CachePath == "" {
|
if CachePath == "" {
|
||||||
var usr *user.User
|
CachePath = config.File("debian.cache")
|
||||||
usr, err = user.Current()
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
CachePath = usr.HomeDir + "/.out-of-tree/debian.cache"
|
|
||||||
log.Debug().Msgf("Use default kernels cache path: %s", CachePath)
|
log.Debug().Msgf("Use default kernels cache path: %s", CachePath)
|
||||||
} else {
|
} else {
|
||||||
log.Debug().Msgf("Debian kernels cache path: %s", CachePath)
|
log.Debug().Msgf("Debian kernels cache path: %s", CachePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user