mirror of
https://git.yoctoproject.org/poky
synced 2026-04-23 00:32:12 +02:00
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. (From OE-Core rev: d0b282bce34db44dde4dd7f53a64dfaafe6789de) (From OE-Core rev: d637d5f02be4eab26cfab7352a8ea584fb1f7e4d) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
29184b22d7
commit
ea584f108c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user