Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cleanup when kpatch is installed in read-only location
On NixOS files are installed with mode 444 (read-only). This causes directories in $TEMPDIR to be read-only as well, because they are created by: cp -LR "$DATADIR/patch" "$TEMPDIR" || die which preserves the mode of the directory. We could do --no-preserve=mode, but this will make people with non-coreutils cp unhappy. Instead just chmod the files after copying. If this patch is not applied, cleanup complains like this: rm: cannot remove '/home/julian/.kpatch/tmp/patch/kpatch.h': Permission denied rm: cannot remove '/home/julian/.kpatch/tmp/patch/Makefile': Permission denied rm: cannot remove '/home/julian/.kpatch/tmp/patch/kpatch-macros.h': Permission denied ... Signed-off-by: Julian Stecklina <[email protected]>
- Loading branch information