mirror of
https://github.com/j-hc/revanced-magisk-module.git
synced 2025-05-05 09:04:27 +02:00
config-update
This commit is contained in:
parent
d05014fb7e
commit
e0de71bb57
12
utils.sh
12
utils.sh
@ -40,7 +40,9 @@ abort() {
|
|||||||
get_rv_prebuilts() {
|
get_rv_prebuilts() {
|
||||||
local cli_src=$1 cli_ver=$2 integrations_src=$3 integrations_ver=$4 patches_src=$5 patches_ver=$6
|
local cli_src=$1 cli_ver=$2 integrations_src=$3 integrations_ver=$4 patches_src=$5 patches_ver=$6
|
||||||
pr "Getting prebuilts (${patches_src%/*})" >&2
|
pr "Getting prebuilts (${patches_src%/*})" >&2
|
||||||
for f in "${TEMP_DIR}"/*-rv; do : >"${f}/changelog.md"; done
|
local cl_dir=${patches_src%/*}
|
||||||
|
cl_dir=${TEMP_DIR}/${cl_dir,,}-rv
|
||||||
|
[ -d "$cl_dir" ] || mkdir "$cl_dir"
|
||||||
for src_ver in "$cli_src CLI $cli_ver" "$integrations_src Integrations $integrations_ver" "$patches_src Patches $patches_ver"; do
|
for src_ver in "$cli_src CLI $cli_ver" "$integrations_src Integrations $integrations_ver" "$patches_src Patches $patches_ver"; do
|
||||||
set -- $src_ver
|
set -- $src_ver
|
||||||
local src=$1 tag=$2 ver=${3-} ext
|
local src=$1 tag=$2 ver=${3-} ext
|
||||||
@ -64,7 +66,7 @@ get_rv_prebuilts() {
|
|||||||
file="${dir}/${name}"
|
file="${dir}/${name}"
|
||||||
[ -f "$file" ] || REBUILD=true
|
[ -f "$file" ] || REBUILD=true
|
||||||
|
|
||||||
echo "$tag: $(cut -d/ -f5 <<<"$url")/${name} " >>"$dir/changelog.md"
|
echo "$tag: $(cut -d/ -f5 <<<"$url")/${name} " >>"${cl_dir}/changelog.md"
|
||||||
gh_dl "$file" "$url" >&2 || return 1
|
gh_dl "$file" "$url" >&2 || return 1
|
||||||
echo -n "$file "
|
echo -n "$file "
|
||||||
if [ "$tag" = "Patches" ]; then
|
if [ "$tag" = "Patches" ]; then
|
||||||
@ -75,7 +77,7 @@ get_rv_prebuilts() {
|
|||||||
url=$(jq -e -r '.assets[] | select(.name | endswith("json")) | .url' <<<"$resp") || return 1
|
url=$(jq -e -r '.assets[] | select(.name | endswith("json")) | .url' <<<"$resp") || return 1
|
||||||
gh_dl "$file" "$url" >&2 || return 1
|
gh_dl "$file" "$url" >&2 || return 1
|
||||||
echo -n "$file "
|
echo -n "$file "
|
||||||
echo -e "[Changelog](https://github.com/${src}/releases/tag/${tag_name})\n" >>"$dir/changelog.md"
|
echo -e "[Changelog](https://github.com/${src}/releases/tag/${tag_name})\n" >>"${cl_dir}/changelog.md"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
@ -99,6 +101,7 @@ get_prebuilts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config_update() {
|
config_update() {
|
||||||
|
if [ ! -f build.md ]; then abort "build.md not available"; fi
|
||||||
declare -A sources
|
declare -A sources
|
||||||
: >$TEMP_DIR/skipped
|
: >$TEMP_DIR/skipped
|
||||||
local conf=""
|
local conf=""
|
||||||
@ -119,11 +122,10 @@ config_update() {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
sources[$PATCHES_SRC]=0
|
sources[$PATCHES_SRC]=0
|
||||||
if ! last_patches_url=$(gh_req "https://api.github.com/repos/${PATCHES_SRC}/releases/latest" - \
|
if ! last_patches=$(gh_req "https://api.github.com/repos/${PATCHES_SRC}/releases/latest" - \
|
||||||
| jq -e -r '.assets[] | select(.name | endswith("jar")) | .name'); then
|
| jq -e -r '.assets[] | select(.name | endswith("jar")) | .name'); then
|
||||||
abort oops
|
abort oops
|
||||||
fi
|
fi
|
||||||
last_patches=${last_patches_url##*/}
|
|
||||||
cur_patches=$(sed -n "s/.*Patches: ${PATCHES_SRC%%/*}\/\(.*\)/\1/p" build.md | xargs)
|
cur_patches=$(sed -n "s/.*Patches: ${PATCHES_SRC%%/*}\/\(.*\)/\1/p" build.md | xargs)
|
||||||
if [ "$cur_patches" ] && [ "$last_patches" ]; then
|
if [ "$cur_patches" ] && [ "$last_patches" ]; then
|
||||||
if [ "${cur_patches}" != "$last_patches" ]; then
|
if [ "${cur_patches}" != "$last_patches" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user