json-generation: handle .tar.xz image archives#283
json-generation: handle .tar.xz image archives#283igorpecovnik merged 2 commits intoarmbian:mainfrom
Conversation
Extend strip_img_ext so kernel-suffix parsing handles filenames using tar archive extensions (e.g. Arduino UNO Q images shipped as .tar.xz), matching the existing .img.(xz|zst|gz) behaviour. Refs: armbian#277
Currently the function falls through to the generic "${n##*.}" fallback
for tar-based image archives, returning just "xz" (or "gz"/"zst") as the
file_extension. Downstream consumers — notably armbian-router's map
loader — only add entries whose extension ends with img.xz or a
registered specialExtension, so all 3 Arduino UNO Q community images
distributed as .tar.xz silently disappear from the redirect map and
return 404.
Add explicit cases for .tar.xz / .tar.gz / .tar.zst so the generator
emits the full compound extension.
Refs: armbian#277
Refs: armbian/armbian-router#39
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis change updates the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes part of #277 (generator-side).
Problem
Images shipped as
.tar.xz(currently the Arduino UNO Q community builds —gnome_desktop,kde-neon_desktop,minimal) are mishandled in two places ofscripts/generate-armbian-images-json.sh:extract_file_extension()has no branch for.tar.*, so it falls through to the generic${n##*.}fallback and returns just"xz". Downstream consumers (notably armbian-router'sloadMapJSON) only insert map entries whose extension ends withimg.xzor a registeredspecialExtension, so these images are silently dropped from the redirect map and everyredi_urlpointing to them 404s via the mirror.strip_img_ext()only strips.img(.xz|.zst|.gz), so kernel-suffix parsing for tar-based filenames doesn't correctly strip the extension.Fix (2 commits)
strip_img_ext: extend the regex to also match.tar.(xz|zst|gz).extract_file_extension: add explicit branches returningtar.xz/tar.gz/tar.zstbefore the fallback.With these, tar-based artifacts now produce sensible
file_extensionvalues and downstream tools can treat them as first-class images.Companion PR
The router-side counterpart is in armbian/armbian-router#39 and must land together for the Arduino UNO Q
redi_urlentries to resolve correctly.Related
/cc @igorpecovnik @efectn