Skip to content

Adı değişen ZIM'in eski dosyası diskte kalıyor / Old ZIM file stays on disk after a rename #43

Backlog

Description

@menes97

Türkçe

scripts/download-content.sh, yeni sürüm indirilince eski sürümü aynı önekle siliyor (<önek>_YYYY-MM.zim). config/content.conf içinde önek değişince eski dosyayı silen bir şey kalmıyor. Örnek: 2da2102'de fas-military-medicine_en satırı irp.fas.org_en_military-medicine oldu. Eski adla kurulmuş bir kutuda fas-military-medicine_en_2025-06.zim diskte kalıyor (~78 MB). Bir satır yorum satırı yapılınca da aynı şey oluyor.

Kullanıcının elle koyduğu ZIM'ler de aynı klasörde olabileceği için, listede olmayan her şeyi kendiliğinden silmek doğru olmaz. Önerim:

  1. content.conf satırına isteğe bağlı eski ad: old=fas-military-medicine_en. Betik, yeni dosya indirilip SHA-256 doğrulandıktan sonra yalnız bu öneke ait dosyaları siler. Satırın kendi açıklaması # ile devam eder, bugünkü biçim bozulmaz.
  2. status.sh, hiçbir satıra uymayan ZIM'leri "listede olmayan" diye yalnız listeler, silmez.

Uygunsa bu ikisini tek PR'da yaparım. Başka bir yol tercih edersen (ör. yalnız 2. madde, ya da --prune seçeneği) ona göre yaparım.

English

scripts/download-content.sh removes older versions by prefix (<prefix>_YYYY-MM.zim) after a new one is downloaded. When a prefix changes in config/content.conf, nothing removes the old file. Example: 2da2102 renamed fas-military-medicine_en to irp.fas.org_en_military-medicine, so a box installed before that keeps fas-military-medicine_en_2025-06.zim (~78 MB). The same happens when a line is commented out.

Users may keep their own ZIMs in the same folder, so deleting everything that is not in the list would be unsafe. Proposal:

  1. An optional old name on the content.conf line: old=fas-military-medicine_en. The script deletes files with that prefix only after the new file is downloaded and its SHA-256 verified. The comment still follows #, so the current format keeps working.
  2. status.sh lists ZIMs that match no line as "not in the list", without deleting them.

If this fits, I'll do both in one PR. If you prefer another way (e.g. only item 2, or a --prune option), I'll follow that.

Related: #42 (item 11), #30.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions