On 2023-12-21, at 11:21:48 +0000, Jeremy Sowden wrote: > On 2023-12-21, at 11:10:28 +0500, Lev Lamberov wrote: > > Since I cannot reproduce the bug, I'm downgrading the severity of > > this bug report. > > I cloned the git repo, ran `gbp buildpackage --git-pbuilder` and > reproduced it (log attached). I'll see if I can work out what's going > on.
In testing:
$ du --version
du (GNU coreutils) 9.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund, David MacKenzie, Paul Eggert,
and Jim Meyering.
$ du -sb /tmp/dired-du1wX4yG/empty-subdir
4096 /tmp/dired-du1wX4yG/empty-subdir
In unstable:
$ schroot -c sid -- du --version
du (GNU coreutils) 9.4
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund, David MacKenzie, Paul Eggert,
and Jim Meyering.
$ schroot -c sid -- du -sb /tmp/dired-du1wX4yG/empty-subdir
0 /tmp/dired-du1wX4yG/empty-subdir
This coreutils bug report:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61884
led to a change in behaviour such that `du -b`, which is equivalent to
`du --apparent --block-size=1`, reports directories as having zero size.
If we don't pass `--apparent` we restore the old output:
$ schroot -c sid -- du -s --block-size=1 /tmp/dired-du1wX4yG/empty-subdir
4096 /tmp/dired-du1wX4yG/empty-subdir
I've attached a minimal patch that fixes the bug:
$ schroot -c sid -- emacs -batch -l dired-du.el -l dired-du-tests.el -eval
'(ert-run-tests-batch-and-exit "dired-du-sort-by-size")'
Loading /etc/emacs/site-start.d/00debian.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Running 1 tests (2023-12-21 15:02:28+0000, selector
`"dired-du-sort-by-size"')
[...]
Test dired-du-sort-by-size condition:
(ert-test-failed
((should
(equal
'("filled-subdir" "external-file" "empty-subdir")
(dired-get-marked-files ...)))
:form
(equal
("filled-subdir" "external-file" "empty-subdir")
("filled-subdir" "empty-subdir" "external-file"))
:value nil :explanation
(list-elt 1
(arrays-of-different-length 13 12 "external-file"
"empty-subdir" first-mismatch-at 1))))
FAILED 1/1 dired-du-sort-by-size (0.392296 sec) at
dired-du-tests.el:237
Ran 1 tests, 0 results as expected, 1 unexpected (2023-12-21 15:02:29+0000,
0.712904 sec)
1 unexpected results:
FAILED dired-du-sort-by-size
$ cat debian/patches/du-dir-size-fix.patch
--- a/dired-du.el
+++ b/dired-du.el
@@ -185,7 +185,7 @@
(defcustom dired-du-used-space-program
(purecopy (let ((opts (if (string-prefix-p "gnu" (symbol-name
system-type))
- "-sb"
+ "-sB1"
"-sk"))) ; -k overestimate used space\
; for files w/ size < 1024.
(cond ((executable-find "du") (list "du" opts))
$ dquilt push
Applying patch du-dir-size-fix.patch
patching file dired-du.el
Now at patch du-dir-size-fix.patch
$ schroot -c sid -- emacs -batch -l dired-du.el -l dired-du-tests.el -eval
'(ert-run-tests-batch-and-exit "dired-du-sort-by-size")'
Loading /etc/emacs/site-start.d/00debian.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Running 1 tests (2023-12-21 15:02:51+0000, selector
`"dired-du-sort-by-size"')
[...]
passed 1/1 dired-du-sort-by-size (0.367606 sec)
Ran 1 tests, 1 results as expected, 0 unexpected (2023-12-21 15:02:51+0000,
0.367738 sec)
J.
--- a/dired-du.el
+++ b/dired-du.el
@@ -185,7 +185,7 @@
(defcustom dired-du-used-space-program
(purecopy (let ((opts (if (string-prefix-p "gnu" (symbol-name system-type))
- "-sb"
+ "-sB1"
"-sk"))) ; -k overestimate used space\
; for files w/ size < 1024.
(cond ((executable-find "du") (list "du" opts))
signature.asc
Description: PGP signature

