Skip to content

abuild: Do not store whitespaces in license field

Currently, abuild stores the license variable ad-verbatim in the PKGINFO file. This causes many downstream systems to fail. For example, apk info won't show anything after the newline, our webview that lists licenses do not show these either.

Case in point, core-utils on the webview shows: image

however the git repo shows multi-line strings: image

To ensure users aren't tightly controlled in how to format the license string (dissallow newlines/whitespaces etc) this fix eats up all whitespace characters and replaces them with a single space. This could break potential parsers, that directly parse the APKBUILD file (who does that?). The APKINDEX, package database etc all do not contain the information anyway, so no problems there.

I do think this might need a rule (but we'd have to check the upstream SDPX grammar) that dissallows spaces in license names of course; but for now.

For now, I see no real risk this affecting anything or anyone.

If this merge request gets accepted and merged (and released), we'd probably do a bump of each package (which we might get for free when doing v3.16 release?); if we do NOT merge this change, then we probably write a script to manually check and fix each license variable in the repo. This would be needed to be done manually, to ensure proper intent is secured.

It is probably wise to do increase the pkgrel after release for all older versions as well; if legal compliance is important. E.g. if we expect people to trust the output of apk info --license or the webview when for example validating/selecting a license. If license accuracy is not deemed critical, then this point is of course irrelevant.

P.S. the fact that some repositories have bad licenses defined (many and/or's, etc etc) is a different issue, which I'm trying to fix wherever I can :)

Edited by Olliver Schinagl

Merge request reports