detect PRIVATE/M4ROOT and return the requested store count (closes #6) #10

Merged
clawbot merged 1 commits from issue-6-mountpoint-detection into next 2026-11-02 21:01:29 +01:00
Collaborator

Fixes #6.

A mount point now counts as a DCF store when its root holds a DCIM or PRIVATE/M4ROOT directory. A bare M4ROOT at the root no longer counts. Asking for a number of stores now returns that many when that many exist. It used to return one too few when asked for two or more.

So that tests can use temporary directories, findDCFMountPoints now only lists the partitions. Two new functions in pkg/dcf/helpers.go do the rest:

  • filterDCFMountPoints does the counting.
  • isDCFMountPoint does the check on one mount point.

GetDCFStores is unchanged. The new tests are in pkg/dcf/helpers_internal_test.go, in package dcf.

The README's Design sentence is corrected, and the TODO lines for both bugs are gone. The TODO line about testing now names only the walk of a store, because that part is still untested.

Judgement call: the marker must now be a directory. A plain file named DCIM used to count. The plan asks that the README, the comment and the code agree, and the README says directory.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/dcf/issues/6. A mount point now counts as a DCF store when its root holds a `DCIM` or `PRIVATE/M4ROOT` directory. A bare `M4ROOT` at the root no longer counts. Asking for a number of stores now returns that many when that many exist. It used to return one too few when asked for two or more. So that tests can use temporary directories, `findDCFMountPoints` now only lists the partitions. Two new functions in `pkg/dcf/helpers.go` do the rest: - `filterDCFMountPoints` does the counting. - `isDCFMountPoint` does the check on one mount point. `GetDCFStores` is unchanged. The new tests are in `pkg/dcf/helpers_internal_test.go`, in package `dcf`. The README's Design sentence is corrected, and the TODO lines for both bugs are gone. The TODO line about testing now names only the walk of a store, because that part is still untested. Judgement call: the marker must now be a directory. A plain file named `DCIM` used to count. The plan asks that the README, the comment and the code agree, and the README says directory. Model: opus-5-5
clawbot added the needs-review label 2026-11-02 20:35:33 +01:00
clawbot self-assigned this 2026-11-02 20:35:33 +01:00
clawbot added 1 commit 2026-11-02 20:35:34 +01:00
A card was detected only with M4ROOT at its root, and asking for two or
more stores returned one too few. A mount point now counts when its root
holds a DCIM or PRIVATE/M4ROOT directory, and the count is exact.

The check and the counting are split from the partition listing so tests
can hand them temporary directories.

Model: opus-5-5
Author
Collaborator

PASS: #10 does what #6 asks, and requiring the marker to be a directory is the right call.

Model: opus-5-5

PASS: https://git.eeqj.de/sneak/dcf/pulls/10 does what https://git.eeqj.de/sneak/dcf/issues/6 asks, and requiring the marker to be a directory is the right call. Model: opus-5-5
clawbot merged commit 445424ba3e into next 2026-11-02 21:01:29 +01:00
clawbot deleted branch issue-6-mountpoint-detection 2026-11-02 21:01:29 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dcf#10