rpm_verify: do not panic when the file doesn't exist
It turns out revisor attempts to verify some non-existent files, and this should not cause an abort.
This commit is contained in:
parent
3a30465f0d
commit
88db331d6b
10
rpm_verify
10
rpm_verify
@ -3,7 +3,12 @@
|
|||||||
verify_rpm() {
|
verify_rpm() {
|
||||||
RPM=$1
|
RPM=$1
|
||||||
|
|
||||||
if ! rpm --checksig $1 > /dev/null; then
|
if ! [ -f $RPM ]; then
|
||||||
|
echo -n "No such file... "
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! rpm --checksig $RPM > /dev/null; then
|
||||||
echo "Wrong PGP signature!"
|
echo "Wrong PGP signature!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -12,7 +17,7 @@ fi
|
|||||||
# mean that the rpm has been signed! It might simply
|
# mean that the rpm has been signed! It might simply
|
||||||
# have no PGP signature at all. Yes, stupidity...
|
# have no PGP signature at all. Yes, stupidity...
|
||||||
|
|
||||||
if ! rpm --checksig $1 | grep pgp > /dev/null ; then
|
if ! rpm --checksig $RPM | grep pgp > /dev/null ; then
|
||||||
echo "No PGP signature found!"
|
echo "No PGP signature found!"
|
||||||
|
|
||||||
if [ "$NO_SIGN" == "1" ] ; then
|
if [ "$NO_SIGN" == "1" ] ; then
|
||||||
@ -27,7 +32,6 @@ fi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "NO_SIGN = $NO_SIGN"
|
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
echo "Usage: $0 <rpm file>"
|
echo "Usage: $0 <rpm file>"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user