From patchwork Sun Jul 7 05:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1128572 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AZHYUfrG"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45hHGN3hFGz9s8m for ; Sun, 7 Jul 2019 15:30:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 02216844D3; Sun, 7 Jul 2019 05:30:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DGXGXdMALGcO; Sun, 7 Jul 2019 05:30:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6138B84506; Sun, 7 Jul 2019 05:30:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id C13271BF956 for ; Sun, 7 Jul 2019 05:29:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BB24E84506 for ; Sun, 7 Jul 2019 05:29:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sux47e9gfw6a for ; Sun, 7 Jul 2019 05:29:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 4DAC7844D3 for ; Sun, 7 Jul 2019 05:29:59 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id cl9so6505738plb.10 for ; Sat, 06 Jul 2019 22:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QdIjDL0MK/1MQ0hGChhz+gL159ZMD1GlJvokF5OE3Wg=; b=AZHYUfrGuaBwdlj2kBNaSYPEIBMDfg+68qmQUypTmE1VINUdf1A2J1ppnhB3In9W1S 1g+wtnJJOtukPK7e1DnV+4vDPrJaqdPLbAsQ1NW+I2/5lEJQE4FisazONSF+l+EyhJps KD+v1JXi1C2uARpZgCylInJGh7L0+tOT0fxccWUU3JY8yQmxcoV3RErtPgDtp67Skpsu GdqTeb4plI4bngIAR0M55TC1br9pPNej05r2D2RTMTkZ78FCT7EOXn7jnvPQh6A1bsyE dxhuIf5XUCCR1ziVcFJcY9pnR+H/S7heV8N9BR2roStj27vMJzc5D5wIDbt0bB0x7v0R fZVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QdIjDL0MK/1MQ0hGChhz+gL159ZMD1GlJvokF5OE3Wg=; b=VfgqAsExqPcg3zOV4um/XQkbmWyO8I2S2cwC0hd8Oy2w3dVmFRGEk9qYVNrml+nL6j 6aHGfQKLr+aS6HXyH7B0e6ShVthPS8mnk0lOZb3JLj0MATpcGQjjxXfoF5sGpNSqVqAE MWB+ZQaADlGpaJE00Z/xBo9VIoLfDHbeP4HobLq30xPfUtD9emSXLheCxwC0fkhtv5GV xbuPFOS8F6d+uKEfmcFIR7YepR5wEYjKvgC5amf5xZ6g5BFIzyLvXNJU9NryHSGkTTZv Uz8W1uuvTrt7Odr7Kvza9vo6OpNwEtfBrD+4qC2Vb9p27If/887RLjZplWJgUgYEMdwE d8cg== X-Gm-Message-State: APjAAAVmC2ijoVOldnA6ZAl3GfTjaeqsdSc1gaNWSiVNAMhcTlCKctfn ecqP4NoS3KI1prlcvTK8nRcVH41IcYcQnQ== X-Google-Smtp-Source: APXvYqwoVdh6wyqIWSpWf0+Geo6mwsEqNd3HsO5sTdgBP27AkgJaIfKCMOJ9CkovUxp3C03AqRhiOA== X-Received: by 2002:a17:902:704a:: with SMTP id h10mr14694962plt.337.1562477398593; Sat, 06 Jul 2019 22:29:58 -0700 (PDT) Received: from localhost.localdomain ([123.201.194.71]) by smtp.gmail.com with ESMTPSA id j24sm18039214pgg.86.2019.07.06.22.29.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 06 Jul 2019 22:29:58 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sun, 7 Jul 2019 10:58:27 +0530 Message-Id: <20190707052831.9469-27-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190707052831.9469-1-itsatharva@gmail.com> References: <20190707052831.9469-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 27/31] scripts/autobuild-run: support changing repo X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas Petazzoni The current logic in prepare_build() assumes that the "origin" repo never changes. However, if one regularly changes his autobuild-run configuration, switching being repository, this is not true. Currently, it requires manually wiping out the Buildroot clone in every autobuild instance when changing the repository to pull from. So instead, use: git fetch git checkout FETCH_HEAD which will easily allow switching from one repo to the other. Signed-off-by: Thomas Petazzoni [Atharva: Adapted Thomas' patches to work with Builder class] Signed-off-by: Atharva Lele Reviewed-by: Arnout Vandecappelle (Essensium/Mind) --- Changes v1 -> v2: - Incorporate Thomas' patch into Builder class series --- scripts/autobuild-run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 8011ebb..acd1547 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -361,12 +361,12 @@ class Builder: # Update the Buildroot sources. abssrcdir = os.path.abspath(self.srcdir) - ret = subprocess.call(["git", "fetch", "origin"], cwd=abssrcdir, stdout=self.log, stderr=self.log) + ret = subprocess.call(["git", "fetch", self.repo, branch], cwd=abssrcdir, stdout=self.log, stderr=self.log) if ret != 0: log_write(self.log, "ERROR: could not fetch Buildroot sources") return -1 - ret = subprocess.call(["git", "checkout", "--detach", "origin/%s" % branch], cwd=abssrcdir, stdout=self.log, stderr=self.log) + ret = subprocess.call(["git", "checkout", "FETCH_HEAD"], cwd=abssrcdir, stdout=self.log, stderr=self.log) if ret != 0: log_write(self.log, "ERROR: could not check out Buildroot sources") return -1