Skip to content

Commit

Permalink
ulwgl_util: fix bug for copyfile arguments
Browse files Browse the repository at this point in the history
- Changes the second argument for copyfile, as the second should not be joined.

- When failing to make a shallow copy on a non-CoW filesystem, we fallback to normal copying by utilizing the shutil module. However, the second argument was wrong, as the state of the parameters are simply the files themselves that should be copied to the destination. For instance:

/usr/share/ULWGL/run-in-sniper             (source)
/home/foo/.local/share/ULWGL/run-in-sniper (destination)
  • Loading branch information
R1kaB3rN committed Feb 25, 2024
1 parent 32aef7d commit 932935d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ulwgl_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def copyfile_reflink(src: Path, dst: Path) -> None:
raise
if e.errno == ENOSYS:
# Fallback to normal copy
copyfile(src.as_posix(), dst.joinpath(src.name).as_posix())
copyfile(src.as_posix(), dst.as_posix())

dst.chmod(src.stat().st_mode)

Expand Down

0 comments on commit 932935d

Please sign in to comment.