Replace @SIZECMD@ with POSIX-compatible command
Now uses wc -c $file | cut -d' ' -f1, which works using only POSIX commands and removes the need for any platform-specific usages. Signed-off-by: Drew DeVault <sir@cmpwn.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
d9908fc1f2
commit
1af766987f
3 changed files with 5 additions and 10 deletions
|
@ -342,7 +342,6 @@ DEFAULT_DUFLAGS=" -sk --apparent-size"
|
|||
INODECMD="stat -c '%i %n'"
|
||||
OWNERCMD="stat -c '%u:%g'"
|
||||
MODECMD="stat -c '%a'"
|
||||
SIZECMD="stat -c %s"
|
||||
SEDINPLACE="sed --follow-symlinks -i"
|
||||
STRIP_BINARIES="--strip-all"
|
||||
STRIP_SHARED="--strip-unneeded"
|
||||
|
@ -352,7 +351,6 @@ case "${host_os}" in
|
|||
INODECMD="stat -f '%i %N'"
|
||||
OWNERCMD="stat -f '%u:%g'"
|
||||
MODECMD="stat -f '%Lp'"
|
||||
SIZECMD="stat -f %z"
|
||||
SEDINPLACE="sed -i \"\""
|
||||
DEFAULT_DUFLAGS=" -sk"
|
||||
;;
|
||||
|
@ -361,7 +359,6 @@ case "${host_os}" in
|
|||
INODECMD="/usr/bin/stat -f '%i %N'"
|
||||
OWNERCMD="/usr/bin/stat -f '%u:%g'"
|
||||
MODECMD="/usr/bin/stat -f '%Lp'"
|
||||
SIZECMD="/usr/bin/stat -f %z"
|
||||
SEDINPLACE="/usr/bin/sed -i ''"
|
||||
DEFAULT_DUFLAGS=" -sk"
|
||||
STRIP_BINARIES=""
|
||||
|
@ -374,7 +371,6 @@ AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] )
|
|||
AC_SUBST(INODECMD)
|
||||
AC_SUBST(OWNERCMD)
|
||||
AC_SUBST(MODECMD)
|
||||
AC_SUBST(SIZECMD)
|
||||
AC_SUBST(SEDINPLACE)
|
||||
AC_SUBST(STRIP_BINARIES)
|
||||
AC_SUBST(STRIP_SHARED)
|
||||
|
@ -561,7 +557,6 @@ ${PACKAGE_NAME}:
|
|||
File inode command : ${INODECMD}
|
||||
File owner command : ${OWNERCMD}
|
||||
File mode command : ${MODECMD}
|
||||
Filesize command : ${SIZECMD}
|
||||
In-place sed command : ${SEDINPLACE}
|
||||
|
||||
libalpm version : ${LIB_VERSION}
|
||||
|
|
|
@ -119,7 +119,7 @@ create_xdelta()
|
|||
newver="$pkgver"
|
||||
newarch="$arch"
|
||||
|
||||
pkgsize="$(@SIZECMD@ -L "$newfile")"
|
||||
pkgsize="$(wc -c "$newfile" | cut -d' ' -f1)"
|
||||
|
||||
if ((pkgsize < min_pkg_size)); then
|
||||
msg "$(gettext "Skipping delta creation for small package: %s - size %s")" "$newname" "$pkgsize"
|
||||
|
@ -151,7 +151,7 @@ create_xdelta()
|
|||
return 1
|
||||
fi
|
||||
|
||||
deltasize="$(@SIZECMD@ -L "$deltafile")"
|
||||
deltasize="$(wc -c "$deltafile" | cut -d' ' -f1)"
|
||||
|
||||
if ((max_delta_size * pkgsize / 100 < deltasize)); then
|
||||
msg "$(gettext "Delta package larger than maximum size. Removing.")"
|
||||
|
|
|
@ -153,7 +153,7 @@ db_write_delta() {
|
|||
# get md5sum and compressed size of package
|
||||
md5sum=$(md5sum "$deltafile")
|
||||
md5sum=${md5sum%% *}
|
||||
csize=$(@SIZECMD@ -L "$deltafile")
|
||||
csize=$(wc -c "$deltafile" | cut -d' ' -f1)
|
||||
|
||||
oldfile=$(xdelta3 printhdr "$deltafile" | grep "XDELTA filename (source)" | sed 's/.*: *//')
|
||||
newfile=$(xdelta3 printhdr "$deltafile" | grep "XDELTA filename (output)" | sed 's/.*: *//')
|
||||
|
@ -368,7 +368,7 @@ db_write_entry() {
|
|||
error "$(gettext "Cannot use armored signatures for packages: %s")" "$pkgfile.sig"
|
||||
return 1
|
||||
fi
|
||||
pgpsigsize=$(@SIZECMD@ -L "$pkgfile.sig")
|
||||
pgpsigsize=$(wc -c "$pkgfile.sig" | cut -d' ' -f1)
|
||||
if (( pgpsigsize > 16384 )); then
|
||||
error "$(gettext "Invalid package signature file '%s'.")" "$pkgfile.sig"
|
||||
return 1
|
||||
|
@ -377,7 +377,7 @@ db_write_entry() {
|
|||
pgpsig=$(base64 "$pkgfile.sig" | tr -d '\n')
|
||||
fi
|
||||
|
||||
csize=$(@SIZECMD@ -L "$pkgfile")
|
||||
csize=$(wc -c "$pkgfile" | cut -d' ' -f1)
|
||||
|
||||
# compute checksums
|
||||
msg2 "$(gettext "Computing checksums...")"
|
||||
|
|
Loading…
Add table
Reference in a new issue