fix: firejail integration
All checks were successful
Pre-commit / pre-commit (pull_request) Successful in 6m39s
Update alr-git / changelog (push) Successful in 32s

use buildContents for correct handling symlinks
This commit is contained in:
2025-07-03 17:29:53 +03:00
parent a600feb083
commit 5e24940ef8
2 changed files with 6 additions and 35 deletions

View File

@ -11,7 +11,7 @@
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text> <text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
<text x="33.5" y="14">coverage</text> <text x="33.5" y="14">coverage</text>
<text x="86" y="15" fill="#010101" fill-opacity=".3">19.2%</text> <text x="86" y="15" fill="#010101" fill-opacity=".3">19.4%</text>
<text x="86" y="14">19.2%</text> <text x="86" y="14">19.4%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 926 B

After

Width:  |  Height:  |  Size: 926 B

View File

@ -240,39 +240,10 @@ func createFirejailedBinary(
return nil, fmt.Errorf("failed to create wrapper script: %w", err) return nil, fmt.Errorf("failed to create wrapper script: %w", err)
} }
profile, err := getContentFromPath(dest, dirs.PkgDir) return buildContents(pkg, dirs, &[]string{
if err != nil { origFilePath,
return nil, err dest,
} })
bin, err := getContentFromPath(origFilePath, dirs.PkgDir)
if err != nil {
return nil, err
}
return []*files.Content{
bin,
profile,
}, nil
}
func getContentFromPath(path, base string) (*files.Content, error) {
absPath := filepath.Join(base, path)
fi, err := os.Lstat(absPath)
if err != nil {
return nil, fmt.Errorf("failed to get file info: %w", err)
}
return &files.Content{
Source: absPath,
Destination: path,
FileInfo: &files.ContentFileInfo{
MTime: fi.ModTime(),
Mode: fi.Mode(),
Size: fi.Size(),
},
}, nil
} }
func generateSafeName(destination string) (string, error) { func generateSafeName(destination string) (string, error) {