Skip to contentSkip to conversation

archiver: Use subdirectory in WORKDIR when creating archives

RFC PATCH New Martin Jansa 1 participant 1 message Dec 21, 2013

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 archiver: Use subdirectory in WORKDIR when creating archives

From: Martin Jansa <[email protected]>

* RFC: because I haven't tested all possible archiver configurations please check added note about diffgz archives and .org - was it ever working correctly? It was like this since initial commit.

* archiver can sometimes overwrite or remove some files which are needed by other tasks.

This happens in cases where file referenced in SRC_URI aren't unpacked and are used by other tasks directly from WORKDIR

def archive_sources(d, stage_name): downloads sources from SRC_URI again to WORKDIR in order to create source tarball from them (normally it's ok, because source tarball is directly unpacked from DL_DIR so never stays in WORKDIR).

def archive_sources_patches(d, stage_name): then creates the tarball itself and moves source and patch tarballs to deploy with:
move_tarball_deploy(d, [source_tar_name, patch_tar_name])

But in cases where source_tar_name == "required" file we're using:
1) do_unpack downloads "required" from DL_DIR to WORKDIR,
2) archive_sources overwrites it with another copy,
3) archive_sources_patches removes it,
4) do_deploy fails because it wants to install now non-existent ${WORKDIR}/required

* move duplicated ARCHIVE_SSTATE_* assignments from archive-*.bbclass to common archiver.bbclass
* introduce separate workdir for archiver ARCHIVE_SSTATE_WORKDIR and move ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR, ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR into it
* change archiver.bbclass to dump scripts-logs and diffgs-envdata into right directory (respect variables defined above instead of hardcoding the paths in code).
* use d.getVar* API
* unify workdir/work_dir usage for ${WORKDIR} and use separate variable archiver_workdir when it means ARCHIVE_SSTATE_WORKDIR

---
 meta/classes/archive-configured-source.bbclass |   4 -
 meta/classes/archive-original-source.bbclass   |   4 -
 meta/classes/archive-patched-source.bbclass    |   4 -
 meta/classes/archiver.bbclass                  | 108 ++++++++++++++-----------
 4 files changed, 61 insertions(+), 59 deletions(-)
meta/classes/archive-configured-source.bbclass +0 -4
index 961a532..7f6d9ee 100644
@@ -40,10 +40,6 @@ python () {
         d.appendVarFlag('do_build', 'depends', build_deps)
 }
 
-ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
-ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
-ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
-
 SSTATETASKS += "do_archive_scripts_logs"
 do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
 do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
meta/classes/archive-original-source.bbclass +0 -4
index e271a08..d49340d 100644
@@ -40,10 +40,6 @@ python () {
         d.appendVarFlag('do_build', 'depends', build_deps)
 }
 
-ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
-ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
-ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
-
 SSTATETASKS += "do_archive_scripts_logs"
 do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
 do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
meta/classes/archive-patched-source.bbclass +0 -4
index c5f5cca..f7dfad1 100644
@@ -40,10 +40,6 @@ python () {
         d.appendVarFlag('do_build', 'depends', build_deps)
 }
 
-ARCHIVE_SSTATE_OUTDIR = "${DEPLOY_DIR}/sources/"
-ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR = "${WORKDIR}/script-logs/"
-ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR = "${WORKDIR}/diffgz-envdata/"
-
 SSTATETASKS += "do_archive_scripts_logs"
 do_archive_scripts_logs[sstate-inputdirs] = "${ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR}"
 do_archive_scripts_logs[sstate-outputdirs] = "${ARCHIVE_SSTATE_OUTDIR}"
meta/classes/archiver.bbclass +61 -47

276 lines not on this page · raw message

Signature · 1 line
1.8.4.3