4 ms·
The real WTF is that APT spawns an external process to check disk usage, instead of invoking statvfs() on its own. Some cases are less clear-cut, however. For
by pwdisswordfish 9y ago
The real WTF is that APT spawns an external process to check disk usage, instead of invoking statvfs() on its own.
Some cases are less clear-cut, however. For example, the Debian 'nodejs' package installs node.js binary as /usr/bin/nodejs and not /usr/bin/node because it conflicts with another package: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907#108 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907#108
And let's not forget rename(1) from util-linux versus the Perl rename(1)...
- orf 9y agoIt could be called from a bash script rather than from within apt itself.
- phaemon 9y agoIt isn't `apt`. See how they mentioned that `mysql` packages were installing? Well, in the `preinst` shell script, in the .deb, there is the line: `if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then` There's `df` being called without the full path and that's what would be spawning Dwarf Fortress.
- glandium 9y agoThat doesn't make it much better though. Parsing the output of df (with a useless tail -1) is kind of awful when you can use something like stat -f -c %a.
- MichaelBurge 9y agoThat has the same problem, just with a different name. So your solution solves a style complaint, not an actual functional problem.
- sslayer 9y agoI agree with your comment about it being functional. But wouldn't removing tail from the pipe remove complexity and speed up the processing(Arguably, most likely only by a small fraction)
- linsomniac 9y agoHow is the "tail -1" useless? The output of that df command is two lines, one contains the column headers and the next contains the data.
- glandium 9y agobecause `... | tail -n -1 | awk '{...}'` is the same as `... | awk 'END {...}'`.
- lorenzhs 9y agoOn the node thing: that decision has recently been reversed by the technical committee, effective in the next release (it is in unstable now). See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862051 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862051 - nodejs will now simply be 'node'.