When using expect to sign RPM's package signing fails to work on larger RPM's

Solution Verified - Updated -

Issue

When trying to use a script (seen below) that includes expect to automatically sign RPM's with a given gpgkey, only RPM's smaller than 20 MB are being signed.

Example script:

$ cat bin/sign-rpm.exp
#!/usr/bin/expect -f
set rpmfile [lindex $argv 0]
spawn rpm --addsign $rpmfile
expect -exact "Enter pass phrase: "
send -- "foo\r"
expect eof

From here ensure the ~/.rpmmacros file has been configured as follows:

$ cat ~/.rpmmacros
%_signature gpg
%_gpg_name foo

The behavior of the script on a large RPM (more than 20 MB) can be seen as:

$ rpm -qpi 50mbexample.noarch.rpm|grep ^Signature
Signature   : (none)
$ bin/sign-rpm.exp 50mbexample.noarch.rpm
spawn rpm --addsign 50mbexample.noarch.rpm
Enter pass phrase:
Pass phrase is good.
$ rpm -qpi 50mbexample.noarch.rpm|grep ^Signature
Signature   : (none)

The package does not get signed, however, an unfinished (and temporary) RPM file can be found under /var/tmp:

# ls -lh /var/tmp/
total 299M
-rw------- 1 bamboo bamboo 299M Sep 25 10:08 rpm-tmp.gTZIEY

Environment

Red Hat Enterprise Linux 6
expect-5.44.1.15-4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.