chore: drop pagination and wine ge
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@@ -19,41 +19,13 @@ fetch_github_releases() {
|
|||||||
|
|
||||||
log "Получение релизов из $repo..."
|
log "Получение релизов из $repo..."
|
||||||
|
|
||||||
local page=1
|
local url="https://api.github.com/repos/$repo/releases"
|
||||||
local temp_file="$TEMP_DIR/$(basename "$output_file" .json)_page"
|
|
||||||
|
|
||||||
> "$output_file"
|
if ! curl -s -H "Accept: application/vnd.github.v3+json" "$url" > "$output_file"; then
|
||||||
|
log "Ошибка при получении релизов для $repo"
|
||||||
local all_releases="$TEMP_DIR/all_$(basename "$output_file")"
|
return 1
|
||||||
echo "[]" > "$all_releases"
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
local url="https://api.github.com/repos/$repo/releases?page=$page&per_page=100"
|
|
||||||
local response="$temp_file$page"
|
|
||||||
|
|
||||||
if ! curl -s -H "Accept: application/vnd.github.v3+json" "$url" > "$response"; then
|
|
||||||
log "Ошибка при получении страницы $page для $repo"
|
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! jq -e '. | length > 0' "$response" >/dev/null 2>&1; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
jq -s '.[0] + .[1]' "$all_releases" "$response" > "$all_releases.tmp" && mv "$all_releases.tmp" "$all_releases"
|
|
||||||
|
|
||||||
((page++))
|
|
||||||
|
|
||||||
if [[ $page -gt 50 ]]; then
|
|
||||||
log "Предупреждение: достигнут лимит страниц (50) для $repo"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
sleep 0.5
|
|
||||||
done
|
|
||||||
|
|
||||||
cp "$all_releases" "$output_file"
|
|
||||||
|
|
||||||
local count=$(jq '. | length' "$output_file" 2>/dev/null || echo "0")
|
local count=$(jq '. | length' "$output_file" 2>/dev/null || echo "0")
|
||||||
log "Получено данных для $repo: $count релизов"
|
log "Получено данных для $repo: $count релизов"
|
||||||
}
|
}
|
||||||
@@ -87,15 +59,11 @@ log "Начало генерации метаданных..."
|
|||||||
|
|
||||||
# PROTON_GE
|
# PROTON_GE
|
||||||
fetch_github_releases "GloriousEggroll/proton-ge-custom" "$TEMP_DIR/proton_ge_releases.json"
|
fetch_github_releases "GloriousEggroll/proton-ge-custom" "$TEMP_DIR/proton_ge_releases.json"
|
||||||
create_wine_entries "$TEMP_DIR/proton_ge_releases.json" "\\.tar\\.gz$" "Proton-6\\.5-GE-2|github-action" > "$TEMP_DIR/proton_ge.json"
|
create_wine_entries "$TEMP_DIR/proton_ge_releases.json" "\\.tar\\.gz$" "github-action" > "$TEMP_DIR/proton_ge.json"
|
||||||
|
|
||||||
# WINE_KRON4EK
|
# WINE_KRON4EK
|
||||||
fetch_github_releases "Kron4ek/Wine-Builds" "$TEMP_DIR/wine_kron4ek_releases.json"
|
fetch_github_releases "Kron4ek/Wine-Builds" "$TEMP_DIR/wine_kron4ek_releases.json"
|
||||||
create_wine_entries "$TEMP_DIR/wine_kron4ek_releases.json" "\\.tar\\.xz$" "6\\.3|-x86|-wow64" > "$TEMP_DIR/wine_kron4ek.json"
|
create_wine_entries "$TEMP_DIR/wine_kron4ek_releases.json" "\\.tar\\.xz$" "-x86|-wow64" > "$TEMP_DIR/wine_kron4ek.json"
|
||||||
|
|
||||||
# WINE_GE_CUSTOM
|
|
||||||
fetch_github_releases "GloriousEggroll/wine-ge-custom" "$TEMP_DIR/wine_ge_custom_releases.json"
|
|
||||||
create_wine_entries "$TEMP_DIR/wine_ge_custom_releases.json" "\\.tar\\.xz$" "6\\.23" > "$TEMP_DIR/wine_ge_custom.json"
|
|
||||||
|
|
||||||
# PROTON_LG
|
# PROTON_LG
|
||||||
fetch_github_releases "Castro-Fidel/wine_builds" "$TEMP_DIR/proton_lg_releases.json"
|
fetch_github_releases "Castro-Fidel/wine_builds" "$TEMP_DIR/proton_lg_releases.json"
|
||||||
@@ -141,17 +109,8 @@ JSON_CONTINUE
|
|||||||
|
|
||||||
cat << 'JSON_CONTINUE2'
|
cat << 'JSON_CONTINUE2'
|
||||||
],
|
],
|
||||||
"wine_ge_custom": [
|
|
||||||
JSON_CONTINUE2
|
|
||||||
|
|
||||||
if [[ -s "$TEMP_DIR/wine_ge_custom.json" ]]; then
|
|
||||||
sed '$!s/$/,/' "$TEMP_DIR/wine_ge_custom.json" | sed 's/^/ /'
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat << 'JSON_CONTINUE3'
|
|
||||||
],
|
|
||||||
"proton_lg": [
|
"proton_lg": [
|
||||||
JSON_CONTINUE3
|
JSON_CONTINUE2
|
||||||
|
|
||||||
if [[ -s "$TEMP_DIR/proton_lg.json" ]]; then
|
if [[ -s "$TEMP_DIR/proton_lg.json" ]]; then
|
||||||
sed '$!s/$/,/' "$TEMP_DIR/proton_lg.json" | sed 's/^/ /'
|
sed '$!s/$/,/' "$TEMP_DIR/proton_lg.json" | sed 's/^/ /'
|
||||||
@@ -202,7 +161,7 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
log "Статистика созданного файла:"
|
log "Статистика созданного файла:"
|
||||||
for category in proton_ge wine_kron4ek wine_ge_custom proton_lg proton_cachyos proton_sarek proton_em; do
|
for category in proton_ge wine_kron4ek proton_lg proton_cachyos proton_sarek proton_em; do
|
||||||
count=$(jq -r ".${category} | length" "$OUTPUT_FILE" 2>/dev/null || echo "0")
|
count=$(jq -r ".${category} | length" "$OUTPUT_FILE" 2>/dev/null || echo "0")
|
||||||
log " $category: $count версий"
|
log " $category: $count версий"
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user