juergenhoetzel / pkgbuild-mode

Major mode for editing PKGBUILD files
49 stars 12 forks source link

flymake error: brace expansion and globbing ins source fields doesn't work #23

Open ndowens opened 3 years ago

ndowens commented 3 years ago

When trying to update checksums I get: [FlyMake] cannot verify sources: don't use globbing 3/2

while sources aren't using globbing, just the normal $pkgname $pkgver variables in it.

juergenhoetzel commented 3 years ago

Would you mind sharing the PKGBUILD?

ndowens commented 3 years ago

https://termbin.com/uk03 is one of them, seems there was another

juergenhoetzel commented 3 years ago

The error message is a litle bit misleading. The problem is not globbing but the use of brace expansion:

"https://linuxcontainers.org/downloads/$pkgname-${pkgver}.tar.gz"{,.asc}
juergenhoetzel commented 3 years ago

It should be possible to make pkgbuild-mode.el globbing-agnostic: pkgbuild-mode could use external shell code to perform the expansions.

ndowens commented 3 years ago

How can I do that, sorry new to emacs

juergenhoetzel commented 3 years ago

How can I do that, sorry new to emacs

I have just improved the globbing support in commit ed3349d: It just marks the whole region as error if one source is unavailable.

Improved versions of pkgbuild-mode.el have to match the (expanded) source to the corresponding unexpanded (globbed) source field: This is not quite easy to implement.

Bildschirmfoto von 2021-01-19 19-11-42

ndowens commented 3 years ago

I will give it a try soon

ndowens commented 3 years ago

It did not give the previous error but changing version in PKGBUILD gives shell command success but does not change checksum

Edit: Previously it was giving source not found in /var/cache/pacman/src

Edit2: I've also learned if I have the source in current dir, it works.

Also working on trying to fix it as well and see what fixes it for me

ndowens commented 3 years ago

Ok I did a few changes, and now it downloads source remotely and puts them in to /var/cache/pacman/src but the problem is it outputs as pkgname-pkgver.src.tar.gz instead of pkgname-pkgver.tar.gz which is now the next issue.

Ok for Artixlinux, which is just Archlinux w/o systemd I solved it. Package 'pacman-contrib' has a script called updpkgsums, it will download and update checksum. If you rewrite the package slightly, could use that to cause it to download source and update checksums automaticly

ndowens commented 3 years ago

Ok I have fully converted it for use on Artix and it should work on Arch as well. Lines changing from Arch to Artix can be ignored if you want to possibly change package to be somewhat similar to mine. In summary I changed pkgbuild-tar to pkgbuild-sums and have it used updpkgsums instead of makepkg --source( one of the benefits is actually no need of a path to look for source files). Update menu to change build option part of the menu . The buildpkg-world is only good on Artix AFAIK. View of my changes: https://github.com/juergenhoetzel/pkgbuild-mode/compare/master...ndowens:master