bash: using expect to automate GPG signing -


i writing bash script automates signing of rpm packages in yum repository. accomplish task, use expect.

here source code far:

/usr/bin/expect <<eod spawn bash -c "rpm --resign ${new_repo}/packages/*.rpm" expect "enter pass phrase:" send "${gpg_pass}\r" expect eof eod 

new_repo path yum repo, , gpg_pass password gpg key.

for part, works quite , succeeds in signing packages.

the problem: code block signs between 28-30 rpm packages though directory contains 42 packages. manually signing batch of rpm packages command line works perfectly, expect block in script stops before reaches of packages. wierd quirk of expect, or doing wrong? workarounds/suggestions welcome.

thanks

it's timing out. try adding:

set timeout 600 

or if want wait forever:

set timeout -1 

as first line of script.


Comments