Nothing says what to do next. README.md says dwim and scan should run as root and that SFDUPES_DATABASE names another database, but the program says neither, and --help does not name the variable.
The matching error of report does give the hint:
sfdupes: /var/lib/sfdupes/db.sqlite: no database (run "sfdupes scan" first, or set SFDUPES_DATABASE)
Why it matters
dwim is the one command for a first look at a new machine. A user who tries it without sudo gets an error with no way forward.
What should happen
When the database, its directory or its lock file cannot be created for lack of permission, the error names both ways out, for example:
sfdupes: create database directory: mkdir /var/lib/sfdupes/: permission denied (run as root, or set SFDUPES_DATABASE)
Model: fable-5-2
Defect, found in the acceptance test (https://git.eeqj.de/sneak/sfdupes/issues/164) on `next` at `202f083`.
## Steps
As a user other than root, with `SFDUPES_DATABASE` unset:
```sh
make build
./sfdupes scan "$(mktemp -d /var/tmp/sfdupes.XXXXXX)"
```
## What happened
`scan` prints this and exits 1, and so does `sfdupes dwim`:
```
scan: new database /var/lib/sfdupes/db.sqlite (default)
sfdupes: create database directory: mkdir /var/lib/sfdupes/: permission denied
```
Nothing says what to do next. `README.md` says `dwim` and `scan` should run as root and that `SFDUPES_DATABASE` names another database, but the program says neither, and `--help` does not name the variable.
The matching error of `report` does give the hint:
```
sfdupes: /var/lib/sfdupes/db.sqlite: no database (run "sfdupes scan" first, or set SFDUPES_DATABASE)
```
## Why it matters
`dwim` is the one command for a first look at a new machine. A user who tries it without `sudo` gets an error with no way forward.
## What should happen
When the database, its directory or its lock file cannot be created for lack of permission, the error names both ways out, for example:
```
sfdupes: create database directory: mkdir /var/lib/sfdupes/: permission denied (run as root, or set SFDUPES_DATABASE)
```
Model: fable-5-2
sneak (11 November, about 02:24 UTC), the definition of done: run without root, scan and dwim put the database in the XDG state directory ($XDG_STATE_HOME/sfdupes/, defaulting to ~/.local/state/sfdupes/), creating it as needed, instead of failing; as root the current location stays. SFDUPES_DATABASE still overrides both. README and --help say where the database lives. Tests cover the non-root default and the override.
Model: opus-5-5
sneak (11 November, about 02:24 UTC), the definition of done: run without root, `scan` and `dwim` put the database in the XDG state directory (`$XDG_STATE_HOME/sfdupes/`, defaulting to `~/.local/state/sfdupes/`), creating it as needed, instead of failing; as root the current location stays. `SFDUPES_DATABASE` still overrides both. README and `--help` say where the database lives. Tests cover the non-root default and the override.
Model: opus-5-5
Built in #190: without SFDUPES_DATABASE, a non-root user's database is sfdupes/db.sqlite under $XDG_STATE_HOME (~/.local/state by default), created by scan; root keeps /var/lib/sfdupes/db.sqlite. report, trees and info follow the same default, so a non-root user reads root's database only with SFDUPES_DATABASE set.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/sfdupes/pulls/190: without `SFDUPES_DATABASE`, a non-root user's database is `sfdupes/db.sqlite` under `$XDG_STATE_HOME` (`~/.local/state` by default), created by `scan`; root keeps `/var/lib/sfdupes/db.sqlite`. `report`, `trees` and `info` follow the same default, so a non-root user reads root's database only with `SFDUPES_DATABASE` set.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Defect, found in the acceptance test (#164) on
nextat202f083.Steps
As a user other than root, with
SFDUPES_DATABASEunset:What happened
scanprints this and exits 1, and so doessfdupes dwim:Nothing says what to do next.
README.mdsaysdwimandscanshould run as root and thatSFDUPES_DATABASEnames another database, but the program says neither, and--helpdoes not name the variable.The matching error of
reportdoes give the hint:Why it matters
dwimis the one command for a first look at a new machine. A user who tries it withoutsudogets an error with no way forward.What should happen
When the database, its directory or its lock file cannot be created for lack of permission, the error names both ways out, for example:
Model: fable-5-2
if run by nonroot make the database file go somewhere sane (xdg state directory)
sneak (11 November, about 02:24 UTC), the definition of done: run without root,
scananddwimput the database in the XDG state directory ($XDG_STATE_HOME/sfdupes/, defaulting to~/.local/state/sfdupes/), creating it as needed, instead of failing; as root the current location stays.SFDUPES_DATABASEstill overrides both. README and--helpsay where the database lives. Tests cover the non-root default and the override.Model: opus-5-5
Built in #190: without
SFDUPES_DATABASE, a non-root user's database issfdupes/db.sqliteunder$XDG_STATE_HOME(~/.local/stateby default), created byscan; root keeps/var/lib/sfdupes/db.sqlite.report,treesandinfofollow the same default, so a non-root user reads root's database only withSFDUPES_DATABASEset.Model: opus-5-5