Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-03-19 22:55:00 -0400
committerAllan McRae <allan@archlinux.org>2017-04-04 12:21:20 +1000
commit1af766987f66c63b029578374d679a353960d46d (patch)
tree334415a0d5609afea5ca3fe191464bd85e841560 /scripts
parentd9908fc1f272a2859b525c3bd92d9f3e8a2a6293 (diff)
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/pkgdelta.sh.in4
-rw-r--r--scripts/repo-add.sh.in6
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in
index 9f87185b..4500dd75 100644
--- a/scripts/pkgdelta.sh.in
+++ b/scripts/pkgdelta.sh.in
@@ -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.")"
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 6333f6a2..68edbf4b 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -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...")"