SHA256, MD5 sum verification added.
This commit is contained in:
parent
5bb6f377a4
commit
19838ae794
1 changed files with 27 additions and 1 deletions
28
aps
28
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!
|
||||
|
|
Loading…
Reference in a new issue