Improvements to the package signing script

This commit is contained in:
James Laska
2015-09-09 11:01:44 -04:00
parent 99444f2737
commit 3a914619ce

View File

@@ -4,15 +4,33 @@
# #
set timeout 600 set timeout 600
# Optionally print usage message
if {[llength $argv] <= 0} {
puts "Usage: sign.exp <command>"
exit 1
}
# Process arguments
set command [join $argv] set command [join $argv]
set passphrase $env(PASSPHRASE)
puts "# $command" if { [info exists env(PASSPHRASE) ] } {
spawn -noecho {*}$command set passphrase $env(PASSPHRASE)
} else {
set passphrase ""
}
# Run the desired command
spawn {*}$command
expect { expect {
-exact -nocase "enter passphrase: " { -exact -nocase "enter passphrase: " {
send -- "$passphrase\r" send -- "$passphrase\r"
exp_continue exp_continue
} }
timeout {
puts "[error] expect timeout"
exit 1
}
eof { } eof { }
} }