diff options
author | Gunnar Beutner <gunnar@beutner.name> | 2021-04-25 11:54:45 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-04-25 13:30:18 +0200 |
commit | 5a3f63ea00c552a9a31eb1b2b17901265b625696 (patch) | |
tree | 9fd36116cd36bf37be5af216e4a7208eae67e752 /Ports/.port_include.sh | |
parent | 4aaf6386ae8f33755513f2040aa1aa5df16523cd (diff) | |
download | serenity-5a3f63ea00c552a9a31eb1b2b17901265b625696.zip |
Ports: Remove support for algos other than sha256 and sig
Diffstat (limited to 'Ports/.port_include.sh')
-rwxr-xr-x | Ports/.port_include.sh | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index d6ef883a22..07ebe8411c 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -48,12 +48,6 @@ host_env() { packagesdb="${DESTDIR}/usr/Ports/packages.db" -MD5SUM=md5sum - -if [ `uname -s` = "OpenBSD" ]; then - MD5SUM="md5 -q" -fi - . "$@" shift @@ -117,7 +111,7 @@ func_defined post_fetch || post_fetch() { : } fetch() { - if [ "$auth_type" == "sig" ] && [ ! -z "${auth_import_key}" ]; then + if [ "$auth_type" = "sig" ] && [ ! -z "${auth_import_key}" ]; then # import gpg key if not existing locally # The default keyserver keys.openpgp.org prints "new key but contains no user ID - skipped" # and fails. Use a different key server. @@ -148,24 +142,16 @@ fetch() { fi fi - # check md5sum if given - if [ ! -z "$auth_sum" ]; then - if [ "$auth_type" == "md5" ] || [ "$auth_type" == "sha256" ] || [ "$auth_type" == "sha1" ]; then - echo "Expecting ${auth_type}sum: $auth_sum" - if [ "$auth_type" == "md5" ]; then - calc_sum="$($MD5SUM $filename | cut -f1 -d' ')" - elif [ "$auth_type" == "sha256" ]; then - calc_sum="$(sha256sum $filename | cut -f1 -d' ')" - elif [ "$auth_type" == "sha1" ]; then - calc_sum="$(sha1sum $filename | cut -f1 -d' ')" - fi - echo "${auth_type}sum($filename) = '$calc_sum'" - if [ "$calc_sum" != "$auth_sum" ]; then - # remove downloaded file to re-download on next run - rm -f $filename - echo "${auth_type}sum's mismatching, removed erronous download. Please run script again." - exit 1 - fi + # check sha256sum if given + if [ "$auth_type" = "sha256" ]; then + echo "Expecting ${auth_type}sum: $auth_sum" + calc_sum="$(sha256sum $filename | cut -f1 -d' ')" + echo "${auth_type}sum($filename) = '$calc_sum'" + if [ "$calc_sum" != "$auth_sum" ]; then + # remove downloaded file to re-download on next run + rm -f $filename + echo "${auth_type}sums mismatching, removed erronous download. Please run script again." + exit 1 fi fi @@ -199,7 +185,7 @@ fetch() { done # check signature - if [ "$auth_type" == "sig" ]; then + if [ "$auth_type" = "sig" ]; then if $NO_GPG; then echo "WARNING: gpg signature check was disabled by --no-gpg-verification" else |