mirror of
https://github.com/j-hc/revanced-magisk-module.git
synced 2025-04-30 14:44:32 +02:00
better update_config
This commit is contained in:
parent
411f5837ee
commit
a25b2380ce
3
build.sh
3
build.sh
@ -31,7 +31,6 @@ if [ "${2:-}" = "--config-update" ]; then
|
|||||||
config_update
|
config_update
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
PREV_BUILDMD=$(cat build.md) || PREV_BUILDMD=""
|
|
||||||
|
|
||||||
: >build.md
|
: >build.md
|
||||||
ENABLE_MAGISK_UPDATE=$(toml_get "$main_config_t" enable-magisk-update) || ENABLE_MAGISK_UPDATE=true
|
ENABLE_MAGISK_UPDATE=$(toml_get "$main_config_t" enable-magisk-update) || ENABLE_MAGISK_UPDATE=true
|
||||||
@ -191,7 +190,7 @@ log "\n[revanced-magisk-module](https://github.com/j-hc/revanced-magisk-module)"
|
|||||||
log "\nChangelog:"
|
log "\nChangelog:"
|
||||||
log "$(cat $TEMP_DIR/*-rv/changelog.md)"
|
log "$(cat $TEMP_DIR/*-rv/changelog.md)"
|
||||||
|
|
||||||
SKIPPED=$(sed '/Skipped:/,$d' <<<"$PREV_BUILDMD" | grep -F "Patches: " | grep -vE "$(grep -F "Patches: " build.md | cut -d/ -f1 | sed 's/ //g' | paste -sd '~' | sed 's;~;|;g')" || :)
|
SKIPPED=$(cat $TEMP_DIR/skipped || :)
|
||||||
if [ -n "$SKIPPED" ]; then
|
if [ -n "$SKIPPED" ]; then
|
||||||
log "\nSkipped:"
|
log "\nSkipped:"
|
||||||
log "$SKIPPED"
|
log "$SKIPPED"
|
||||||
|
22
utils.sh
22
utils.sh
@ -78,7 +78,8 @@ get_rv_prebuilts() {
|
|||||||
local nm
|
local nm
|
||||||
nm=$(cut -d/ -f9 <<<"$rv_patches_url")
|
nm=$(cut -d/ -f9 <<<"$rv_patches_url")
|
||||||
echo "Patches: $(cut -d/ -f4 <<<"$rv_patches_url")/$nm " >>"$patches_dir/changelog.md"
|
echo "Patches: $(cut -d/ -f4 <<<"$rv_patches_url")/$nm " >>"$patches_dir/changelog.md"
|
||||||
echo -e "[Changelog](https://github.com/${patches_src}/releases/tag/v$(sed 's/.*-\(.*\)\..*/\1/' <<<$nm))\n" >>"$patches_dir/changelog.md"
|
# shellcheck disable=SC2001
|
||||||
|
echo -e "[Changelog](https://github.com/${patches_src}/releases/tag/v$(sed 's/.*-\(.*\)\..*/\1/' <<<"$nm"))\n" >>"$patches_dir/changelog.md"
|
||||||
# echo -e "\n${rv_patches_changelog//# [/### [}\n---" >>"$patches_dir/changelog.md"
|
# echo -e "\n${rv_patches_changelog//# [/### [}\n---" >>"$patches_dir/changelog.md"
|
||||||
|
|
||||||
dl_if_dne "$rv_cli_jar" "$rv_cli_url" >&2 || return 1
|
dl_if_dne "$rv_cli_jar" "$rv_cli_url" >&2 || return 1
|
||||||
@ -121,6 +122,12 @@ get_prebuilts() {
|
|||||||
|
|
||||||
config_update() {
|
config_update() {
|
||||||
declare -A sources
|
declare -A sources
|
||||||
|
: >$TEMP_DIR/skipped
|
||||||
|
local conf=""
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
conf+=$(sed '1d' <<<"$main_config_t")
|
||||||
|
conf+=$'\n'
|
||||||
|
local prcfg=false
|
||||||
for table_name in $(toml_get_table_names); do
|
for table_name in $(toml_get_table_names); do
|
||||||
if [ -z "$table_name" ]; then continue; fi
|
if [ -z "$table_name" ]; then continue; fi
|
||||||
t=$(toml_get_table "$table_name")
|
t=$(toml_get_table "$table_name")
|
||||||
@ -136,12 +143,19 @@ config_update() {
|
|||||||
fi
|
fi
|
||||||
last_patches=${last_patches_url##*/}
|
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" ] && [ "${cur_patches}" != "$last_patches" ]; then
|
if [ "$cur_patches" ] && [ "$last_patches" ]; then
|
||||||
sources[$PATCHES_SRC]=1
|
if [ "${cur_patches}" != "$last_patches" ]; then
|
||||||
echo "$t"
|
sources[$PATCHES_SRC]=1
|
||||||
|
prcfg=true
|
||||||
|
conf+="$t"
|
||||||
|
conf+=$'\n'
|
||||||
|
else
|
||||||
|
echo "Patches: ${PATCHES_SRC%%/*}/${cur_patches} " >>$TEMP_DIR/skipped
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ "$prcfg" = true ]; then echo "$conf"; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_req() {
|
_req() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user