Skip to content

Commit 9e34c65

Browse files
janvhsDiamond
authored and
Diamond
committed
Fix location of GIR files with root only subdirectories
The some subdirectories of my /usr/ folder can not be opened without root permissions. Therefore, the generation process fails with a permission denied error. This patch instructs the generator to skip those directories.
1 parent d08a1ac commit 9e34c65

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gir/pkgconfig/pkgconfig.go

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ func FindGIRFiles(pkgs ...string) ([]string, error) {
7979

8080
err := fs.WalkDir(os.DirFS(baseDir), ".",
8181
func(path string, d fs.DirEntry, err error) error {
82+
if errors.Is(err, fs.ErrPermission) {
83+
return fs.SkipDir
84+
}
85+
8286
if err != nil {
8387
return err
8488
}

0 commit comments

Comments
 (0)