mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-07-02 01:28:42 +08:00
Support downloading tar archive, instead of git repo
This commit is contained in:
parent
c20fed785f
commit
f1e261f868
36
cook.sh
36
cook.sh
@ -48,19 +48,41 @@ function op {
|
||||
op $1 unfetch
|
||||
;;
|
||||
fetch)
|
||||
if [ ! -d build ]
|
||||
if [ -z "$GIT" ]
|
||||
then
|
||||
git clone --recursive "$GIT" build
|
||||
if [ ! -f "$(basename "$SRC")" ]
|
||||
then
|
||||
wget "$SRC"
|
||||
fi
|
||||
|
||||
rm -rf build
|
||||
tar xvf "$(basename "$SRC")"
|
||||
mv "$DIR" build
|
||||
else
|
||||
if [ ! -d build ]
|
||||
then
|
||||
git clone --recursive "$GIT" build
|
||||
fi
|
||||
|
||||
pushd build > /dev/null
|
||||
git pull
|
||||
git submodule sync
|
||||
git submodule update --init --recursive
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
if [ -f "patch" ]
|
||||
then
|
||||
patch -p1 -d build < patch
|
||||
fi
|
||||
|
||||
pushd build > /dev/null
|
||||
git pull
|
||||
git submodule sync
|
||||
git submodule update --init --recursive
|
||||
popd > /dev/null
|
||||
;;
|
||||
unfetch)
|
||||
rm -rfv build
|
||||
if [ ! -z "$SRC" ]
|
||||
then
|
||||
rm -f "$(basename "$SRC")"
|
||||
fi
|
||||
;;
|
||||
version)
|
||||
pushd build > /dev/null
|
||||
|
||||
Loading…
Reference in New Issue
Block a user