COMMON: Add do_git_fetch function to common functions

This commit is contained in:
Le Philousophe
2020-03-28 09:49:47 +00:00
parent 183b510727
commit a47d026ec5
4 changed files with 13 additions and 14 deletions
+12 -1
View File
@@ -52,6 +52,17 @@ __do_http_fetch () {
do_patch
}
__do_git_fetch () {
if [ -d "$1"*/ ]; then
rm -rf "$1"*/
fi
git clone "$2" "$1"
cd "$1"*/
git checkout "$3"
git submodule update --init
do_patch
}
__do_configure () {
./configure --prefix=$PREFIX --host=$HOST --disable-shared "$@"
}
@@ -82,7 +93,7 @@ __error () {
# but still use base function (Poor man's inheritance)
# Aliases are expanded at definition time so that's not the good way
for f in do_make_bdir do_clean_bdir do_patch do_pkg_fetch do_http_fetch \
do_configure do_cmake do_make log error; do
do_git_fetch do_configure do_cmake do_make log error; do
eval "$f () { __$f \"\$@\"; }"
done
+1
View File
@@ -12,6 +12,7 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
cmake \
debhelper \
dpkg-dev \
git \
gnupg \
libtool \
make \
-3
View File
@@ -12,12 +12,9 @@ FROM toolchains/devkitarm
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
git \
zip && \
rm -rf /var/lib/apt/lists/*
COPY functions-platform.sh lib-helpers/
# We need to compile tools before setting environment for all other packages
# We do this now !
local_package(bannertool)
@@ -1,10 +0,0 @@
do_git_fetch () {
if [ -d "$1"*/ ]; then
rm -rf "$1"*/
fi
git clone "$2" "$1"
cd "$1"*/
git checkout "$3"
git submodule update --init
do_patch
}