On Mon, Sep 22, 2014 at 08:02:19PM +0200, Guillem Jover wrote:
> > If I tell a program to do something and the program can't do that,
> > that's an error. In this case, however, I'm merely asking dpkg what he
> > would do, so the messages are not of the "sorry, I can't do that" type,
> > but instead "Look, this is what I would do".
> 
> Could you provide an actual example of the problematic output to know
> what do you think is misbehaving? Because if I do this on say fbset, I
> get on stdout:
> 
>   ,---
>   (Reading database ... 219138 files and directories currently installed.)
>   Would remove or purge fbset (2.1-28) ...
>   `---
> 
> but if I do this on dpkg I get something like this on stderr:
> 
>   ,---
>   dpkg: error processing package dpkg (--purge):
>    this is an essential package; it should not be removed
>   Errors were encountered while processing:
>    dpkg
>   `---
> 
> Is stuff like that what you perceive as an issue?

Yes. I think both cases should go to stdout, not only the first one.

In my case, I was trying to determine why apt-get wanted to remove
stellarium today when doing "apt-get dist-upgrade". There was a
message saying

The following packages were automatically installed and are no longer required:
  libqt5concurrent5 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 
libqt5opengl5 libqt5printsupport5 libqt5qml5
  libqt5quick5 libqt5script5 libqt5sql5 libqt5widgets5 libxcb-render-util0 
libxcb-sync1 libxcb-xkb1 libxkbcommon-x11-0
  stellarium-data

so I copied and pasted the list above into a file called "AR" and then
tried to see if I could really remove any of them individually:

for a in `cat AR`; do dpkg --no-act --purge $a; done | less

I naively thought that no 2>%1 would be needed here because of
the --no-act option, but I was wrong.

> For me the only difference between the two is that it's acting the same
> except that it does not perform any actual modification (as documented
> in the man page), so at least the above two examples make perfect sense
> to me. :)

It is certainly *not* the only difference: In your first example, dpkg
seems to realize that it is performing a simulation and the wording is
clearly different because of the --no-act option, as it says:

*Would* remove or purge fbset

To be consistent, dpkg could similarly say

"Would not remove/purge package foo because it is essential".

without making the alarms sound as if it were the real thing.


This is somehow a matter of principles: If a program does what you ask
it to do, then there is no error. If dpkg was actually *unable* to
tell me what would happen, that would be indeed an error and using
stderr would be completely justified, but in this case dpkg does what
I ask it to do (i.e. tell me what would happen).


Thanks.


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to