Closed Niols closed 2 months ago
You're welcome! I hope you find it useful.
I've known about this issue for a while, but I haven't found a solution. I use the same work-around ;)
The only way I've been able to address this is with a reimplementation of the mapping code. I believe I used rsync. I probably still have that code in a branch, but I've been hesitant to merge it, even after writing unit tests.
I'll have to revisit this.
If you bring back this code, I'll happily have another look myself. I am not an rsync
expert but it does look like the right tool for a job like this. I could otherwise suggest a modification to the current mapping code that should do it, but that would be yet again more code, and I'm not sure that this is the right way to proceed.
Fixed in 87641eed8d937b196d33a87bcde05ec4f2d3025f
Indeed, looks great!
In some cases,
fileMap
only works if the base name of both components is the same. For instance, if the map looks like:and
B
is a directory, then loadingA
into the temporary Wine directoryB
works fine (and, the very first time, does nothing). However, persistingB
intoA
does not work and the files will be persisted to$HOME/.config/B
instead. The culprit is the functionpersist_file
:https://github.com/emmanuelrosa/erosanix/blob/90f5e8e345d940d74cad215b0b59eb2f83682383/pkgs/mkwindowsapp/default.nix#L189-L206
When the source
$s
is a directory (line 202), then we runcp -v -r -n "$s" "$base_dir"
, wherebase_dir=$(dirname "$d")
. In the example:so we run:
which indeed creates
$HOME/.config/B
instead of$HOME/.config/A
.A mitigation is of course to ensure
A == B
, and this is what I use for now.Thank you for this app, by the way — it's amazing!