Skip to content
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

Use perl to process multi-line sha256. #1

Open
ManiaciaChao opened this issue Apr 17, 2020 · 0 comments
Open

Use perl to process multi-line sha256. #1

ManiaciaChao opened this issue Apr 17, 2020 · 0 comments

Comments

@ManiaciaChao
Copy link

Regular expression sha256sums=.*$ only match from sha256sums= to EOL. Usually, more than one sources can be found in an AUR package. We usually intend to match and replace multiple lines, but sed command has its limits. Handling such case with sed command could be tricky.

However, you can simply use perl instead of sed like below:

perl -i -0pe "s/sha256sums=[\s\S][^\)]*\)/$(makepkg -g 2>/dev/null)/" PKGBUILD

P.S. I'm not going to make a PR because my fork differs a lot from yours.

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

No branches or pull requests

1 participant