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
2 changed files with 3 additions and 3 deletions
|
@ -779,7 +779,7 @@ create_package() {
|
||||||
else
|
else
|
||||||
local packager="Unknown Packager"
|
local packager="Unknown Packager"
|
||||||
fi
|
fi
|
||||||
local size=$(du -sb | awk '{print $1}')
|
local size=$(du -sk | awk '{print $1 * 1024}')
|
||||||
|
|
||||||
# write the .PKGINFO file
|
# write the .PKGINFO file
|
||||||
msg2 "$(gettext "Generating .PKGINFO file...")"
|
msg2 "$(gettext "Generating .PKGINFO file...")"
|
||||||
|
|
|
@ -118,7 +118,7 @@ db_write_delta()
|
||||||
|
|
||||||
# get md5sum and size of delta
|
# get md5sum and size of delta
|
||||||
md5sum="$(md5sum "$deltafile" | cut -d ' ' -f 1)"
|
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
|
# ensure variables were found
|
||||||
if [ -z "$pkgname" -o -z "$fromver" -o -z "$tover" -o -z "$arch" ]; then
|
if [ -z "$pkgname" -o -z "$fromver" -o -z "$tover" -o -z "$arch" ]; then
|
||||||
|
@ -165,7 +165,7 @@ db_write_entry()
|
||||||
IFS=$OLDIFS
|
IFS=$OLDIFS
|
||||||
|
|
||||||
# get compressed size of package
|
# get compressed size of package
|
||||||
csize=$(du -b -L "$pkgfile" | cut -f 1)
|
csize=$(du -kL "$pkgfile" | awk '{print $1 * 1024}')
|
||||||
|
|
||||||
startdir=$(pwd)
|
startdir=$(pwd)
|
||||||
pushd "$gstmpdir" 2>&1 >/dev/null
|
pushd "$gstmpdir" 2>&1 >/dev/null
|
||||||
|
|
Loading…
Add table
Reference in a new issue