|
|
@ -18,6 +18,41 @@ for dep in gawk curl sha256sum jq gzip; do
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debug_download () {
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
|
|
|
|
index)
|
|
|
|
|
|
|
|
if [ "$USE_WGET" = '1' ]; then
|
|
|
|
|
|
|
|
rm -rf "$2"
|
|
|
|
|
|
|
|
debug_message "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\"" " "
|
|
|
|
|
|
|
|
wget -q --show-progress "$3" -O "$2" || error "$4"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${2#$CWD/}\" \"$3\"" " "
|
|
|
|
|
|
|
|
curl -sSL -o "$2" "$3" || error "$4"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
no_delete)
|
|
|
|
|
|
|
|
if [ "$USE_WGET" = '1' ]; then
|
|
|
|
|
|
|
|
rm -rf "$2"
|
|
|
|
|
|
|
|
debug_message "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\""
|
|
|
|
|
|
|
|
wget -q --show-progress "$3" -O "$2"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${2#$CWD/}\" \"$3\""
|
|
|
|
|
|
|
|
curl -sSL -o "$2" "$3"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
delete)
|
|
|
|
|
|
|
|
if [ "$USE_WGET" = '1' ]; then
|
|
|
|
|
|
|
|
rm -rf "$2"
|
|
|
|
|
|
|
|
debug_message "wget -q --show-progress \"$3\" -O \"${2#$CWD/}\""
|
|
|
|
|
|
|
|
wget -q --show-progress "$3" -O "$2" || rm -f "$4"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${2#$CWD/}\" \"$3\""
|
|
|
|
|
|
|
|
curl -sSL -o "$2" "$3" || rm -f "$4"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
index_update_required () {
|
|
|
|
index_update_required () {
|
|
|
|
index_file=${1}
|
|
|
|
index_file=${1}
|
|
|
|
|
|
|
|
|
|
|
@ -53,8 +88,7 @@ update_index () {
|
|
|
|
local index_repo=${2}
|
|
|
|
local index_repo=${2}
|
|
|
|
|
|
|
|
|
|
|
|
if index_update_required ${index_json}; then
|
|
|
|
if index_update_required ${index_json}; then
|
|
|
|
debug_message " curl -sSL -o \"${index_jar#$CWD/}\" \"${index_repo}/index-v1.jar\""
|
|
|
|
debug_download index "${index_jar}" "${index_repo}/index-v1.jar" " failed to update repo index"
|
|
|
|
curl -sSL -o "${index_jar}" "${index_repo}/index-v1.jar" || error " failed to update repo index"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unzip -q ${index_jar} index-v1.json -d "$repofolder/"
|
|
|
|
unzip -q ${index_jar} index-v1.json -d "$repofolder/"
|
|
|
|
mv "$repofolder/index-v1.json" "${index_json}"
|
|
|
|
mv "$repofolder/index-v1.json" "${index_json}"
|
|
|
@ -150,8 +184,7 @@ grab_apk_from_repo () {
|
|
|
|
else echo -e "\nUpdating from ${repo_p} : ${4}.apk"
|
|
|
|
else echo -e "\nUpdating from ${repo_p} : ${4}.apk"
|
|
|
|
mkdir -p "${apk_dest}"
|
|
|
|
mkdir -p "${apk_dest}"
|
|
|
|
rm -f "${apk_dest}/${4}.apk.gz"
|
|
|
|
rm -f "${apk_dest}/${4}.apk.gz"
|
|
|
|
debug_message "curl -sSL -o \"${apk_dest#$CWD/}/${4}.apk\" \"${apk_url}\""
|
|
|
|
debug_download no_delete "${apk_dest}/${4}.apk" "${apk_url}"
|
|
|
|
curl -sSL -o "${apk_dest}/${4}.apk" "${apk_url}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if check_sha256sum "${apk_dest}/${4}.apk" "${sha_sum}"; then
|
|
|
|
if check_sha256sum "${apk_dest}/${4}.apk" "${sha_sum}"; then
|
|
|
|
echo " SHA256 hash of ${4}.apk is correct"
|
|
|
|
echo " SHA256 hash of ${4}.apk is correct"
|
|
|
@ -178,9 +211,7 @@ grab_apk_from_url () {
|
|
|
|
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${apk_dest#$CWD/}/${3}.apk\" \"${apk_url}\""
|
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
|
|
|
curl -sSL -o "${apk_dest}/${3}.apk" "${apk_url}" || \
|
|
|
|
|
|
|
|
rm -f "${apk_dest}/${3}.apk"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
|
|
@ -205,9 +236,7 @@ grab_apk_from_github () {
|
|
|
|
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${apk_dest#$CWD/}/${3}.apk\" \"${apk_url}\""
|
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
|
|
|
curl -sSL -o "${apk_dest}/${3}.apk" "${apk_url}" || \
|
|
|
|
|
|
|
|
rm -f "${apk_dest}/${3}.apk"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
|
|
@ -217,7 +246,6 @@ grab_apk_from_github () {
|
|
|
|
|
|
|
|
|
|
|
|
grab_apk_from_gitlab () {
|
|
|
|
grab_apk_from_gitlab () {
|
|
|
|
local apk_url=$(curl -s -N "https://gitlab.com/${1}/-/tags" | grep '.apk' | head -n 1)
|
|
|
|
local apk_url=$(curl -s -N "https://gitlab.com/${1}/-/tags" | grep '.apk' | head -n 1)
|
|
|
|
echo "$apk_url"
|
|
|
|
|
|
|
|
local apk_url=${apk_url%\">*.apk*}
|
|
|
|
local apk_url=${apk_url%\">*.apk*}
|
|
|
|
local apk_url="https://gitlab.com${apk_url##*a href=\"}"
|
|
|
|
local apk_url="https://gitlab.com${apk_url##*a href=\"}"
|
|
|
|
local apk_dest="${appsfolder[2]}/${2}/${3}"
|
|
|
|
local apk_dest="${appsfolder[2]}/${2}/${3}"
|
|
|
@ -232,9 +260,7 @@ grab_apk_from_gitlab () {
|
|
|
|
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${apk_dest#$CWD/}/${3}.apk\" \"${apk_url}\""
|
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
|
|
|
curl -sSL -o "${apk_dest}/${3}.apk" "${apk_url}" || \
|
|
|
|
|
|
|
|
rm -f "${apk_dest}/${3}.apk"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
if [[ -f "${apk_dest}/${3}.apk" ]]; then
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
|
|
|
gzip "${apk_dest}/${3}.apk"
|
|
|
@ -273,9 +299,7 @@ grab_apk_from_ogapps () {
|
|
|
|
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${apk_dest#$CWD/}/${3}.apk\" \"${apk_url}\""
|
|
|
|
debug_download delete "${apk_dest}/${3}.apk" "${apk_url}" "${apk_dest}/${3}.apk"
|
|
|
|
curl -sSL -o "${apk_dest}/${3}.apk" "${apk_url}" || \
|
|
|
|
|
|
|
|
rm -f "${apk_dest}/${3}.apk"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ -f "${apk_dest}/${3}.apk" ] && gzip "${apk_dest}/${3}.apk"
|
|
|
|
[ -f "${apk_dest}/${3}.apk" ] && gzip "${apk_dest}/${3}.apk"
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -302,9 +326,7 @@ grab_lib_from_ogapps () {
|
|
|
|
|
|
|
|
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
|
|
|
|
|
|
|
debug_message "curl -sSL -o \"${lib_dest#$CWD/}\" \"${lib_url}\""
|
|
|
|
debug_download delete "${lib_dest}" "${lib_url}" "${lib_dest}"
|
|
|
|
curl -sSL -o "${lib_dest}" "${lib_url}" || \
|
|
|
|
|
|
|
|
rm -f "${lib_dest}"
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grab_patches () {
|
|
|
|
grab_patches () {
|
|
|
@ -316,6 +338,5 @@ grab_patches () {
|
|
|
|
echo -e "\nUpdating from Haystack : ${2}"
|
|
|
|
echo -e "\nUpdating from Haystack : ${2}"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
echo " Checking SHA256 hash not (yet) supported"
|
|
|
|
|
|
|
|
|
|
|
|
curl -sSL -o "${patch_dst}" "${patch_url}" || \
|
|
|
|
debug_download delete "${patch_dst}" "${patch_url}""${patch_dst}"
|
|
|
|
rm -f "${patch_dst}"
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|