From 149839c5391e9a93465f86dbb8d095a0150d755d Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Mon, 26 May 2008 23:46:01 +0200 Subject: 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 Signed-off-by: Dan McGee --- scripts/repo-add.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/repo-add.sh.in') diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 21031547..e90f0e89 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -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 -- cgit v1.2.3