You are not logged in.
Is it possible to add a custom reminder to be displayed when pacman updates certain packages? Seeing as packages are able to display user instructions in case manual intervention is needed, it seems to be possible server-side. What about user-side? I can't seem to find anything on the wiki or the forums.
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
What do you mean by "custom reminder"? Packages can display custom messages on upgrade through an install script (see man PKGBUILD).
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
I mean me as user adding a text message to be displayed when pacman updates a specific package. Adding things like "don't forget to rebuild package x from AUR"
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
Oh, that would be nice to have. If something like that doesn't exist, perhaps someone could make one. May be ask keenerd to add that feature to pacmatic.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
I don't believe anything like that exists - but it would be fairly easy to write a pacman wrapper script that would do this.
If I wanted to do this, I'd approach by creating a wrapper script that calls pacman with any parameters it was given, then (perhaps dependent on flags) it would check for new files in /var/cache/pacman/pkgs/. Each of these would be newly installed (or at least synced) packages. These base names of these packages could be matched against a file for message to print out. So, as a completely untested example of such code:
pacman() {
pre_cache=($(ls /var/cache/pacman/pkg))
/usr/bin/pacman $@ || return
# potentially test flags here, return on anything but -S* perhaps
post_cache=($(ls /var/cache/pacman/pkg))
# TODO, compare pre_cache to post_cache to create array new_cache
for pkg in "${new_cache[@]}"; do
pkgname=${pkg/....} # TODO, need right substitution to remove all version numbers to get base pkg name
awk '/^'$pkgname':/ { $1=""; print $0; }' /path/to/my/messages
done
}The messages file would then be:
linux: the kernel was updated
vim: cool a new editor!
...EDIT: the above suggestion to submit the request to pacmatic is a great approach - pacmatic already does the hardest part of this little bash function which is getting the base package names of anything that was updated. Once you have those package names it'd really only be the `awk` command or a suitable alternative. Even easier would be to have a "messages" directory where each package of interest had a file named after the base package name. So the awk line would be replaced by `cat /path/to/messages/$pkgname`.
Last edited by Trilby (2014-05-28 12:00:51)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Isn't this what post_install() and post_upgrade() in foo.install do?
https://projects.archlinux.org/svntogit … s/syslinux
If you don't want to use ABS, you can grep the output of 'checkupdates' before updating your system:
checkupdates | grep -q pkgname && echo foo || echo bar$ checkupdates | grep -q libcups && echo "Brace yourselves: libcups is about to be installed!" || echo "Nothing to see, move along."
Brace yourselves: libcups is about to be installed!$ checkupdates | grep -q firefox && echo "Brace yourselves: firefox is about to be installed!" || echo "Nothing to see, move along."
Nothing to see, move along.Offline
Karol, the foo.install scripts only work when these notes are added by the packagers. I doubt the OP wants to maintain custom versions of every package - and even if he did, then they'd only be updated when he manually updated them anyways.
But the checkupdates idea could be good:
for pkg in $(checkupdates); do
[[ -f /path/to/messages/{$pkg} ]] && cat /path/to/messages/${pkg}
done"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I haven't done much bash programming, but I see where it leads to. Thanks for the suggestions, I think I will submit a feature request to keenerd for the time being.
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline