Commit 1df22d32 authored by Ethan Sommer's avatar Ethan Sommer Committed by Allan McRae
Browse files

repo-add: use wc -c on stdin instead of file to avoid use of cut



Redirect file to stdin so wc -c doesn't print a file name that needs to
be stripped.

Signed-off-by: default avatarEthan Sommer <e5ten.arch@gmail.com>
Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
parent 7b73c4a7
......@@ -272,7 +272,7 @@ db_write_entry() {
error "$(gettext "Cannot use armored signatures for packages: %s")" "$pkgfile.sig"
return 1
fi
pgpsigsize=$(wc -c "$pkgfile.sig" | cut -d' ' -f1)
pgpsigsize=$(wc -c < "$pkgfile.sig")
if (( pgpsigsize > 16384 )); then
error "$(gettext "Invalid package signature file '%s'.")" "$pkgfile.sig"
return 1
......@@ -281,7 +281,7 @@ db_write_entry() {
pgpsig=$(base64 "$pkgfile.sig" | tr -d '\n')
fi
csize=$(wc -c "$pkgfile" | cut -d' ' -f1)
csize=$(wc -c < "$pkgfile")
# compute checksums
msg2 "$(gettext "Computing checksums...")"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment