From patchwork Thu Oct 13 13:05:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 13005956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FE43C433FE for ; Thu, 13 Oct 2022 13:05:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.422027.667881 (Exim 4.92) (envelope-from ) id 1oixu8-0003nL-Fk; Thu, 13 Oct 2022 13:05:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 422027.667881; Thu, 13 Oct 2022 13:05:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oixu7-0003kD-Vc; Thu, 13 Oct 2022 13:05:39 +0000 Received: by outflank-mailman (input) for mailman id 422027; Thu, 13 Oct 2022 13:05:38 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oixu5-0002ig-UJ for xen-devel@lists.xenproject.org; Thu, 13 Oct 2022 13:05:37 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b9d1c306-4af7-11ed-91b4-6bf2151ebd3b; Thu, 13 Oct 2022 15:05:36 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b9d1c306-4af7-11ed-91b4-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1665666336; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W6vCbrh65CqtneFRPKerc/tF+uYF6bBQ+treqeycw4E=; b=SGWnzbWl795oZfchXHCSe88gPRYftZsJ87Kjp2lJaEvtAdXBscoiDmiq 5pbtffp1MIx0ZqujnKv93cpJtFWC62C9gjgNSCBVh0H+yK8TPQFXN2vnC N2hMxrEb5RxQDGHBpAnI4TokM5Fy3PLsPOOUZJQxd5WUFZKwmVAMuycMV c=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 2.7 X-MesageID: 82660726 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:O8z5oa6QIBiWaU9H14PguAxR2vbMJQxQLiYv2ybIWGNS2BzvzP5K+TjmH0vNjFa4fxt22/8FxV2p3KMkOC67Ar4lOsC3atGE9cPM/RmyDZ4Y+LPjuR6OhGYfSQBBz2fMjOQdUg4vbJtmBOWi4zEqUdqZzZT0izEmbOWWRMqKXEOmWI3X6JvEkroYIpUU1ZfAZJOWzzG+58wvmrF0hrUns2YH23FhWc6Uk73zQNc5mjFzKovuiuDsx9ZLhp5n3+HHlJqYYwvzSPZ/1NgS0foL4XD49D6moxF5Bi50IyxgqwRO082RQGfsqZGASANQ0GDzVJt0Yb59mgdSuZYaXeMmk5DwvGjS5qFrtyVJiDdjveR6CwAqOaK1Su1DJLTGNiVYkxvheQE7NLfg3py667s6287d6QE0OToROgWwpKIhvxouHLR/sRzY5zVLTpxu7TVCcPM0HX3E+DMkLWx+8fx/pT7kNReK4BCqOo0SazDT/ee1cqef4DtNM8Qx8iKBG4CaP72OMVO6iYBOAqpS1HOrBHx141T+g1yGGReGdTG95OF/kYB53f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1fQRr4NP0U0J/ucvh/F9HhZd6IwcxHmKHkFmsiYkGiMrAwaU8c6+UhdkdydemQDhYbv8FB4Lqwo9h0VOM X-IronPort-AV: E=Sophos;i="5.95,180,1661832000"; d="scan'208";a="82660726" From: Anthony PERARD To: CC: Anthony PERARD , Andrew Cooper , George Dunlap , "Jan Beulich" , Julien Grall , "Stefano Stabellini" , Wei Liu Subject: [XEN PATCH for-4.17 v5 08/17] git-checkout.sh: handle running git-checkout from a different directory Date: Thu, 13 Oct 2022 14:05:04 +0100 Message-ID: <20221013130513.52440-9-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221013130513.52440-1-anthony.perard@citrix.com> References: <20221013130513.52440-1-anthony.perard@citrix.com> MIME-Version: 1.0 "$DIR" might not be a full path and it might not have `pwd` as ".." directory. So use `cd -` to undo the first `cd` command. Also, use `basename` to make a symbolic link with a relative path. This doesn't matter yet but it will when for example the commands to clone OVMF is been run from tools/ rather than tools/firmware/. Signed-off-by: Anthony PERARD --- Notes: v4: - new patch scripts/git-checkout.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/git-checkout.sh b/scripts/git-checkout.sh index 20ae31ff23..fd4425ac4e 100755 --- a/scripts/git-checkout.sh +++ b/scripts/git-checkout.sh @@ -19,9 +19,9 @@ if test \! -d $DIR-remote; then cd $DIR-remote.tmp $GIT branch -D dummy >/dev/null 2>&1 ||: $GIT checkout -b dummy $TAG - cd .. + cd - fi mv $DIR-remote.tmp $DIR-remote fi rm -f $DIR -ln -sf $DIR-remote $DIR +ln -sf $(basename $DIR-remote) $DIR