diff --git a/aps b/aps index 07b6ab0..f503b08 100755 --- a/aps +++ b/aps @@ -58,6 +58,27 @@ function sources(){ err "Sources not found, exiting!" fi } +function sha256(){ + sum="$(cat $@/sums)" + case ${shawrp##*/} in + openssl) set -- dgst -sha256 -r "$sum" ;; + sha256 set -- -r "$sum" ;; + esac + hsh=$("$shawrp" "$sum") +} + +function md5(){ + sum="$(cat $@/sums)" + md5sum "$sum" +} +function versum(){ + $sumrest=$(cat $@/sums | cut -d'+' -f-) + $sumtype=$(cat $@/sums | cut -d'+' -f2) + case $sumtype in + sha256) sha256 ;; + md5) md5 ;; + esac +} function runbuildsh(){ if [ -x "${2}/${1}" ]; then prn "Running $1" @@ -117,7 +138,12 @@ function pkg_local(){ mkdir -p "${pkg_path}/payload" . "${pkg_path}/package" cd "${pkg_path}" - sources + sources || err "No sources found / failed getting sources" + if [ -f sums ] + versum "${pkg_path}" + else + wrn "No sums file found! Be careful!" + fi runbuildsh "build" "${pkg_path}" runbuildsh "predeploy" "${pkg_path}" # Old APS code from before the rewrite!