From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6995471841453146112 X-Received: by 2002:a2e:8e86:: with SMTP id z6mr3072019ljk.222.1628885615162; Fri, 13 Aug 2021 13:13:35 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:691e:: with SMTP id e30ls787256lfc.0.gmail; Fri, 13 Aug 2021 13:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTfbRWl67J9a+3CO1lptnIOkDpaxZ/qyMakmoheuM+RlUA2BWirgsWogr1rVjqjK5NLuwn X-Received: by 2002:a05:6512:4029:: with SMTP id br41mr2788786lfb.621.1628885614080; Fri, 13 Aug 2021 13:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628885614; cv=none; d=google.com; s=arc-20160816; b=IPOVtEYDmstjwBgads8d5BPjWFMPAj1HBKyd9xHoTNYND3GBnox3tOAmZhq7j1gKjp jyTsIDqtqpUz8TOpkW3rQAOlfo3kPr/t5pavTrAARKwheyWNWRGyy90YVcZEne9RCkNp p3hbp/sOmkE6wVcC1jp1kgjnuhxf62O3t/ln6HkcAa8v+A/bRDwx+sZ0KsCzoWT99vt4 YRYCFvi0l+Q81ae1m44lOPc8qYv++uoMwsO/0vIT+4BycdBob5aNTxKvbOTke1CnJsqh G2y+UdY/0+mssOUoAzIi2r30G0oWxPT9YWTOEYSwyNr2feOZdKLKoy2UUz5/y5XHBT2N DqlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=LuRZGJGDz5N91c8VludOxSYAhMGorBy5kxQ/8y+6vdU=; b=A8cksQjZsepu38+BR1k5CaMFS3U+1xH3fBM04keUSI2AbolyZ5Sn+FYm1hgj6oluyQ BtUVkN5Q3FhJ7GuDGlfXDz2Rya/vZ+Q3+LDZ8GX9eNQrgXwuNRKWMZonKazD9/SOlv3A eH/Wp30VSrJLL5icFnL3gfY0cxZSN6ENKxVJ/Y3KZYmiFOuwvveJdPzpxjCuw6a3qjba IdOLDYbYtQXcw+F7IqzM5Fu0sxI9Nkpw1QHyDjD+XTMuVBBtaWtq4IJ+JsF5t7H6ISPJ 0WSJD6bhZT5rroABvDf05bq/Zr5G6KGBAU9cCd6MRkbNLrXEI8vi+TDSIopT835aibby amvg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id i5si137448lfl.2.2021.08.13.13.13.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Aug 2021 13:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 17DKDXm5011136 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 13 Aug 2021 22:13:33 +0200 Received: from localhost.localdomain ([167.87.32.22]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 17DKDXiP012166; Fri, 13 Aug 2021 22:13:33 +0200 From: Henning Schild To: isar-users Cc: Jan Kiszka , Henning Schild Subject: [PATCH v2] dpkg-base: "unshare" git clones in adjust_git Date: Fri, 13 Aug 2021 22:13:31 +0200 Message-Id: <20210813201331.24889-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813174944.8833-1-henning.schild@siemens.com> References: <20210813174944.8833-1-henning.schild@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: Q/65s3q+2JIG Instead of messing with the alternate make the clone not "shared" anymore. Doing that will allow us to use git as a patchtool, also in incremental rebuilds where do_patch might run again after do_adjust_git It will also make sure git repos will be usable in all three environments. On a container host, inside the container, and inside the chroot ... as apposed to only the chroot in the end. Signed-off-by: Henning Schild --- meta/classes/dpkg-base.bbclass | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index ec8fbc14d5e4..82a4b39f1001 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -45,19 +45,18 @@ python do_adjust_git() { alternates = os.path.join(destdir, ".git/objects/info/alternates") if os.path.exists(alternates): - cmd = ["sed", "-i", alternates, "-e", - "s|{}|/downloads|".format(d.getVar("DL_DIR"))] + cmd = ["git", "-C", destdir, "repack", "-a" ] bb.note(' '.join(cmd)) if subprocess.call(cmd) != 0: - bb.fatal("git alternates adjustment failed") + bb.fatal("git repack failed") + os.remove(alternates) except bb.fetch2.BBFetchException as e: bb.fatal(str(e)) } -addtask adjust_git before do_dpkg_build +addtask adjust_git after do_unpack before do_dpkg_build inherit patch -addtask patch before do_adjust_git SRC_APT ?= "" -- 2.31.1