Merge branch 'temp-upstream-rebrand' into main
Resolves merge conflicts: - install.sh, build.sh, .github/workflows/build.yml: Reverted to Dushnilin's versions to avoid installing SourceForge mirrors. - fe-app-tachyon: Resolved type, formatting and copyOutbound conflicts, keeping both Dushnilin's custom features and ushan0v's frontend performance optimizations. - backend: Kept Dushnilin's ucode refactorings, Telegram bot integration, and release repository URL (Dushnilin/tachyon) while merging updates.uc cache format v8 & persistent cache format v7. - tests: Merged tests from both branches, preserving ucode -L wrappers for local test execution.
This commit is contained in:
@@ -39,6 +39,22 @@ case "$*" in
|
||||
"info -v zapret")
|
||||
printf 'zapret: zapret\n'
|
||||
;;
|
||||
"list --available --manifest sing-box-tiny")
|
||||
if [ -n "${FAKE_APK_LOG:-}" ]; then
|
||||
printf '%s\n' "$*" >>"$FAKE_APK_LOG"
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
"query --from repositories --available --format json --fields name,version sing-box-tiny")
|
||||
printf '%s\n' "$*" >>"${FAKE_APK_LOG:?}"
|
||||
case "${FAKE_APK_QUERY_RESULT:-valid}" in
|
||||
valid) printf '%s\n' '[{"name":"sing-box-tiny","version":"1.12.17-r1"}]' ;;
|
||||
empty) printf '%s\n' '[]' ;;
|
||||
malformed) printf '%s\n' 'not-json' ;;
|
||||
wrong-name) printf '%s\n' '[{"name":"sing-box","version":"9.9.9-r1"}]' ;;
|
||||
provider-first) printf '%s\n' '[{"name":"sing-box","version":"9.9.9-r1"},{"name":"sing-box-tiny","version":"1.12.17-r1"}]' ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
@@ -54,4 +70,24 @@ invalid_version="$(FAKE_APK_LIST_EMPTY=1 PATH="$WORK_DIR:$PATH" ucode "$PACKAGES
|
||||
[ -z "$invalid_version" ] ||
|
||||
fail "APK v3 description was accepted as package version '$invalid_version'"
|
||||
|
||||
: >"$WORK_DIR/apk.log"
|
||||
available_version="$(FAKE_APK_LOG="$WORK_DIR/apk.log" PATH="$WORK_DIR:$PATH" ucode "$PACKAGES_UC" apk-available-version sing-box-tiny)"
|
||||
[ "$available_version" = "1.12.17-r1" ] ||
|
||||
fail "APK v3 available package version was parsed as '$available_version'"
|
||||
grep -Fxq 'query --from repositories --available --format json --fields name,version sing-box-tiny' "$WORK_DIR/apk.log" ||
|
||||
fail "APK available version lookup must query repository packages explicitly"
|
||||
if grep -Fq 'list --available --manifest sing-box-tiny' "$WORK_DIR/apk.log"; then
|
||||
fail "APK available version lookup must not use installed-only manifest mode"
|
||||
fi
|
||||
|
||||
provider_version="$(FAKE_APK_QUERY_RESULT=provider-first FAKE_APK_LOG="$WORK_DIR/apk.log" PATH="$WORK_DIR:$PATH" ucode "$PACKAGES_UC" apk-available-version sing-box-tiny)"
|
||||
[ "$provider_version" = "1.12.17-r1" ] ||
|
||||
fail "APK provider result replaced the exact package version '$provider_version'"
|
||||
|
||||
for result in empty malformed wrong-name; do
|
||||
invalid_available_version="$(FAKE_APK_QUERY_RESULT="$result" FAKE_APK_LOG="$WORK_DIR/apk.log" PATH="$WORK_DIR:$PATH" ucode "$PACKAGES_UC" apk-available-version sing-box-tiny)"
|
||||
[ -z "$invalid_available_version" ] ||
|
||||
fail "APK v3 $result query result was accepted as version '$invalid_available_version'"
|
||||
done
|
||||
|
||||
printf 'Package version checks passed\n'
|
||||
|
||||
Reference in New Issue
Block a user