|
@@ -5,6 +5,7 @@ package runtime
|
|
|
|
|
|
import (
|
|
import (
|
|
"path/filepath"
|
|
"path/filepath"
|
|
|
|
+ "runtime"
|
|
"testing"
|
|
"testing"
|
|
|
|
|
|
"github.com/Morganamilo/go-pacmanconf"
|
|
"github.com/Morganamilo/go-pacmanconf"
|
|
@@ -21,13 +22,19 @@ func TestPacmanConf(t *testing.T) {
|
|
absPath, err := filepath.Abs(path)
|
|
absPath, err := filepath.Abs(path)
|
|
require.NoError(t, err)
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
+ // detect the architecture of the system
|
|
|
|
+ expectedArch := []string{"x86_64"}
|
|
|
|
+ if runtime.GOARCH == "arm64" {
|
|
|
|
+ expectedArch = []string{"aarch64"}
|
|
|
|
+ }
|
|
|
|
+
|
|
expectedPacmanConf := &pacmanconf.Config{
|
|
expectedPacmanConf := &pacmanconf.Config{
|
|
RootDir: "/", DBPath: "/var/lib/pacman/",
|
|
RootDir: "/", DBPath: "/var/lib/pacman/",
|
|
CacheDir: []string{"/var/cache/pacman/pkg/"},
|
|
CacheDir: []string{"/var/cache/pacman/pkg/"},
|
|
HookDir: []string{"/etc/pacman.d/hooks/"},
|
|
HookDir: []string{"/etc/pacman.d/hooks/"},
|
|
GPGDir: "/etc/pacman.d/gnupg/", LogFile: "/var/log/pacman.log",
|
|
GPGDir: "/etc/pacman.d/gnupg/", LogFile: "/var/log/pacman.log",
|
|
HoldPkg: []string{"pacman", "glibc"}, IgnorePkg: []string{"xorm"},
|
|
HoldPkg: []string{"pacman", "glibc"}, IgnorePkg: []string{"xorm"},
|
|
- IgnoreGroup: []string{"yorm"}, Architecture: []string{"x86_64"},
|
|
|
|
|
|
+ IgnoreGroup: []string{"yorm"}, Architecture: expectedArch,
|
|
XferCommand: "/usr/bin/wget --passive-ftp -c -O %o %u",
|
|
XferCommand: "/usr/bin/wget --passive-ftp -c -O %o %u",
|
|
NoUpgrade: []string(nil), NoExtract: []string(nil), CleanMethod: []string{"KeepInstalled"},
|
|
NoUpgrade: []string(nil), NoExtract: []string(nil), CleanMethod: []string{"KeepInstalled"},
|
|
SigLevel: []string{"PackageRequired", "PackageTrustedOnly", "DatabaseOptional", "DatabaseTrustedOnly"},
|
|
SigLevel: []string{"PackageRequired", "PackageTrustedOnly", "DatabaseOptional", "DatabaseTrustedOnly"},
|