MCPcopy Create free account
hub / github.com/archlinux-de/pkgstats-cli / createPacmanDBPath

Function createPacmanDBPath

cmd/testhelper_pacman_test.go:35–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func createPacmanDBPath(t *testing.T) string {
36 t.Helper()
37
38 dbPath := t.TempDir()
39 localDir := filepath.Join(dbPath, "local")
40 if err := os.Mkdir(localDir, 0o700); err != nil {
41 t.Fatalf("Failed to create local directory: %v", err)
42 }
43
44 subdirs := []string{
45 "pacman-1.0-1",
46 "pacman-mirrorlist-2.0-2",
47 "secret-package-1.0.0-1",
48 "my-app-dev-2.0-1",
49 "app-123.pkg-1.0-1",
50 }
51
52 for _, dir := range subdirs {
53 subdirPath := filepath.Join(localDir, dir)
54 err := os.Mkdir(subdirPath, 0o700)
55 if err != nil {
56 t.Fatalf("Failed to create subdirectory %s: %v", dir, err)
57 }
58 }
59
60 return dbPath
61}
62
63func createPkgstatsConf(t *testing.T, packages []string, mirrors []string) string {
64 t.Helper()

Callers 1

createPacmanConfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected