From patchwork Thu Dec 8 21:32:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 87348 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1066003qgi; Thu, 8 Dec 2016 13:32:27 -0800 (PST) X-Received: by 10.99.117.71 with SMTP id f7mr135769892pgn.126.1481232747074; Thu, 08 Dec 2016 13:32:27 -0800 (PST) Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id 90si30350751plb.305.2016.12.08.13.32.26; Thu, 08 Dec 2016 13:32:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 5096771C72; Thu, 8 Dec 2016 21:32:10 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by mail.openembedded.org (Postfix) with ESMTP id 4107771C4C for ; Thu, 8 Dec 2016 21:32:05 +0000 (UTC) Received: by mail-wm0-f53.google.com with SMTP id a197so236266688wmd.0 for ; Thu, 08 Dec 2016 13:32:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=U31xnD1VrCH7SgznkBXaOSP4GhkFS9LU/gUfocZlhlQ=; b=SkaYNfmTDT35wecctYfp9hKQBpC2rqlrOoQsjmK4h5bvJ/n449y8BC28j4zW6PRhIB 8yEQ8jirhBfc2VTTiur2m1/RmRA/vB13R8J6cm3DYFT05K5WbiCPeAMZ6u9kxKPUaft+ aQLLqAzFdA7TkTY6QNtwa9OdltCuqkwWBtQOzEudEyHNDFLoocVNTY8sRIkzxadnklVe m4cdbUhu0VL1f+wdKBi/3+/wMjN6t3x5JezNeJUndjwpdnELdoChAG3vFhXXDuEfsCm/ JP2RdagVhEoanx6PjkG6Ex0WoQVkrd5N9Ar33HYpw9OmlNtbfofCheOXewfnQbZHb1Km qumg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=U31xnD1VrCH7SgznkBXaOSP4GhkFS9LU/gUfocZlhlQ=; b=emdlHeU6rcq892l18WWWUeQIOzu5z+zj51W2g6VleGNq/xnVMA3Rew/h53Fi4+fFtA PJcURbwrD9CNljFGpt2PZoSCJWOXrM2M6ybo4x7fB3HHqSM6/iyND3s95Ichzze/8WpI kGmb1z8gCmqRIq6b8Uhj2QE9nxLVE02IgtrlR68ychAM8alhxBVZeWrUm6bsKXBnpag1 dn8MIAHDnB1m+gQR1BEMYJYcLuHLSPNZMxh/3i1HlNMj3fBsfh/s1pOoXOG1UY7UtHDo KQ2i/HxoZaM2nKPSlf7se77HeQkblniQ9u+xYqAGhJRQgAYhpq1H2HRTJoK2BTYb+29U ffgQ== X-Gm-Message-State: AKaTC01Nr839J1TncTgmr512w3NHzNPJNxvtKasyMQu2Z9WwJYS19HcIIlWcGYGKL/3L3h7y X-Received: by 10.28.104.213 with SMTP id d204mr3807493wmc.101.1481232726727; Thu, 08 Dec 2016 13:32:06 -0800 (PST) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id q7sm38985791wjh.9.2016.12.08.13.32.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Dec 2016 13:32:06 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 8 Dec 2016 21:32:03 +0000 Message-Id: <1481232723-12285-1-git-send-email-ross.burton@intel.com> X-Mailer: git-send-email 2.8.1 Subject: [OE-core] [PATCH] archiver: don't change directory when generating tarball X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org There's no need to chdir() as tarfile.add() can be told what name to use in the archive. Signed-off-by: Ross Burton --- meta/classes/archiver.bbclass | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- 2.8.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index 9239983..3543ca9 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