arcan1s / ahriman

ArcH linux ReposItory MANager
https://ahriman.readthedocs.io
GNU General Public License v3.0
32 stars 2 forks source link

Unable to add `vim-youcompleteme-git` #136

Closed SergeantBiggs closed 2 weeks ago

SergeantBiggs commented 3 weeks ago

Summary

I'm using v2.15.2. I'm getting an error when trying to add vim-youcompleteme-git

Steps to reproduce

Install vim-youcompleteme-git

Logs

[ERROR] [ahriman.core.repository.repository.Repository]: vim-youcompleteme-git (x86_64) build exception
                                           Traceback (most recent call last):
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/repository/executor.py", line 81, in process_build
                                               last_commit_sha = build_single(single, Path(dir_name), packager.packager_id)
                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/repository/executor.py", line 63, in build_single
                                               commit_sha = task.init(local_path, patches, local_version)
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/build_tools/task.py", line 151, in init
                                               last_commit_sha = Sources.load(sources_dir, self.package, patches, self.paths)
                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/build_tools/sources.py", line 188, in load
                                               patches.extend(instance.extend_architectures(sources_dir, paths.repository_id.architecture))
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/build_tools/sources.py", line 83, in extend_architectures
                                               architectures = Package.supported_architectures(sources_dir)
                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/models/package.py", line 389, in supported_architectures
                                               pkgbuild = Pkgbuild.from_file(path / "PKGBUILD")
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/models/pkgbuild.py", line 68, in from_file
                                               return cls.from_io(input_file)
                                                      ^^^^^^^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/models/pkgbuild.py", line 82, in from_io
                                               fields = {patch.key: patch for patch in parser.parse()}
                                                                                       ^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/alpm/pkgbuild_parser.py", line 343, in parse
                                               yield from self._parse_token(token)
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/alpm/pkgbuild_parser.py", line 333, in _parse_token
                                               yield from self._parse_token(other)
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/alpm/pkgbuild_parser.py", line 333, in _parse_token
                                               yield from self._parse_token(other)
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/alpm/pkgbuild_parser.py", line 333, in _parse_token
                                               yield from self._parse_token(other)
                                             [Previous line repeated 99 more times]
                                             File "/usr/lib/python3.12/site-packages/ahriman/core/alpm/pkgbuild_parser.py", line 310, in _parse_token
                                               match self.get_token():
                                                     ^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/shlex.py", line 109, in get_token
                                               raw = self.read_token()
                                                     ^^^^^^^^^^^^^^^^^
                                             File "/usr/lib/python3.12/shlex.py", line 191, in read_token
                                               raise ValueError("No closing quotation")
                                           ValueError: No closing quotation
arcan1s commented 2 weeks ago

oh, the issue appears is that current pkgbuild parser doesn't read comments with multiple shaprs (e.g. ###, see https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vim-youcompleteme-git#n36) as comments, which is obviously wrong. The fix f09082dff2a757ad33bca22b16370ec03b5324bf is applied to master and backported and released as 2.15.3

Thanks for the report!