Fix buildhistory problem
cover Fix buildhistory problem
Tested with all backends. Fixed some other issues in the process... Buildhistory should be fine now.
laurentiu
The following changes since commit 54562006c1327c5b99daa4cc05a3ba7e38412da1:
image_types.bbclass: Fix tar IMAGE_CMD to not change directories (2014-02-18 08:38:52 +0000)
are available in the git repository at:
git://mirror.rb.intel.com/git.yoctoproject.org/poky-contrib lpalcu/buildhistory_fix
for you to fetch changes up to 15ce4b01408e1ec91655103191c4c9436d894597:
populate_sdk_*.bbclass: remove left over bash routines (2014-02-19 12:45:51 +0200)
----------------------------------------------------------------
Laurentiu Palcu (3):
package_manager.py: fix installed package list creation for Opkg/Dpkg buildhistory.bbclass: fix creation of installed packages list populate_sdk_*.bbclass: remove left over bash routines
meta/classes/buildhistory.bbclass | 21 +++++++++++++++++---- meta/classes/populate_sdk_deb.bbclass | 21 --------------------- meta/classes/populate_sdk_ipk.bbclass | 20 -------------------- meta/lib/oe/package_manager.py | 6 ++++-- 4 files changed, 21 insertions(+), 47 deletions(-)
Laurentiu Palcu (3):
package_manager.py: fix installed package list creation for Opkg/Dpkg buildhistory.bbclass: fix creation of installed packages list populate_sdk_*.bbclass: remove left over bash routines
meta/classes/buildhistory.bbclass | 21 +++++++++++++++++---- meta/classes/populate_sdk_deb.bbclass | 21 --------------------- meta/classes/populate_sdk_ipk.bbclass | 20 -------------------- meta/lib/oe/package_manager.py | 6 ++++-- 4 files changed, 21 insertions(+), 47 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/3 package_manager.py: fix installed package list creation for Opkg/Dpkg
Small error in the package list creation routine. Buildhistory was supposed to use this but was never called. Hence, it escaped tests...
--- meta/lib/oe/package_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meta/lib/oe/package_manager.py +4 -2
@@ -1134,7 +1134,8 @@ class OpkgPM(PackageManager): if format == "file": tmp_output = "" - for pkg, pkg_file, pkg_arch in tuple(output.split('\n')): + for line in output.split('\n'): + pkg, pkg_file, pkg_arch = line.split() full_path = os.path.join(self.deploy_dir, pkg_arch, pkg_file) if os.path.exists(full_path): tmp_output += "%s %s %s\n" % (pkg, full_path, pkg_arch)
@@ -1435,7 +1436,8 @@ class DpkgPM(PackageManager): if format == "file": tmp_output = "" - for pkg, pkg_file, pkg_arch in tuple(output.split('\n')): + for line in tuple(output.split('\n')): + pkg, pkg_file, pkg_arch = line.split() full_path = os.path.join(self.deploy_dir, pkg_arch, pkg_file) if os.path.exists(full_path): tmp_output += "%s %s %s\n" % (pkg, full_path, pkg_arch)
Signature · 1 line
1.7.9.5
PATCH 2/3 buildhistory.bbclass: fix creation of installed packages list
In reply to Laurentiu PalcuCall the new python routines to create the packages list.
[YOCTO #5831]
--- meta/classes/buildhistory.bbclass | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
meta/classes/buildhistory.bbclass +17 -4
@@ -311,13 +311,23 @@ def write_pkghistory(pkginfo, d): if os.path.exists(filevarpath): os.unlink(filevarpath) +python buildhistory_list_installed() { + from oe.rootfs import list_installed_packages + + pkgs_list_file = os.path.join(d.getVar('WORKDIR', True), + "bh_installed_pkgs.txt") + + with open(pkgs_list_file, 'w') as pkgs_list: + pkgs_list.write(list_installed_packages(d, 'file')) +} + buildhistory_get_installed() { mkdir -p $1 # Get list of installed packages pkgcache="$1/installed-packages.tmp" - list_installed_packages file | sort > $pkgcache + cat ${WORKDIR}/bh_installed_pkgs.txt | sort > $pkgcache && rm ${WORKDIR}/bh_installed_pkgs.txt cat $pkgcache | awk '{ print $1 }' > $1/installed-package-names.txt if [ -s $pkgcache ] ; then
@@ -452,13 +462,16 @@ END } # By prepending we get in before the removal of packaging files -ROOTFS_POSTPROCESS_COMMAND =+ "buildhistory_get_image_installed ; " +ROOTFS_POSTPROCESS_COMMAND =+ " buildhistory_list_installed ;\ + buildhistory_get_image_installed ; " IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; " # We want these to be the last run so that we get called after complementary package installation -POPULATE_SDK_POST_TARGET_COMMAND_append = "buildhistory_get_sdk_installed_target ; " -POPULATE_SDK_POST_HOST_COMMAND_append = "buildhistory_get_sdk_installed_host ; " +POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed ;\ + buildhistory_get_sdk_installed_target ; " +POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed ;\ + buildhistory_get_sdk_installed_host ; " SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "
Signature · 1 line
1.7.9.5
PATCH 3/3 populate_sdk_*.bbclass: remove left over bash routines
In reply to Laurentiu PalcuThe list_installed_packages bash routine is no longer needed here. We've got a python replacement.
--- meta/classes/populate_sdk_deb.bbclass | 21 --------------------- meta/classes/populate_sdk_ipk.bbclass | 20 -------------------- 2 files changed, 41 deletions(-)
meta/classes/populate_sdk_deb.bbclass +0 -21
@@ -11,27 +11,6 @@ do_populate_sdk[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock" # This will of course only work after rootfs_deb_do_rootfs or populate_sdk_deb has been called DPKG_QUERY_COMMAND = "${STAGING_BINDIR_NATIVE}/dpkg-query --admindir=$INSTALL_ROOTFS_DEB/var/lib/dpkg" -list_installed_packages() { - if [ "$1" = "arch" ] ; then - # Here we want the PACKAGE_ARCH not the deb architecture - ${DPKG_QUERY_COMMAND} -W -f='${Package} ${PackageArch}\n' - elif [ "$1" = "file" ] ; then - ${DPKG_QUERY_COMMAND} -W -f='${Package} ${Package}_${Version}_${Architecture}.deb ${PackageArch}\n' | while read pkg pkgfile pkgarch - do - fullpath=`find ${DEPLOY_DIR_DEB} -name "$pkgfile" || true` - if [ "$fullpath" = "" ] ; then - echo "$pkg $pkgfile $pkgarch" - else - echo "$pkg $fullpath $pkgarch" - fi - done - elif [ "$1" = "ver" ] ; then - ${DPKG_QUERY_COMMAND} -W -f='${Package} ${PackageArch} ${Version}\n' - else - ${DPKG_QUERY_COMMAND} -W -f='${Package}\n' - fi -} - rootfs_list_installed_depends() { # Cheat here a little bit by using the opkg query helper util ${DPKG_QUERY_COMMAND} -W -f='Package: ${Package}\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n' | opkg-query-helper.py
meta/classes/populate_sdk_ipk.bbclass +0 -20
@@ -3,26 +3,6 @@ do_populate_sdk[recrdeptask] += "do_package_write_ipk" do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock" -list_installed_packages() { - if [ "$1" = "arch" ] ; then - opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -a - elif [ "$1" = "file" ] ; then - opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -f | while read pkg pkgfile pkgarch - do - fullpath=`find ${DEPLOY_DIR_IPK} -name "$pkgfile" || true` - if [ "$fullpath" = "" ] ; then - echo "$pkg $pkgfile $pkgarch" - else - echo "$pkg $fullpath $pkgarch" - fi - done - elif [ "$1" = "ver" ] ; then - opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py -v - else - opkg-cl ${OPKG_ARGS} list_installed | awk '{ print $1 }' - fi -} - rootfs_list_installed_depends() { opkg-cl ${OPKG_ARGS} status | opkg-query-helper.py }
Signature · 1 line
1.7.9.5