puppetlabs/packaging — pull request #214 by MosesMendoza (2013-10-01 22:41:10+00:00)
Title: Accept overrides for rpm binary and passphrase input

We may move to using a running gpg-agent for signing of rpms. In order to
facilitate this, we need to be able to specify the rpm command to use, because
we need to call a wrapper rather than rpm itself. This is a special case
though, so we want to default to sane regular rpm. A second requirement for the
gpg-agent rpm signing is that we have to be able to switch the input for the
gpg passphrase in the rpm gpg command definition, i.e. we don't want to pass
'--passphrase-fd3' if we're using the agent. This commit supplies solutions to
both of these issues by accepting environment variables for both, allowing us
to set the expected parameters on demand. It moves the actual signing into a
base sign_rpm method that accepts flags for the specific signing we want to do
instead of having to duplicate this logic. Since the sign_modern method is the
equivalent of just calling the sign_rpm method without the second argument
(which is identical to sign_modern) we just get rid of sign_modern altogehter.
Also, we currently send stdout to dev null for rpm signing, but this isn't very
useful to us. This commit removes this, so we can see more about what's
happening when sign rpms.