Skip to content

Add uusi-extract to print the name and version of a package#14

Merged
felixonmars merged 1 commit into
berberman:masterfrom
Vekhir:feat-uusi-extract
Jun 18, 2026
Merged

Add uusi-extract to print the name and version of a package#14
felixonmars merged 1 commit into
berberman:masterfrom
Vekhir:feat-uusi-extract

Conversation

@Vekhir

@Vekhir Vekhir commented May 15, 2026

Copy link
Copy Markdown
Contributor

The uusi-extract command reads in the .cabal file and prints out the version or package name, depending on the chosen command line option.

This provides a better way to programmatically get the package name or the version of a package, so that in particular whitespace doesn't matter. The intended use case for this is Arch Linux's ghc package, where the library information needs to be extracted from the included .cabal files.

The actions are distinguished via two options which map to functions in the Options class. If an option is set, the corresponding function is added to the returned list. If that list contains no functions or more than one, an appropriate error is raised.
The functions take in the GenericPackageDescription that's the same for everything, and return the extracted Text for printing.

The implementation has been tested with up to 9.14 and includes CPP where necessary.

Solves #12
Depends on #13 for the CI

@Vekhir Vekhir changed the title feat: Add uusi-extract Add uusi-extract to print the name and version of a package May 15, 2026
@Vekhir Vekhir force-pushed the feat-uusi-extract branch from 0a28dce to 388fa9d Compare June 17, 2026 20:51
@Vekhir

Vekhir commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@felixonmars CI went through successfully

@felixonmars felixonmars merged commit 2dff77d into berberman:master Jun 18, 2026
40 checks passed
@Vekhir Vekhir deleted the feat-uusi-extract branch June 18, 2026 05:01
@Vekhir Vekhir mentioned this pull request Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants