diff options
author | Zac Medico <zmedico@gentoo.org> | 2017-11-09 16:26:13 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2017-11-09 16:32:22 -0800 |
commit | f68cbfdfb24218ea11db6e0322a0f05413833b0f (patch) | |
tree | 3917816dd4b2db7fafcc55435107c49f1fcc603c /pym/portage/package | |
parent | Quickfix handling manifest-required-hashes = None (diff) | |
download | portage-f68cbfdfb24218ea11db6e0322a0f05413833b0f.tar.gz portage-f68cbfdfb24218ea11db6e0322a0f05413833b0f.tar.bz2 portage-f68cbfdfb24218ea11db6e0322a0f05413833b0f.zip |
doebuild: record BUILD_ID and BINPKGMD5 for installed package
This is equivalent to the EbuildBuild._record_binpkg_info method
which never gets called when the package is created with the
ebuild(1) command.
Fixes: 328dd4712f88 ("binpkg-multi-instance 3 of 7")
Diffstat (limited to 'pym/portage/package')
-rw-r--r-- | pym/portage/package/ebuild/doebuild.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 66e63b919..0be148fd4 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -1163,8 +1163,23 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0, if retval == os.EX_OK: if mydo == "package" and bintree is not None: - bintree.inject(mysettings.mycpv, + pkg = bintree.inject(mysettings.mycpv, filename=mysettings["PORTAGE_BINPKG_TMPFILE"]) + if pkg is not None: + infoloc = os.path.join( + mysettings["PORTAGE_BUILDDIR"], "build-info") + build_info = { + "BINPKGMD5": "%s\n" % pkg._metadata["MD5"], + } + if pkg.build_id is not None: + build_info["BUILD_ID"] = "%s\n" % pkg.build_id + for k, v in build_info.items(): + with io.open(_unicode_encode( + os.path.join(infoloc, k), + encoding=_encodings['fs'], errors='strict'), + mode='w', encoding=_encodings['repo.content'], + errors='strict') as f: + f.write(v) else: if "PORTAGE_BINPKG_TMPFILE" in mysettings: try: |