mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
du -b is not available on BSD, use du -k instead.
This fixes FS#10459. There is apparently no portable ways to get the apparent size of a file, like du -b does. So the best compromise seems to get the block size in kB, and then convert that to byte so that we keep compatibility. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
1d71079c5b
commit
149839c539
@ -779,7 +779,7 @@ create_package() {
|
||||
else
|
||||
local packager="Unknown Packager"
|
||||
fi
|
||||
local size=$(du -sb | awk '{print $1}')
|
||||
local size=$(du -sk | awk '{print $1 * 1024}')
|
||||
|
||||
# write the .PKGINFO file
|
||||
msg2 "$(gettext "Generating .PKGINFO file...")"
|
||||
|
@ -118,7 +118,7 @@ db_write_delta()
|
||||
|
||||
# get md5sum and size of delta
|
||||
md5sum="$(md5sum "$deltafile" | cut -d ' ' -f 1)"
|
||||
csize=$(du -b -L "$deltafile" | cut -f 1)
|
||||
csize=$(du -kL "$deltafile" | awk '{print $1 * 1024}')
|
||||
|
||||
# ensure variables were found
|
||||
if [ -z "$pkgname" -o -z "$fromver" -o -z "$tover" -o -z "$arch" ]; then
|
||||
@ -165,7 +165,7 @@ db_write_entry()
|
||||
IFS=$OLDIFS
|
||||
|
||||
# get compressed size of package
|
||||
csize=$(du -b -L "$pkgfile" | cut -f 1)
|
||||
csize=$(du -kL "$pkgfile" | awk '{print $1 * 1024}')
|
||||
|
||||
startdir=$(pwd)
|
||||
pushd "$gstmpdir" 2>&1 >/dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user