archive,hookfiles: convert paths to usr-merge when necessary (MR 39)

Co-authored-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Clayton Craft
2024-05-16 10:17:59 -07:00
parent af9a0f0ca5
commit 81de8b438d
4 changed files with 78 additions and 1 deletions

View File

@@ -237,7 +237,10 @@ func (archive *Archive) AddItemsExclude(flister filelist.FileLister, exclude fil
// Adds the given file or directory at "source" to the archive at "dest"
func (archive *Archive) AddItem(source string, dest string) error {
if osutil.HasMergedUsr() {
source = osutil.MergeUsr(source)
dest = osutil.MergeUsr(dest)
}
sourceStat, err := os.Lstat(source)
if err != nil {
e, ok := err.(*os.PathError)