Jguer / yay

Yet another Yogurt - An AUR Helper written in Go
GNU General Public License v3.0
11.17k stars 361 forks source link

feature to exclude unknown packages? #894

Closed sharethewisdom closed 4 years ago

sharethewisdom commented 5 years ago

I have described an issue before with aurman, about the handling of packages that are known to be created on the fly. The same applies here.

Packages made by tllocalmgr get a name with the prefix texlive-local-. I have about 260 of them. They are not expected to be in the AUR, and I think it would make sense not to try to look for them either.

Jguer commented 5 years ago

https://github.com/Jguer/yay/pull/756

Last discussions on this, a better way has not been found

sharethewisdom commented 5 years ago

I tried to solve my problem with a custom local repo

# /etc/pacman.conf
# ...
[tlmgr]
SigLevel = PackageRequired
Server = file:///home/admin/.texlive/texmf-var/arch/builds/

... and a path watcher service ...

# /usr/lib/systemd/system/tlmgr-repo-add.path
[Unit]
Description=watching for new tllocalmgr package builds
RequiresMountsFor=/home

[Path]
PathChanged=/home/admin/.texlive/texmf-var/arch/builds/

[Install]
WantedBy=multi-user.target
# /usr/lib/systemd/system/tlmgr-repo-add.service
[Unit]
Description=running repo-add
AssertFileIsExecutable=/usr/bin/repo-add
AssertFileIsExecutable=/usr/bin/bsdtar

[Service]
Type=oneshot
Environment=TEXLOCALMGR=/home/admin/.texlive/texmf-var/arch/builds/
ExecStart=/usr/bin/find $TEXLOCALMGR -type f -name '*.pkg.tar.xz' -exec /usr/bin/repo-add "$TEXLOCALMGR/tlmgr.db.tar.xz" '{}' \;
StandardError=journal
StandardOutput=journal

[Install]
WantedBy=multi-user.target

... but unfortunately repo-add fails because .PKGINFO is not found in these packages :angry:.

Please let me know if there's another solution, apart from the obvious (modifying tllocalmgr).

edit: makepkg -c is used for some reason.

Morganamilo commented 5 years ago

So today I found out about https://golang.org/pkg/path/filepath/#Match. A little annoying that it's specificly for paths and not just a generic fnmatch type thing but it should work well enough for this.

That way in yay's config you should be able to ignore foo or local-*. Not sure if it's worth having 3 separate options or just one ignore warnings flag though.

Morganamilo commented 4 years ago

Now that we don't print warnings for ignored packages you can add a local group to the pkgbuilds and ignore it. A local repo works fine too, no idea what the issue was on your end.

sharethewisdom commented 4 years ago

Actually, in my original issue I meant to differentiate between printing and checking ("not to look for"). I'm not sure about the actual implementation, but could we improve performance when ignored local packages with the aren't compared to what's in the AUR?