@@ -42,7 +42,6 @@ get_rv_prebuilts() {
42
42
local cl_dir=${patches_src%/* }
43
43
cl_dir=${TEMP_DIR} /${cl_dir,,} -rv
44
44
[ -d " $cl_dir " ] || mkdir " $cl_dir "
45
- : > " ${cl_dir} /changelog.md"
46
45
for src_ver in " $cli_src CLI $cli_ver " " $integrations_src Integrations $integrations_ver " " $patches_src Patches $patches_ver " ; do
47
46
set -- $src_ver
48
47
local src=$1 tag=$2 ver=${3-} ext
@@ -57,7 +56,6 @@ get_rv_prebuilts() {
57
56
58
57
local rv_rel=" https://api.github.com/repos/${src} /releases" name_ver
59
58
if [ " $ver " = " dev" ]; then
60
- rv_rel+=" /tags/$( gh_req " $rv_rel " - | jq -r ' .[0] | .tag_name' ) "
61
59
name_ver=" *-dev*"
62
60
elif [ " $ver " = " latest" ]; then
63
61
rv_rel+=" /latest"
@@ -76,32 +74,34 @@ get_rv_prebuilts() {
76
74
if [ -z " $file " ]; then
77
75
local resp asset name
78
76
resp=$( gh_req " $rv_rel " -) || return 1
77
+ if [ " $ver " = " dev" ]; then resp=$( jq -r ' .[0]' <<< " $resp" ) ; fi
79
78
tag_name=$( jq -r ' .tag_name' <<< " $resp" )
80
79
asset=$( jq -e -r " .assets[] | select(.name | endswith(\" $ext \" ))" <<< " $resp" ) || return 1
81
80
url=$( jq -r .url <<< " $asset" )
82
81
name=$( jq -r .name <<< " $asset" )
83
82
file=" ${dir} /${name} "
84
83
gh_dl " $file " " $url " >&2 || return 1
85
84
if [ " $tag " = " Integrations" ]; then integs_file=$file ; fi
85
+ echo " $tag : $( cut -d/ -f1 <<< " $src" ) /${name} " >> " ${cl_dir} /changelog.md"
86
86
else
87
87
name=$( basename " $file " )
88
88
tag_name=$( cut -d' -' -f3- <<< " $name" )
89
89
tag_name=v${tag_name% .* }
90
90
if [ " $tag_name " = " v" ]; then abort; fi
91
91
fi
92
92
93
- echo " $tag : $( cut -d/ -f1 <<< " $src" ) /${name} " >> " ${cl_dir} /changelog.md"
94
93
echo -n " $file "
95
94
if [ " $tag " = " Patches" ]; then
96
95
name=" patches-${tag_name} .json"
97
96
file=" ${dir} /${name} "
98
97
if [ ! -f " $file " ]; then
99
98
resp=$( gh_req " $rv_rel " -) || return 1
99
+ if [ " $ver " = " dev" ]; then resp=$( jq -r ' .[0]' <<< " $resp" ) ; fi
100
100
url=$( jq -e -r ' .assets[] | select(.name | endswith("json")) | .url' <<< " $resp" ) || return 1
101
101
gh_dl " $file " " $url " >&2 || return 1
102
+ echo -e " [Changelog](https://github.com/${src} /releases/tag/${tag_name} )\n" >> " ${cl_dir} /changelog.md"
102
103
fi
103
104
echo -n " $file "
104
- echo -e " [Changelog](https://github.com/${src} /releases/tag/${tag_name} )\n" >> " ${cl_dir} /changelog.md"
105
105
fi
106
106
done
107
107
echo
@@ -116,7 +116,7 @@ get_rv_prebuilts() {
116
116
rm " ${integs_file} " || return 1
117
117
zip -0rq " ${integs_file} " . || return 1
118
118
) >&2 ; then
119
- epr " Patching revanced-integrations failed"
119
+ echo >&2 " Patching revanced-integrations failed"
120
120
fi
121
121
rm -r " ${integs_file} -zip" || :
122
122
@@ -155,26 +155,34 @@ config_update() {
155
155
enabled=$( toml_get " $t " enabled) || enabled=true
156
156
if [ " $enabled " = false ]; then continue ; fi
157
157
PATCHES_SRC=$( toml_get " $t " patches-source) || PATCHES_SRC=$DEF_PATCHES_SRC
158
- if [[ -v sources[$PATCHES_SRC ] ]]; then
159
- if [ " ${sources[$PATCHES_SRC]} " = 1 ]; then
158
+ PATCHES_VER=$( toml_get " $t " patches-version) || PATCHES_VER=$DEF_PATCHES_VER
159
+ if [[ -v sources[" $PATCHES_SRC /$PATCHES_VER " ] ]]; then
160
+ if [ " ${sources["$PATCHES_SRC/$PATCHES_VER"]} " = 1 ]; then
160
161
conf+=" $t "
161
162
conf+=$' \n '
162
163
fi
163
164
else
164
- sources[$PATCHES_SRC ]=0
165
- if ! last_patches=$( gh_req " https://api.github.com/repos/${PATCHES_SRC} /releases/latest" - |
166
- jq -e -r ' .assets[] | select(.name | endswith("jar")) | .name' ) ; then
165
+ sources[" $PATCHES_SRC /$PATCHES_VER " ]=0
166
+ local rv_rel=" https://api.github.com/repos/${PATCHES_SRC} /releases"
167
+ if [ " $PATCHES_VER " = " dev" ]; then
168
+ last_patches=$( gh_req " $rv_rel " - | jq -e -r ' .[0]' )
169
+ elif [ " $PATCHES_VER " = " latest" ]; then
170
+ last_patches=$( gh_req " $rv_rel /latest" -)
171
+ else
172
+ last_patches=$( gh_req " $rv_rel /tags/${ver} " -)
173
+ fi
174
+
175
+ if ! last_patches=$( jq -e -r ' .assets[] | select(.name | endswith("jar")) | .name' <<< " $last_patches" ) ; then
167
176
abort oops
168
177
fi
169
- cur_patches=$( sed -n " s/.*Patches: ${PATCHES_SRC%%/* } \/\(.*\)/\1/p" build.md | xargs)
170
- if [ " $cur_patches " ] && [ " $last_patches " ]; then
171
- if [ " ${cur_patches} " != " $last_patches " ]; then
172
- sources[$PATCHES_SRC ]=1
178
+ if [ " $last_patches " ]; then
179
+ if ! OP=$( grep " ^Patches: ${PATCHES_SRC%%/* } /" build.md | grep " $last_patches " ) ; then
180
+ sources[" $PATCHES_SRC /$PATCHES_VER " ]=1
173
181
prcfg=true
174
182
conf+=" $t "
175
183
conf+=$' \n '
176
184
else
177
- echo " Patches: ${PATCHES_SRC %%/* } / ${cur_patches} " >> " $TEMP_DIR " /skipped
185
+ echo " $OP " >> " $TEMP_DIR " /skipped
178
186
fi
179
187
fi
180
188
fi
0 commit comments