aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-17 23:59:40 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-17 23:59:48 -0600
commit480a57cf037a46f176128e6c94aa5616fcf704a3 (patch)
tree35be94099e2669f518c623acdf8fe23ee82e55a8 /src/plugins
parent91e1d7f9f03ab3fd77cee94c1eac2abf89254e50 (diff)
Fix Wine prefix deployment, INI handling, and data directory paths
- Fix data directory path to use ~/.var/app/com.fluorine.manager consistently (was ~/.local/share/fluorine in committed code) - Fix VFS helper path in fuseconnector.cpp to use fluorineDataDir() - Fix localAppFolder() to resolve Wine prefix AppData/Local on Linux instead of returning XDG ~/.local/share - Add localAppName() virtual method for correct AppData folder mapping (Enderal→"enderal", Nehrim→"Oblivion") - Fix mergeTweak() to use direct INI parser instead of QSettings which corrupts backslashes and URL-encodes spaces in keys - Make resolveWineDataDirName() more robust with existence checks and fallback chain (documentsDirectory → gameShortName → gameName) - Add comprehensive debug logging throughout Wine prefix deployment - Fix INI case handling: copy instead of symlink for case-mismatched INIs, ensure both proper-case and lowercase aliases exist - Remove native build script (Flatpak only) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/rootbuilder.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/plugins/rootbuilder.py b/src/plugins/rootbuilder.py
index fbe082c..dcc6706 100644
--- a/src/plugins/rootbuilder.py
+++ b/src/plugins/rootbuilder.py
@@ -69,8 +69,20 @@ def _host_cp(src: str, dst: str) -> bool:
return False
+def _ensure_readable(path: str):
+ """Ensure a file has owner-read permission (mod archives sometimes strip it)."""
+ try:
+ st = os.stat(path)
+ if not (st.st_mode & 0o400):
+ os.chmod(path, st.st_mode | 0o400)
+ except OSError:
+ pass
+
+
def _reflink_copy(src: str, dst: str):
"""Copy with reflink (CoW) if supported, fallback to regular copy."""
+ _ensure_readable(src)
+ last_err = None
try:
subprocess.run(
["cp", "--reflink=auto", "-f", "--", src, dst],
@@ -78,16 +90,18 @@ def _reflink_copy(src: str, dst: str):
capture_output=True,
)
return
- except (subprocess.CalledProcessError, FileNotFoundError):
- pass
+ except subprocess.CalledProcessError as e:
+ last_err = f"cp failed (exit {e.returncode}): {e.stderr.decode(errors='replace').strip()}"
+ except FileNotFoundError:
+ last_err = "cp command not found"
try:
shutil.copy2(src, dst)
return
- except OSError:
- pass
+ except OSError as e:
+ last_err = f"{e.strerror} (errno {e.errno})"
if _IN_FLATPAK and _host_cp(src, dst):
return
- raise OSError(f"Root Builder: failed to copy {src} -> {dst}")
+ raise OSError(f"Root Builder: failed to copy {src} -> {dst}: {last_err}")
def _ensure_writable(path: str):