2 # This file is part of The Open GApps script of @mfonville.
4 # The Open GApps scripts are free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # These scripts are distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
16 Darwin|Macintosh
) readlink
() { perl
-MCwd -e 'print Cwd::abs_path shift' "$2"; };;
19 SCRIPT
="$(readlink -f "$0")"
20 TOP
="$(dirname "$SCRIPT")"
21 SCRIPTS
="$TOP/scripts"
23 # shellcheck source=scripts/inc.tools.sh
24 .
"$SCRIPTS/inc.tools.sh"
38 modules
="all arm x86 $1"
41 depth
="--depth=1 --checkout" # checkout instead of rebasing, to avoid that it tries to rebase a huge number of commits in one go, resulting in failures (experimental!)
43 --i-would-really-like-my-diskspace-back)
44 for module
in $modules; do
45 git submodule deinit
-f sources
/$module
46 rm -rf .git
/modules
/sources
/$module
48 echo "NOTICE: All local sources removed! Find more donations for a larger hard disk..."
55 modules
="all arm arm64 x86 x86_64"
61 pushd "$TOP" > /dev
/null
62 for module
in $modules; do
63 git submodule update
--init --remote $depth -- "sources/$module" # --rebase is specifed in .gitmodules
65 echo "ERROR during git execution, aborted!"
68 lzfiles
="$(find "sources
/$module/" -name "*.apk.lz
")" 2>/dev
/null
70 if ! [ -e "$(dirname "$f")/$(basename -s.lz "$f")" ]; then # if this archive was not extracted yet
71 rm -f "$(dirname "$f")/"*.apk
# clean-up any old left over outdated APKs
72 lzip
-d -k -f "$f" # put our new APK in place
76 git submodule foreach
-q 'branch="$(git config -f "$toplevel/.gitmodules" "submodule.$name.branch")"; git checkout -q "$branch"; git pull -q $depth --rebase'