fix: skip data trees a read-only folder refuses

A BIOS folder this user cannot write no longer tries each data tree's archive and blames its URL with a raw errno. The tree is counted failed for the same cause as the BIOS files, so the summary keeps its one line and its advice.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 03:44:17 +01:00
1 parent f8702a19f7
commit 2ecbea56b5
5 files changed
+59 -13

No files matched your search

+27
View File
@@ -951,6 +951,33 @@ class OfflineLeavesFilesMissing(Scratch):
self.assertNotIn("could not read", proc.stderr)
self.assertNotIn("no longer in the source", proc.stdout)
@unittest.skipIf(os.name == "nt" or os.geteuid() == 0,
"a read-only folder is refused by POSIX permissions")
def test_a_tree_in_a_folder_not_writable_is_not_fetched(self):
"""A read-only card blamed each data archive's URL with a raw
errno, and that second cause split the one-line summary."""
listed = manifest()
listed["data_directories"] = [{
"ref": "bluemsx", "dest": "Machines", "type": "zip",
"url": "https://example.invalid/blueMSX.zip", "systems": ["nintendo-gba"],
"files": {"a.txt": {"sha1": _sha1(b"a"), "size": 1}},
}, {
"ref": "fbneo-cheats", "dest": "fbneo/cheats", "type": "zip",
"url": "https://example.invalid/cheats.zip", "systems": ["nintendo-gba"],
"files": {"b.txt": {"sha1": _sha1(b"b"), "size": 1}},
}]
self.list.write_text(json.dumps(listed))
self.complete()
self.dest.chmod(0o555)
self.addCleanup(self.dest.chmod, 0o755)
proc = self.run_installer("--manifest", str(self.list), "--no-input")
out = proc.stdout + proc.stderr
self.assertEqual(proc.returncode, 2, out)
self.assertNotIn("could not read", out)
self.assertNotIn("Errno", out)
self.assertNotIn("Data directories:", out)
self.assertIn("failed: 2 files (folder not writable), first bluemsx", out)
class OneOfflineVocabulary(Scratch):
"""--offline said one