Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- check_signature(){
- # $1 name of file
- # $2 keyid
- if [ "$2" ] ; then
- keyid=$(gpg --keyserver-options auto-key-retrieve $1.sign 2>&1)
- gpgok=$?
- keyid=$(grep -F "Signature made" <<< "$keyid")
- keyid=${keyid##* }
- if [ "$keyid" != "$2" ] ; then
- echo -e "\n${COLOR_ERROR}Key-ID is not the same as specified in package list${COLOR_NORMAL}"
- echo "${COLOR_ERROR}expected keyid: $2 ${COLOR_NORMAL}"
- echo "${COLOR_ERROR}file '$1' is signed by keyid $keyid instead.${COLOR_NORMAL}"
- [ $gpgok -eq 0 ] && echo "${COLOR_WARN}at least *that* signature is ok ;)"
- return 1
- fi
- fi
- GPG_OUTPUT=$(gpg --keyserver-options auto-key-retrieve $1.sign 2>&1)
- }
- #You may need to modify this
- sign_pkg(){
- # $1: filename of file to be signed
- gpg -o $1.sign -b $1
- keyid=$(gpg $filename.sign 2>&1 | grep "Signature made")
- keyid=${keyid##* }
- }
- #copypaste this near the end of makepkg's building and call the function if you want it to do it automatically, otherwise you might also want to add an option to sign the resulting file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement