You are not logged in.
My apologies if this dead horse has already been beaten. A brief search didn't turn up any forum topics that addressed this issue.
Many Unix programs adhere to the dictum that successful execution should produce no output unless something interesting or surprising happened. The canonical example is running 'ls' on an empty directory.
'pacman' doesn't follow this design philosophy even if the '--quiet' switch is given.
# pacman -Syq
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to dateAs I understand it, the rationale is the desire to be able to use programs in a pipe. If the output contains purely informational text, then every program that uses that program's output has first to throw away the informational text.
Of course it's easy enough to quieten 'pacman'
pacman -Sy | sed '/^:: /d'or even
pacman -Sy | sed '/^:: \|is up to date$/d'So, I have a two part question: Why does 'pacman' produce purely informational text and why doesn't the '--quiet' switch really quieten 'pacman'?
Thanks for any insight.
Offline
Read what the quiet flag does...
> pacman -S --help
-q, --quiet show less information for query and searchOffline
Offline
Read what the quiet flag does...
> pacman -S --help -q, --quiet show less information for query and search
Did you read my post?
Offline
Yes... and my answer was that is does what it is clearly documented to do.
Offline
You answered a question I didn't ask. I want to know why pacman was designed the way it is, not how to use it. Sometimes the answer to why is not known, but it is never "Here's how to use it."
Offline
Thanks for the info.
Offline
I used firefox as an example of the differences between using query and search with and without the '-quiet' switch:
[karol@black ~]$ pacman -Q firefox
firefox 3.6.13-1
[karol@black ~]$ pacman -Qq firefox
firefox
[karol@black ~]$ pacman -Ss firefox
extra/firefox 3.6.13-1 [0,74 MB] [installed]
Standalone web browser from mozilla.org
extra/firefox-i18n 3.6.13-1 [4,47 MB]
Language packs for Firefox
extra/totem-plugin 2.32.0-3 [0,14 MB]
Totem mozilla/firefox plugin
community/arch-firefox-search 0.7-6 [0,00 MB] [installed]
Firefox Arch search engines (AUR, Pkgs, BBS, Wiki, etc.)
community/firefox-adblock-plus 1.3.3-1 [0,30 MB]
plugin for firefox which block ads and banners
community/firefox-noscript 2.0.9.8-1 [0,37 MB]
plugin for firefox which disables script
community/firefox-spell-ru 0.4.3-3 [0,50 MB]
Russian spellchecker dictionary for Firefox
unarch/firebrand 3.6-2 [0,00 MB]
A script to brand Firefox without recompiling.
unarch/swiftfox-athlon64 3.6.8-1 [9,42 MB]
Swiftfox is a prebuilt version of Firefox3, optimized for Athlon64 processors.
unarch/swiftfox-i686 3.6.8-1 [9,43 MB]
Swiftfox is a prebuilt version of Firefox3, optimized for i686 architectures.
unarch/swiftfox-prescott 3.6.8-1 [9,10 MB]
Swiftfox is a prebuilt version of Firefox3, optimized for Core Solo/Duo processors.
archlinuxfr/swiftfox-i686-fr 3.6.13-1 [9,51 MB]
Mozilla Firefox optimized build for OLD AMD and INTEL processors on x86 architecture (French version)
archlinuxfr/swiftweasel-amd-pgo 3.5.6-2 [9,59 MB]
Mozilla Firefox optimized build for AMD processors on x86 architecturei (with xulrunner 1.9.1.7).
archlinuxfr/swiftweasel-amd-pgo-fr 3.5.6-2 [9,60 MB]
Mozilla Firefox optimized build for AMD processors on x86 architecture (French version) (with xulrunner 1.9.1.7).
archlinuxfr/swiftweasel-intel-pgo-fr 3.5.6-1 [3,92 MB]
Mozilla Firefox optimized build for INTEL processors on x86 architecture (French version).
archlinuxfr/wto 1.0.3-3 [0,01 MB]
web tv orange sans firefox et enregistreur en python
cake/firefox 3.6-1 [0,95 MB] [installed: 3.6.13-1]
Mozilla.org Web Browser
cinan/firefox-pgo 3.6.8-2 [9,11 MB]
Mozilla Firefox customizable web browser (XULRunner independent, PGO optimized, 64-bit TraceMonkey)
cinan/mozplugger 1.14.1-1 [0,04 MB]
A Mozilla & Firefox multimedia plugin.
rfad/firefox-pgo 3.0.10-1 [8,09 MB]
Mozilla Firefox. XULRunner independent. And optimized for faster use :)
[karol@black ~]$ pacman -Ssq firefox
firefox
firefox-i18n
totem-plugin
arch-firefox-search
firefox-adblock-plus
firefox-noscript
firefox-spell-ru
firebrand
swiftfox-athlon64
swiftfox-i686
swiftfox-prescott
swiftfox-i686-fr
swiftweasel-amd-pgo
swiftweasel-amd-pgo-fr
swiftweasel-intel-pgo-fr
wto
firefox
firefox-pgo
mozplugger
firefox-pgoI think this is how the switch is meant to work. I posted a link to a bug/feature request that deals with a similar issue to what you report here.
Maybe info about every repo - even if it's up to date - is printed for the sake of consistency?
Offline
@karol
My question has to do when pacman has nothing to do, not when there is something interesting or unusual to report. I know about the '--quiet' switch. I know how to use it. I know when to use it.
My question is a design question, not a usage question, and I understand that there may not be any answer other than, "Because."
Offline
simply because, when you run pacman you need to see some output to make sure that it ran correctly. As to why there isn't another switch which disables all output -- well the answer to that might just be "Because" (no one else thought about it or needed it)
however, when pacman has nothing to do, it has a pretty standard output. You can cook up a script which will read pacman's output and if it says "there is nothing to do", you know for sure that pacman has nothing to do, and you can use sed awk or anything else to replace the entire output with "" (empty space) - as you have done already.
Assign an alias to pacman to use your script and you are done.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
simply because, when you run pacman you need to see some output to make sure that it ran correctly
The absence of output can just as readily signal that a program ran correctly. It's a matter of convention, a convention that many Unix programs use, particularly the original command line programs (e.g. those in the binutils & coreutils packages). [See Google 'unix "rule of silence"'. ]
Perhaps we should all give this topic a rest.
Offline