Fix md5 directory permissions fallback #2

Closed
DasPoschi wants to merge 1 commits from codex/analyze-and-fix-issue into main
DasPoschi commented 2025-12-31 17:53:58 +00:00 (Migrated from github.com)

Motivation

  • Schreibfehler beim Anlegen der MD5-Seitendateien vermeiden, wenn MD5_DIR nicht beschreibbar ist.
  • Sicherstellen, dass ein beschreibbarer Speicherort gefunden wird, auch wenn der Container-Standard (/md5) keine Schreibrechte hat.
  • Bevorzugen der konfigurierten MD5_DIR, ansonsten Fallback auf /output/.md5 oder /tmp/jd-md5.

Description

  • Added a cached variable _md5_dir_cache and a helper pick_md5_dir() that selects a writable MD5 directory from candidates.
  • pick_md5_dir() tries MD5_DIR, os.path.join(JD_OUTPUT_PATH, ".md5") and /tmp/jd-md5, creating directories and checking write access.
  • Updated write_md5_sidecar() to use pick_md5_dir() and write the .md5 file into the selected directory.
  • Raises a clear RuntimeError in German when no writable MD5 directory can be found.

Testing

  • Keine automatisierten Tests wurden ausgeführt.

Codex Task

### Motivation - Schreibfehler beim Anlegen der MD5-Seitendateien vermeiden, wenn `MD5_DIR` nicht beschreibbar ist. - Sicherstellen, dass ein beschreibbarer Speicherort gefunden wird, auch wenn der Container-Standard (`/md5`) keine Schreibrechte hat. - Bevorzugen der konfigurierten `MD5_DIR`, ansonsten Fallback auf ` /output/.md5` oder `/tmp/jd-md5`. ### Description - Added a cached variable `_md5_dir_cache` and a helper `pick_md5_dir()` that selects a writable MD5 directory from candidates. - `pick_md5_dir()` tries `MD5_DIR`, `os.path.join(JD_OUTPUT_PATH, ".md5")` and `/tmp/jd-md5`, creating directories and checking write access. - Updated `write_md5_sidecar()` to use `pick_md5_dir()` and write the `.md5` file into the selected directory. - Raises a clear `RuntimeError` in German when no writable MD5 directory can be found. ### Testing - Keine automatisierten Tests wurden ausgeführt. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69556276187c8327aa89ad7e7569b67d)

Pull request closed

Sign in to join this conversation.