You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
662 B

  1. #!/usr/bin/expect -f
  2. set timeout 3
  3. set PACKAGE [lindex $argv 0]
  4. set GPG_NAME [lindex $argv 1]
  5. set GPG_PATH [lindex $argv 2]
  6. set GPG_PASSPHRASE $env(GPG_PASSPHRASE)
  7. if {[llength $argv] == 0} {
  8. send_user "Usage: ./sign <rpm_package> <gpg_key> <gpg_binary>\n"
  9. exit 1
  10. }
  11. send_user "\nSigning $PACKAGE\n"
  12. spawn rpmsign --resign $PACKAGE --define "_signature gpg" --define "_gpg_name $GPG_NAME" --define "_gpgbin $GPG_PATH"
  13. expect {
  14. timeout { send_user "\nTimeout signing $PACKAGE\n"; exit 1 }
  15. "Enter pass phrase:"
  16. }
  17. send "$GPG_PASSPHRASE\r"
  18. expect {
  19. timeout { send_user "\nTimeout signing $PACKAGE\n"; exit 1 }
  20. "Pass phrase is good."
  21. }
  22. interact
  23. sleep 3