# This file is used for archiving sources ,patches,and logs to tarball. # It also output building environment to xxx.dump.data and create xxx.diff.gz to record # all content in ${S} to a diff file. ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache" ARCHIVE_TYPE ?= "TAR SRPM" DISTRO ?= "poky" PATCHES_ARCHIVE_WITH_SERIES = 'TRUE' def compat_cmp(a, b): return (a>b)-(a " + diff_file d.setVar('DIFF', cmd + "\n") d.setVarFlag('DIFF', 'func', '1') bb.build.exec_func('DIFF', d) shutil.rmtree(s + '.org', ignore_errors=True) # This function will run when user want to get tarball for sources and patches after do_unpack python do_archive_original_sources_patches(){ archive_sources_patches(d,'prepatch') } # This function will run when user want to get tarball for patched sources after do_patch python do_archive_patched_sources(){ archive_sources_patches(d,'patched') } # This function will run when user want to get tarball for configured sources after do_configure python do_archive_configured_sources(){ archive_sources_patches(d,'configured') } # This function will run when user want to get tarball for logs or both logs and scripts(.bb and .inc files) python do_archive_scripts_logs(){ archive_scripts_logs(d) } # This function will run when user want to know what variable and functions in a running task are and also can get a diff file including # all content a package should include. python do_dumpdata_create_diff_gz(){ dumpdata(d) create_diff_gz(d) } # This functions prepare for archiving "linux-yocto" because this package create directory 's' before do_patch instead of after do_unpack. # This is special control for archiving linux-yocto only. python do_archive_linux_yocto(){ s = d.getVar('S', True) if 'linux-yocto' in s: source_tar_name = archive_sources(d,'') if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in 'SRPM': move_tarball_deploy(d,[source_tar_name,'']) } do_kernel_checkout[postfuncs] += "do_archive_linux_yocto " # remove tarball for sources, patches and logs after creating srpm. python do_remove_tarball(){ if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': work_dir = d.getVar('WORKDIR', True) try: for file in os.listdir(os.getcwd()): if file in get_package(d): os.remove(file) os.remove(os.path.join(work_dir,'tar-package')) except (TypeError,OSError): pass } do_remove_taball[deptask] = "do_archive_scripts_logs" do_package_write_rpm[postfuncs] += "do_remove_tarball " export get_licenses export get_package