[pacman-dev] [RFC] [PATCH] Implement a du --apparent-size equivalent
From: Alastair Hughes
On 11/06/16 17:53, Alastair Hughes wrote:
From: Alastair Hughes
Add a pkgsize binary which mimics the behaviour of GNU du --apparent-size -skl. Fixes FS#47943.
Signed-off-by: Alastair Hughes
--- I haven't done much C programming before - I'd appreciate any feedback you have. At the moment, this patch creates a new pkgsize binary as an extra utility, and installs with the other utilities. I think that it would be better if it installed it to a libexec dir, but I'm not entirely sure how to do that without making a mess.
I really don't want to provide a binary just to do this. My preferred solution is just to test "du -sk --apparent-size" in a temporary directory during configure and switch to just "du -sk" if it fails. Allan
On 6/12/16, Allan McRae
On 11/06/16 17:53, Alastair Hughes wrote:
From: Alastair Hughes
Add a pkgsize binary which mimics the behaviour of GNU du --apparent-size -skl. Fixes FS#47943.
Signed-off-by: Alastair Hughes
--- I haven't done much C programming before - I'd appreciate any feedback you have. At the moment, this patch creates a new pkgsize binary as an extra utility, and installs with the other utilities. I think that it would be better if it installed it to a libexec dir, but I'm not entirely sure how to do that without making a mess. I really don't want to provide a binary just to do this.
My preferred solution is just to test "du -sk --apparent-size" in a temporary directory during configure and switch to just "du -sk" if it fails.
Allan
I'm cross compiling; in that case, the host system has a different du than the target system, so testing at configure time would not be appropriate. Would checking at runtime be acceptable? Alternatively, I would be happy with a configure flag to override the default choice. Alastair Hughes
On 13.06.2016 22:07, Alastair Hughes wrote:
I really don't want to provide a binary just to do this.
I'm cross compiling; in that case, the host system has a different du than the target system
How about implementing the functionality in something like awk or perl? Those should be sufficiently fast and widely available. makepkg already uses awk so maybe that would be a good fit. Florian
On 17/06/16 01:37, Florian Pritz wrote:
On 13.06.2016 22:07, Alastair Hughes wrote:
I really don't want to provide a binary just to do this.
I'm cross compiling; in that case, the host system has a different du than the target system
How about implementing the functionality in something like awk or perl? Those should be sufficiently fast and widely available. makepkg already uses awk so maybe that would be a good fit.
Because history! https://lists.archlinux.org/pipermail/pacman-dev/2012-March/015293.html
On 14/06/16 06:07, Alastair Hughes wrote:
On 6/12/16, Allan McRae
wrote: On 11/06/16 17:53, Alastair Hughes wrote:
From: Alastair Hughes
Add a pkgsize binary which mimics the behaviour of GNU du --apparent-size -skl. Fixes FS#47943.
Signed-off-by: Alastair Hughes
--- I haven't done much C programming before - I'd appreciate any feedback you have. At the moment, this patch creates a new pkgsize binary as an extra utility, and installs with the other utilities. I think that it would be better if it installed it to a libexec dir, but I'm not entirely sure how to do that without making a mess. I really don't want to provide a binary just to do this.
My preferred solution is just to test "du -sk --apparent-size" in a temporary directory during configure and switch to just "du -sk" if it fails.
Allan
I'm cross compiling; in that case, the host system has a different du than the target system, so testing at configure time would not be appropriate. Would checking at runtime be acceptable? Alternatively, I would be happy with a configure flag to override the default choice.
Would something like: DUFLAGS="-sk" ./configure work for you? This would be added to the "Some influential environment variables" section of the "./configure --help" output? Now I just need to figure out how to do this! A
On 6/23/16, Allan McRae
Would something like:
DUFLAGS="-sk" ./configure
work for you? This would be added to the "Some influential environment variables" section of the "./configure --help" output?
Now I just need to figure out how to do this!
A
That would be fine :D I've sent in a patch to add DUFLAGS as a "precious" variable; I apologize for it not being inline :( Alastair Hughes
participants (3)
-
Alastair Hughes
-
Allan McRae
-
Florian Pritz