summaryrefslogtreecommitdiff
path: root/meta/classes/archiver.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-12-08 21:29:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-13 22:47:29 +0000
commitd0b282bce34db44dde4dd7f53a64dfaafe6789de (patch)
tree013549cf2491614e47ffc1e19b058d161ad59b83 /meta/classes/archiver.bbclass
parenta9fac12157ed434a6711de1af77eda1f4a8e9e8a (diff)
downloadopenembedded-core-d0b282bce34db44dde4dd7f53a64dfaafe6789de.tar.gz
openembedded-core-d0b282bce34db44dde4dd7f53a64dfaafe6789de.tar.bz2
openembedded-core-d0b282bce34db44dde4dd7f53a64dfaafe6789de.zip
archiver: don't change directory when generating tarball
There's no need to chdir() as tarfile.add() can be told what name to use in the archive. Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/archiver.bbclass')
-rw-r--r--meta/classes/archiver.bbclass8
1 files changed, 2 insertions, 6 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 9239983e8f..3543ca9c58 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -125,7 +125,7 @@ python () {
# (e.g. git repositories) is "unpacked" and then put into a tarball.
python do_ar_original() {
- import shutil, tarfile, tempfile
+ import shutil, tempfile
if d.getVarFlag('ARCHIVER_MODE', 'src', True) != "original":
return
@@ -261,13 +261,9 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
filename = '%s.tar.gz' % d.getVar('PF', True)
tarname = os.path.join(ar_outdir, filename)
- srcdir = srcdir.rstrip('/')
- dirname = os.path.dirname(srcdir)
- basename = os.path.basename(srcdir)
- os.chdir(dirname)
bb.note('Creating %s' % tarname)
tar = tarfile.open(tarname, 'w:gz')
- tar.add(basename)
+ tar.add(srcdir, arcname=os.path.basename(srcdir))
tar.close()
# creating .diff.gz between source.orig and source