summaryrefslogtreecommitdiff
path: root/scripts/repo-add.sh.in
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2016-10-11 23:04:25 +1000
committerAllan McRae <allan@archlinux.org>2016-10-22 20:50:55 +1000
commit577701250d645d1fc1a505cde34aedbeb3208ea5 (patch)
tree779183b41b3a84fd012a4dbb38337aed00ad0025 /scripts/repo-add.sh.in
parent603f087cd73aff0d39bf0ebfb23aaae5626cb814 (diff)
downloadpacman-577701250d645d1fc1a505cde34aedbeb3208ea5.tar.xz
Use coreutils binaries for checking/generating checksums
If pacman is build against a crypto library other than openssl, it makes no sense to require makepkg to use it. The only currently considered alternative to openssl is nettle, which has no binary for base64 encode/decode. This means that we could replace the hashing cacluations with nettle-hash, but would require base64 from coreutils. Given makepkg already relies heavily on coreutils, we might as well use all the coreutils hashing binaries too. This patch also improves the checking of required binaries for hashing operations. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/repo-add.sh.in')
-rw-r--r--scripts/repo-add.sh.in16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 4da2c317..a543611c 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -151,8 +151,8 @@ db_write_delta() {
echo -e "%DELTAS%" >"$deltas"
fi
# get md5sum and compressed size of package
- md5sum=$(openssl dgst -md5 "$deltafile")
- md5sum=${md5sum##* }
+ md5sum=$(md5sum "$deltafile")
+ md5sum=${md5sum%% *}
csize=$(@SIZECMD@ -L "$deltafile")
oldfile=$(xdelta3 printhdr "$deltafile" | grep "XDELTA filename (source)" | sed 's/.*: *//')
@@ -374,17 +374,17 @@ db_write_entry() {
return 1
fi
msg2 "$(gettext "Adding package signature...")"
- pgpsig=$(openssl base64 -in "$pkgfile.sig" | tr -d '\n')
+ pgpsig=$(base64 "$pkgfile.sig" | tr -d '\n')
fi
csize=$(@SIZECMD@ -L "$pkgfile")
# compute checksums
msg2 "$(gettext "Computing checksums...")"
- md5sum=$(openssl dgst -md5 "$pkgfile")
- md5sum=${md5sum##* }
- sha256sum=$(openssl dgst -sha256 "$pkgfile")
- sha256sum=${sha256sum##* }
+ md5sum=$(md5sum "$pkgfile")
+ md5sum=${md5sum%% *}
+ sha256sum=$(sha256sum "$pkgfile")
+ sha256sum=${sha256sum%% *}
# remove an existing entry if it exists, ignore failures
db_remove_entry "$pkgname"
@@ -501,7 +501,7 @@ elephant() {
"ZL9JFFZeAa0a2+lKjL2anpYfV+0Zx9LJ+/MC8nRayuDlSNy2rfAPibOzsiWHL0jL" \
"SsjFAQAA"
;;
- esac | openssl base64 -d | gzip -d
+ esac | base64 -d | gzip -d
}
prepare_repo_db() {