diff options
-rw-r--r-- | meta/classes/sstate.bbclass | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index d09e27aee4..ba18f54428 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
@@ -268,6 +268,20 @@ def sstate_install(ss, d): | |||
268 | sstate_install[vardepsexclude] += "SSTATE_DUPWHITELIST STATE_MANMACH SSTATE_MANFILEPREFIX" | 268 | sstate_install[vardepsexclude] += "SSTATE_DUPWHITELIST STATE_MANMACH SSTATE_MANFILEPREFIX" |
269 | sstate_install[vardeps] += "${SSTATEPOSTINSTFUNCS}" | 269 | sstate_install[vardeps] += "${SSTATEPOSTINSTFUNCS}" |
270 | 270 | ||
271 | def sstate_build_gpg_command(d, *args, **kwargs): | ||
272 | # Returns a list for subprocess.call() unless passed flatten=True when this | ||
273 | # returns a flattened string. | ||
274 | l = [d.getVar("GPG_BIN", True) or "gpg"] | ||
275 | if d.getVar("GPG_PATH", True): | ||
276 | l += ["--homedir", d.getVar("GPG_PATH", True)] | ||
277 | l += args | ||
278 | |||
279 | if kwargs.get("flatten", False): | ||
280 | import pipes | ||
281 | return " ".join(map(pipes.quote, l)) | ||
282 | else: | ||
283 | return l | ||
284 | |||
271 | def sstate_installpkg(ss, d): | 285 | def sstate_installpkg(ss, d): |
272 | import oe.path | 286 | import oe.path |
273 | import subprocess | 287 | import subprocess |
@@ -296,7 +310,7 @@ def sstate_installpkg(ss, d): | |||
296 | d.setVar('SSTATE_PKG', sstatepkg) | 310 | d.setVar('SSTATE_PKG', sstatepkg) |
297 | 311 | ||
298 | if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False): | 312 | if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False): |
299 | if subprocess.call(["gpg", "--verify", sstatepkg + ".sig", sstatepkg]) != 0: | 313 | if subprocess.call(sstate_build_gpg_command(d, "--verify", sstatepkg + ".sig", sstatepkg)) != 0: |
300 | bb.warn("Cannot verify signature on sstate package %s" % sstatepkg) | 314 | bb.warn("Cannot verify signature on sstate package %s" % sstatepkg) |
301 | 315 | ||
302 | for f in (d.getVar('SSTATEPREINSTFUNCS', True) or '').split() + ['sstate_unpack_package'] + (d.getVar('SSTATEPOSTUNPACKFUNCS', True) or '').split(): | 316 | for f in (d.getVar('SSTATEPREINSTFUNCS', True) or '').split() + ['sstate_unpack_package'] + (d.getVar('SSTATEPOSTUNPACKFUNCS', True) or '').split(): |
@@ -672,12 +686,12 @@ sstate_create_package () { | |||
672 | else | 686 | else |
673 | tar -cz --file=$TFILE --files-from=/dev/null | 687 | tar -cz --file=$TFILE --files-from=/dev/null |
674 | fi | 688 | fi |
675 | chmod 0664 $TFILE | 689 | chmod 0664 $TFILE |
676 | mv -f $TFILE ${SSTATE_PKG} | 690 | mv -f $TFILE ${SSTATE_PKG} |
677 | 691 | ||
678 | if [ -n "${SSTATE_SIG_KEY}" ]; then | 692 | if [ -n "${SSTATE_SIG_KEY}" ]; then |
679 | rm -f ${SSTATE_PKG}.sig | 693 | rm -f ${SSTATE_PKG}.sig |
680 | echo ${SSTATE_SIG_PASSPHRASE} | gpg --batch --passphrase-fd 0 --detach-sign --local-user ${SSTATE_SIG_KEY} --output ${SSTATE_PKG}.sig ${SSTATE_PKG} | 694 | echo ${SSTATE_SIG_PASSPHRASE} | ${@sstate_build_gpg_command(d, "--batch", "--passphrase-fd", "0", "--detach-sign", "--local-user", "${SSTATE_SIG_KEY}", "--output", "${SSTATE_PKG}.sig", "${SSTATE_PKG}", flatten=True)} |
681 | fi | 695 | fi |
682 | 696 | ||
683 | cd ${WORKDIR} | 697 | cd ${WORKDIR} |