Skip to main content
Topic: Any way to hide skipping warnings? (Read 828 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Any way to hide skipping warnings?

I wrote a script for paru and pacman to update everything on my system manually everyday. One of its feature is to skip the confirmation of some packages that I know updates daily and I don't bother to check if I need to update them, and I just need to add the package name to a file so it will be parsed to ignore them. I want a very terse output from that since I already know what will happen, especially since I also have things I may need to tend to in other stages of the script. I didn't have use of that feature until recently haskell and pandoc packages started updating very frequently and I found that when passed --ignore or --needed arguments to pacman and paru it will give a wall of text saying that the packages are skipped.

At first I was not aware that --ignore also has the same problem so I added a loop to filter it so that only those appeared in -Quq after the first -Syu --ignore="something", will be explicitly passed to a second -Su,  This kind of fixed it and I can adapt it to the first upgrade command too, but it will make the script messier and I am thinking if there is any way to make pacman output less from like pacman.conf. Especially since I want to keep track of other errors I should really tend to, so redirecting error will just make things very confusing.

I thought this was a pacman problem and asked on the Arch forum already and they just shoved me out of the door. Does Artix repository has anything that will make it spit out warnings like that? I want to update my packages in 2 parts, 1st one is monitored and I can see what will be updated without a page of warnings, 2nd one is fully automated and will update all upgradeable packages on a list.

Re: Any way to hide skipping warnings?

Reply #1
Don't skip prompts. They are important and intentional.

Read all messages during installation, especially those written by pacman hooks (example: installing artix-archlinux-support). Those are very important!

Don't ignore upgrades. You only need that in case something is very wrong with an update to some package, so you hold upgrading until it is fixed. That happens very rarely.

pacman and Artix repositories are enough to use Artix. If you really need Arch repositories, you have to enable them in a correct manner.

Re: Any way to hide skipping warnings?

Reply #2
pacman has a -q option that could help a bit but doesn't seem to suppress ignored package warnings. There might be times you explicitly reinstall or upgrade something that's in Ignorepkg in /etc/pacman.conf (possibly this would avoid using --ignore ?) when you get a warning that it's ignored but being upgraded anyway, so you'd need to be careful writing any filters that they don't get triggered at unforseen times. (You could capture the output from pacman and remove lines matching patterns and print the edited results, doing this while it executes might be more difficult than when it exits, but should be possible.) Why worry about writing a longer script though, if it doesn't cause any appreciable delay? If it does then use a language that can be compiled - python, nim, (these are more like bash scripting) or C, C++ (these are more basic and low level) etc. where you can write 1000's of lines and it will execute almost instantly. Your code may have more lines but will be much faster as it will do only what you want. The speed issue with bash (and similar) scripts is many of the commands are calling existing apps that can be large themselves and provide lots of option and usage possibilities, although it's often not a problem.

Re: Any way to hide skipping warnings?

Reply #3
I am not a programmer myself so I am keeping the script as simple as possible. Also it seems that it takes quite a long time for paru to return the package list to me.

I have tried -q and -qq options before but as you have said it doesn't suppress those warnings, and I don't really want to deal with pacman.conf as I am still not very sure how it works, and I will need root privilege to use it no matter I am using pacman or paru, the latter calls sudo by itself so i don't need it.

I think I will heed your advice in writing it when I am at my wit's end. I am guessing that pacman does not distinguish package skipped in the arguments and those skipped either in pacman.conf or some issues, since it seems moronic to have it warn you when you are fully conscious of it.

I think I will leave the thread unsolved though since the title question is not solved.

Re: Any way to hide skipping warnings?

Reply #4
This is not especially advisable for regular use, although if you were using it for "safe" pacman query type operations it would probably be OK:
Code: [Select]
$ sudo pacman -S packagename --noconfirm |& grep -v "ignoring package upgrade"
It kind of works without the noconfirm, but BASH writes the stdin prompt to stderr and it gets lost so you have to know what to enter from previous experience! Also redirecting stderr to /dev/null seems to get rid of the warnings, it probably gets rid of others too. The other problem is grep re-writes the filtered output so you lose the color shell escapes from the pacman original. Not sure why the stdin prompt (y/n) etc. isn't shown with grep, perhaps the pipe isn't flushed or the stdin write isn't redirected or something. Try searching about on Stack Overflow for inspiration I guess!  :D

 

Re: Any way to hide skipping warnings?

Reply #5
Just tried it, the color issue can be fixed with --color=always(which will break piping to a file but its not like I wrote it for that) but not the progress bar. And it seems that this is the perfect time for testing amidst ffmpeg breakage, because this broke all prompts in a dependency conflict. Reserving it to 2nd part only will help though, now only the 1st ignore is a problem.