Update patching rpm-audit to handle both sha256 and md5 checksums

Change-Id: I7e3a7f3cf47488ae55eecf93ee1b5c9fb2f7f763
Signed-off-by: Don Penney <don.penney@windriver.com>
This commit is contained in:
Don Penney 2018-04-16 10:02:47 -04:00
parent 58d8127094
commit e212d91a6f
1 changed files with 11 additions and 3 deletions

View File

@ -101,9 +101,9 @@ do
continue
fi
if [[ $INCLUDE_PYTHON_FILES == "no" && $pname =~ \.py[co]?$ ]]
if [[ $INCLUDE_PYTHON_FILES == "no" && $pname =~ \.py[co]$ ]]
then
# Skip python .py or .pyc file
# Skip python .pyo or .pyc file
continue
fi
@ -135,7 +135,15 @@ do
continue
fi
echo $psum $pname | sha256sum --check --status
let -i sumlen=$(echo -n $psum | wc -c)
if [ $sumlen = 64 ]
then
sumcmd=sha256sum
else
sumcmd=md5sum
fi
echo $psum $pname | $sumcmd --check --status
if [ $? -ne 0 ]
then
echo "Mismatch: $pname ($pkg)"