From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: git@vger.kernel.org
Cc: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Subject: [PATCH 2/4] ci/install-dependencies: libify p4 and git-lfs installation
Date: Fri, 3 Mar 2023 20:46:04 +0700 [thread overview]
Message-ID: <13137839f39bdcbc56eae9e96894b5ebe4072374.1677850518.git.congdanhqx@gmail.com> (raw)
In-Reply-To: <cover.1677850517.git.congdanhqx@gmail.com>
In a later change, we will install git-lfs for CircleCI test
environment. Let move those installations out in order to reuse them.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
ci/install-dependencies.sh | 38 +++++++++++++++++++++++++++++---------
1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 4f407530d3..9a32af8968 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -6,16 +6,12 @@
. ${0%/*}/lib.sh
P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
-LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
+LFSWHENCE=https://github.com/github/git-lfs/releases/download
UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl"
-case "$runs_on_pool" in
-ubuntu-*)
- sudo apt-get -q update
- sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
- $UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE
+_install_linux_p4() {
mkdir --parents "$P4_PATH"
pushd "$P4_PATH"
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
@@ -23,12 +19,36 @@ ubuntu-*)
chmod u+x p4d
chmod u+x p4
popd
+}
+
+_install_linux_git_lfs() {
+ local whence fname
+ whence="$1"
+ fname="$2"
mkdir --parents "$GIT_LFS_PATH"
pushd "$GIT_LFS_PATH"
- wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
- tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
- cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
+ wget --quiet "$whence/$fname"
+ tar --extract --gunzip --strip-components=1 --file "$fname"
popd
+}
+
+case "$runs_on_pool" in
+ubuntu-*)
+ sudo apt-get -q update
+ sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
+ $UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE
+
+ case "$(uname -m)" in
+ x86_64)
+ _install_linux_p4
+ _install_linux_git_lfs "$LFSWHENCE/v${LINUX_GIT_LFS_VERSION}" \
+ "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
+ ;;
+ *)
+ echo "Not supported architecture" >&2
+ exit 1
+ ;;
+ esac
;;
macos-*)
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
--
2.40.0.rc1.2.gd15644fe02
next prev parent reply other threads:[~2023-03-03 13:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 13:46 [PATCH 0/4] Add a CI for unsigned char system Đoàn Trần Công Danh
2023-03-03 13:46 ` [PATCH 1/4] ci/lib.sh: remove an useless break Đoàn Trần Công Danh
2023-03-03 13:46 ` Đoàn Trần Công Danh [this message]
2023-03-03 13:46 ` [PATCH 3/4] ci/install-dependencies: install git-lfs for arm64 build Đoàn Trần Công Danh
2023-03-03 13:46 ` [PATCH 4/4] ci: add arm64 CI environment via CircleCI Đoàn Trần Công Danh
2023-03-03 13:54 ` Đoàn Trần Công Danh
2023-03-09 9:53 ` [PATCH 0/4] Add a CI for unsigned char system Jeff King
2023-03-09 10:26 ` Chris Torek
2023-03-09 10:57 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13137839f39bdcbc56eae9e96894b5ebe4072374.1677850518.git.congdanhqx@gmail.com \
--to=congdanhqx@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).