spdx / spdx/LicenseListPublisher
Alt match cannot be used inside copyrightText
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 23
- Forks
- 29
- Avg merge
- 6h 31m
- Merged PRs (30d)
- 2
Description
When adding Latex2e-translated-notice in https://github.com/spdx/license-list-XML/pull/1932, I wanted a @copyright{} string in a copyrightText block to be an alternation to a Unicode © string. My motivation was to match both source in texinfo language and a rendered text.
It turned out that licenseListPublisher-2.2.8.jar was unable to handle it. It seems that the curly brackets are separated from the adjacent "copyright" word before the alternation match is performed.
Here is a minimal reproducer:
$ cat src/test.xml
<?xml version="1.0" encoding="UTF-8"?>
<SPDXLicenseCollection xmlns="http://www.spdx.org/license">
<license isOsiApproved="false" licenseId="test"
name="test alt match with curly brackets" listVersionAdded="0">
<text>
<copyrightText>
<p>
before <alt name="symbol" match="@copyright\{\}">@copyright{}</alt> after
<!--before @copyright{} after-->
</p>
</copyrightText>
</text>
</license>
</SPDXLicenseCollection>
$ cat test/simpleTestForGenerator/test.txt
before @copyright{} after
$ ./test-one-license test
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
Difference found comparing to test file: Unable to find the text ' after ";match=".{0,5000}">>
' following a variable rule 'symbol' starting at line #1 column #20 ""
If the alternation is out of copyrightText block, it works.
Maybe related issues: #87, #100.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproducer in src/test.xml and test/simpleTestForGenerator/test.txt, then run ./test-one-license test to observe the failure. Trace how the licenseListPublisher tool handles alt matches within copyrightText; done means the @copyright{} alternation matches successfully there as it does outside the block.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100