[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN PATCH for-4.17 v5 08/17] git-checkout.sh: handle running git-checkout from a different directory
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Date: Thu, 13 Oct 2022 14:05:04 +0100
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
- Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 13 Oct 2022 13:05:40 +0000
- Ironport-data: A9a23:O8z5oa6QIBiWaU9H14PguAxR2vbMJQxQLiYv2ybIWGNS2BzvzP5K+TjmH0vNjFa4fxt22/8FxV2p3KMkOC67Ar4lOsC3atGE9cPM/RmyDZ4Y+LPjuR6OhGYfSQBBz2fMjOQdUg4vbJtmBOWi4zEqUdqZzZT0izEmbOWWRMqKXEOmWI3X6JvEkroYIpUU1ZfAZJOWzzG+58wvmrF0hrUns2YH23FhWc6Uk73zQNc5mjFzKovuiuDsx9ZLhp5n3+HHlJqYYwvzSPZ/1NgS0foL4XD49D6moxF5Bi50IyxgqwRO082RQGfsqZGASANQ0GDzVJt0Yb59mgdSuZYaXeMmk5DwvGjS5qFrtyVJiDdjveR6CwAqOaK1Su1DJLTGNiVYkxvheQE7NLfg3py667s6287d6QE0OToROgWwpKIhvxouHLR/sRzY5zVLTpxu7TVCcPM0HX3E+DMkLWx+8fx/pT7kNReK4BCqOo0SazDT/ee1cqef4DtNM8Qx8iKBG4CaP72OMVO6iYBOAqpS1HOrBHx141T+g1yGGReGdTG95OF/kYB53fkvMt6wqJzskExbrYeG37O/4zQnw1elE+Rke2T7GNO44DrWGJo9xYW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8c6+UhdkdydemQDhYbv8FB4Lqwo9h0VOM
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
"$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 <anthony.perard@xxxxxxxxxx>
---
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
--
Anthony PERARD
|