scancode-toolkit icon indicating copy to clipboard operation
scancode-toolkit copied to clipboard

Add Arch Linux .SRCINFO parser

Open karthiknew07 opened this issue 1 month ago • 0 comments

Fixes #4406

Description

Adds support for parsing Arch Linux .SRCINFO files generated by makepkg. These files contain package metadata for the Arch User Repository (AUR) and Arch Linux packages.

Changes

  • Added SrcinfoHandler in src/packagedcode/srcinfo.py
  • Added test suite in tests/packagedcode/test_srcinfo.py
  • Added 5 test data files covering various scenarios

Features

  • Parses pkgbase (global) and pkgname (per-package) sections
  • Extracts name, version, description, license, dependencies
  • Handles architecture-specific fields (e.g., depends_x86_64)
  • Supports split packages (multiple pkgname sections)
  • Stores checksums and sources in extra_data

Testing

  • ✅ All 5 tests passing locally
  • ✅ Tested with real Arch Linux package examples
  • ✅ Handles edge cases (split packages, arch-specific deps)

Tasks

  • [x] Reviewed contribution guidelines
  • [x] PR is descriptively titled and links issue #4406
  • [x] Tests pass locally (5/5 passing)
  • [x] Commits are in uniquely-named feature branch (add-srcinfo-support)
  • [x] No merge conflicts
  • [ ] Updated documentation pages (N/A - new parser)
  • [ ] Updated CHANGELOG.rst (will update if requested)

References

  • .SRCINFO spec: https://wiki.archlinux.org/title/.SRCINFO
  • Format: Simple key=value pairs in sections

karthiknew07 avatar Nov 13 '25 03:11 karthiknew07