sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.85k stars 128 forks source link

keep dir timestamps fails busybox's mktemp #625

Open freezingDaniel opened 1 year ago

freezingDaniel commented 1 year ago

Busybox expects the template to end with XXXXXX and fails (exitcode 1) but the script proceeds running, printing

touch: : No such file or directory
touch: can't stat '': No such file or directory
rm: can't remove '': No such file or directory

https://elixir.bootlin.com/busybox/latest/source/coreutils/mktemp.c

Possible solutions might include:

https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/lib/formats/sh.sh#L373 https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/.format.sh#L15



Also out of interest is there a reason why the file is deleted as part of the stamping? https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/lib/formats/sh.sh#L271 Could the file not created by the variable initialization be used and then delete only as part of the END OF AUTOGENERATED OUTPUT section? https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/lib/formats/sh.c.in#L58