Repository navigation
Conversation
…arım indirmelerini sil When a download is interrupted and a newer version of the same ZIM is out by the next run, the old <prefix>_YYYY-MM.zim.part is never resumed and never removed: the old-version cleanup only matches *.zim. It keeps its space (up to ~120 GB for English Wikipedia), counts as used in the free-space check, and status.sh reports an unfinished download forever. Remove partial files of other versions of the same prefix before the free-space check. Bir indirme yarıda kalır ve sonraki çalıştırmada aynı ZIM'in yeni sürümü çıkmışsa eski <prefix>_YYYY-MM.zim.part dosyasına ne devam edilir ne de silinir: eski sürüm temizliği yalnızca *.zim dosyalarına bakar. Dosya yerini korur (İngilizce Vikipedi için ~120 GB'a kadar), yer kontrolünde dolu sayılır ve status.sh sürekli yarım indirme uyarısı verir. Aynı adın diğer sürümlerinin yarım dosyaları yer kontrolünden önce silinir. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g alınamazsa geçici dosyayı sil The EXIT trap removes "$CAT", but the fallback path clears CAT first, so the mktemp file was left in /tmp. Remove it before clearing the variable. EXIT trap'i "$CAT"i siler, ama klasör listesine düşülürken CAT önce boşaltıldığı için mktemp dosyası /tmp'de kalıyordu. Değişken boşaltılmadan önce dosya silinir. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English · Türkçe
English
Two small fixes in
scripts/download-content.sh, one commit each.1. Unfinished downloads of older versions are removed
Say the English Wikipedia download (
wikipedia_en_all_maxi_2026-10.zim.part, ~120 GB) is interrupted, and by the next run the catalog has2026-11. The script starts2026-11from scratch, but the2026-10.zim.partstays on the disk forever:*.zim, not*.zim.part.status.shkeeps reporting "unfinished download(s)".With the approval-based updates in #14, this would happen every time a big ZIM gets a new release while it is downloading.
Now, after the newest version is resolved and before the free-space check,
.partfiles of other versions of the same prefix are removed. The.partof the current version is kept and resumed as before. The glob is the same one as the old-version cleanup (<prefix>_YYYY-MM…), sowikipedia_en_alldoes not touchwikipedia_en_all_maxifiles.2. The catalog temp file is removed when the catalog is unreachable
The
EXITtrap removes"$CAT", but the fallback path setsCAT=""first, so themktempfile was left in/tmp. It is now removed before the variable is cleared.Testing
I don't have a Pi, so I ran the script as root in Ubuntu 24.04 (WSL), with
curlandwgetreplaced by stubs (a fake catalog, a fake directory listing, a 5-byte "ZIM" and its.sha256). Each case was run against this branch and againstmain:main2026-10.zim.part, catalog has2026-11: stale part removed2026-11downloaded and verified.partof a longer prefix (foo_en_all_maxi_…) left alone.partof the current version is resumed, nothing removedTMPDIRI couldn't run ShellCheck locally; the new loop follows the same pattern as the existing old-version cleanup loop, and the ShellCheck workflow will check it here. #14 also edits this file, but in other lines; if this lands first,
CHECK_ONLY=1would remove stale.partfiles too. That seems right, since they can't be resumed, but I'm happy to move the cleanup below theCHECK_ONLYline if you prefer.Türkçe
scripts/download-content.shiçinde iki küçük düzeltme, her biri ayrı commit.1. Eski sürümlerin yarım indirmeleri siliniyor
Diyelim ki İngilizce Vikipedi indirmesi (
wikipedia_en_all_maxi_2026-10.zim.part, ~120 GB) yarıda kaldı ve bir sonraki çalıştırmada katalogda2026-11var. Betik2026-11'i baştan indiriyor ama2026-10.zim.partdiskte kalıyor:*.zimdosyalarına bakıyor,*.zim.partdosyalarına bakmıyor.status.shsürekli "yarım indirme" uyarısı veriyor.#14'teki onaylı güncellemelerle bu durum, büyük bir ZIM indirilirken yeni sürümü her çıktığında yaşanır.
Artık en yeni sürüm bulunduktan sonra ve yer kontrolünden önce, aynı adın diğer sürümlerine ait
.partdosyaları siliniyor. Güncel sürümün.partdosyası eskisi gibi korunuyor ve devam ediliyor. Glob, eski sürüm temizliğindekiyle aynı (<ad>_YYYY-MM…); yaniwikipedia_en_all,wikipedia_en_all_maxidosyalarına dokunmuyor.2. Katalog alınamazsa geçici dosya siliniyor
EXITtrap'i"$CAT"i siliyor, ama klasör listesine düşülürken önceCAT=""yapıldığı içinmktempdosyası/tmp'de kalıyordu. Artık değişken boşaltılmadan önce dosya siliniyor.Test
Elimde Pi olmadığı için betiği Ubuntu 24.04'te (WSL) root olarak çalıştırdım;
curlvewgetyerine sahte bir katalog, sahte bir klasör listesi, 5 baytlık bir "ZIM" ve.sha256dosyası veren betikler koydum. Her durumu hem bu dalda hemmain'de çalıştırdım; sonuçlar yukarıdaki tabloda.main'de yalnızca bu PR'ın düzelttiği dört durum başarısız oluyor.ShellCheck'i yerelde çalıştıramadım; yeni döngü mevcut eski sürüm temizliği döngüsüyle aynı kalıpta ve buradaki ShellCheck iş akışı kontrol edecek. #14 de bu dosyayı değiştiriyor ama başka satırlarda. Bu PR önce birleşirse
CHECK_ONLY=1de eski.partdosyalarını siler; devam edilemeyecekleri için bu bana doğru geliyor, ama isterseniz temizliğiCHECK_ONLYsatırının altına alabilirim.AI assistance / YZ desteği: The change, the tests and this description were written with Claude Code and checked with the runs above. / Değişiklik, testler ve bu açıklama Claude Code ile yazıldı ve yukarıdaki çalıştırmalarla kontrol edildi.
🤖 Generated with Claude Code