-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with multiline value of pkgdesc variable #30
Comments
@ava1ar I just installed customizepkg, and when running [Aur: 2] slack-desktop-3.4.2-1 qt4-4.8.7-30
2 slack-desktop (Installed) (Build Files Exist)
1 qt4 (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: PKGBUILD up to date, Skipping (1/2): qt4
:: PKGBUILD up to date, Skipping (2/2): slack-desktop
:: Parsing SRCINFO (1/2): slack-desktop
:: Parsing SRCINFO (2/2): qt4
/usr/bin/customizepkg: line 167: warning: command substitution: ignored null byte in input
no configuration found for slack-desktop in /home/dori/.customizepkg/ or /etc/customizepkg.d/
/usr/bin/customizepkg: line 167: warning: command substitution: ignored null byte in input
no configuration found for qt4 in /home/dori/.customizepkg/ or /etc/customizepkg.d/
/usr/bin/customizepkg: line 167: warning: command substitution: ignored null byte in input
no configuration found for slack-desktop in /home/dori/.customizepkg/ or /etc/customizepkg.d/
Can not find package name : [customizepkg.d] Is it related to this issue? Can you merge the related PR? $ yay -Qs customizepkg
local/customizepkg-git 57.f1d7be7-1
A tool to modify automatically PKGBUILD |
PR was merged. Please confirm it solves the issue. Thanks! |
@ava1ar Thanks! I have a more serious issue with yay now ^^ after removing customizepkg-git, all downloads are failing, I can't reinstall customizepkg-git through yay $ yay -S customizepkg-git --nomakepkgconf
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur: 1] customizepkg-git-51.6cf63cb-1
1 customizepkg-git (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> A
:: Deleting (1/1): /home/dori/.cache/yay/customizepkg-git
:: Downloaded PKGBUILD (1/1): customizepkg-git
:: Parsing SRCINFO (1/1): customizepkg-git
Error downloading sources: customizepkg-git I can install this the manual way with pacman, but I'd like to understand why this problem occured in the first place. Do you have an idea? |
this is the same issue? |
Today I have noticed this error when updating aur/discover-overlay
This seems to be the same issue |
line mentioned in the customizepkg is:
Well, maybe it's not an issue with the pkgdesc this time.
|
Bash has a feature called parameter substitutions. PKGBUILDs sometimes use that feature to strip prefixes: ``` pkgname="python-foo" _name=${pkgname#python-} ``` Because the syntax includes a hash sign (#), the current version of customizepkg’s regex pattern misinterprets usage of this feature as a line comment: ```plain [^#]*?(?= *#|\x0a) ^^^^^^ capture the part before the `#` sign ^^^ cut off the rest of the line ``` The problem with this pattern is that it interprets the `#` sign as the beginning of a line comment, even if it’s not preceded by a whitespace, including usages of parameter substitution. That means the pattern cuts off in the middle of a param-subst expression, causing customizepkg to abort with an error message: > /usr/bin/customizepkg: eval: line 168: unexpected EOF while looking for matching `}' Examples of affected packages: - discover-overlay [1] - python-llm [2] - python-progress [3] This problem has also been mentioned in a comment on GitHub issue ava1ar#30 [1] (however I think that the comment is unrelated to the multiline problem.) Fix the issue by requiring at least one whitespace in order to detect the start of a line comment: ```plain .*?(?=( +#)|\x0a) ^^ capture as much as we need ^^^^^ cut off only if ` #` appears (hash sign preceded by space) ``` [1]: ava1ar#30 (comment) [2]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-llm [3]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-progress
Bash has a feature called parameter expansion. [1] PKGBUILDs sometimes use that feature to strip prefixes: ``` pkgname="python-foo" _name=${pkgname#python-} ``` Because the syntax includes a hash sign (#), the current version of customizepkg’s regex pattern misinterprets usage of this feature as a line comment: ```plain [^#]*?(?= *#|\x0a) ^^^^^^ capture the part before the `#` sign ^^^ cut off the rest of the line ``` The problem with this pattern is that it interprets the `#` sign as the beginning of a line comment, even if it’s not preceded by a whitespace, including usages of parameter expansion. That means the pattern cuts off in the middle of a parameter expansion, causing customizepkg to abort with an error message: > /usr/bin/customizepkg: eval: line 168: unexpected EOF while looking for matching `}' Examples of affected packages: - discover-overlay [2] - python-llm [3] - python-progress [4] This problem has also been mentioned in a comment on GitHub issue ava1ar#30 [2] (however I think that the comment is unrelated to the multiline problem.) Fix the issue by requiring at least one whitespace in order to detect the start of a line comment: ```plain .*?(?=( +#)|\x0a) ^^ capture as much as we need ^^^^^ cut off only if ` #` appears (hash sign preceded by space) ``` [1]: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html [2]: ava1ar#30 (comment) [3]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-llm [4]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-progress
Bash has a feature called parameter expansion. [1] PKGBUILDs sometimes use that feature to strip prefixes: ``` pkgname="python-foo" _name=${pkgname#python-} ``` Because the syntax includes a hash sign (#), the current version of customizepkg’s regex pattern misinterprets usage of this feature as a line comment: ```plain [^#]*?(?= *#|\x0a) ^^^^^^ capture the part before the `#` sign ^^^ cut off the rest of the line ``` The problem with this pattern is that it interprets the `#` sign as the beginning of a line comment, even if it’s not preceded by a whitespace, including usages of parameter expansion. That means the pattern cuts off in the middle of a parameter expansion, causing customizepkg to abort with an error message: > /usr/bin/customizepkg: eval: line 168: unexpected EOF while looking for matching `}' Examples of affected packages: - discover-overlay [2] - python-llm [3] - python-progress [4] This problem has also been mentioned in a comment on GitHub issue #30 [2] (however I think that the comment is unrelated to the multiline problem.) Fix the issue by requiring at least one whitespace in order to detect the start of a line comment: ```plain .*?(?=( +#)|\x0a) ^^ capture as much as we need ^^^^^ cut off only if ` #` appears (hash sign preceded by space) ``` [1]: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html [2]: #30 (comment) [3]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-llm [4]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-progress
I'm creating this issue just to give info to googlers. It is fixed in #29
The text was updated successfully, but these errors were encountered: