[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#815464: apt: options and arguments don't have consistent behavior



Hello David,


On Sun, 2016-02-21 at 23:14 +0100, David Kalnischkies wrote:
> Hi
> 
> (I don't understand the first message in the bug, so I refer only to
> the
> second in the hope that the second is a/the example for the "bug")
> 


The problem is just -qq vs -qqq. I was just hoping to have a
consistency in behavior when using the option with apt commands.

For example; if you use the same option for the upgrade/install target,
it is not quiet but gives you a prompt; so you have to use an extra 'q'

rrs@learner:~/.rrs-home/devel/apt-offline/apt-offline (master)$ apt -qq
--print-uris install emacs
The following additional packages will be installed:
  emacs24 emacs24-bin-common emacs24-common libm17n-0 libotf0 m17n-db
Suggested packages:
  emacs24-common-non-dfsg m17n-docs
Recommended packages:
  emacs24-el
The following NEW packages will be installed:
  emacs emacs24 emacs24-bin-common emacs24-common libm17n-0 libotf0
m17n-db
0 upgraded, 7 newly installed, 0 to remove and 12 not upgraded.
Need to get 16.9 MB/18.2 MB of archives.
After this operation, 91.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
2016-02-22 / 15:07:35 ♒♒♒    ☹  => 1  


vs



rrs@learner:~/.rrs-home/devel/apt-offline/apt-offline (master)$ apt
-qqq --print-uris install emacs
'http://ftp.debian.org/debian/pool/main/e/emacs24/emacs24-common_24.5+1
-6_all.deb' emacs24-common_24.5+1-6_all.deb 12825770
MD5Sum:fb43f4fd59052a28cc3ed1b5058b04d7
'http://ftp.debian.org/debian/pool/main/e/emacs24/emacs24-bin-common_24
.5+1-6+b1_amd64.deb' emacs24-bin-common_24.5+1-6+b1_amd64.deb 256632
MD5Sum:62e8c7b5c3c433ad7f9f9796885662db
'http://ftp.debian.org/debian/pool/main/libo/libotf/libotf0_0.9.13-3_am
d64.deb' libotf0_0.9.13-3_amd64.deb 52794
MD5Sum:a2593897a324bad727ce5d848426fb32
'http://ftp.debian.org/debian/pool/main/m/m17n-lib/libm17n-0_1.7.0-3_am
d64.deb' libm17n-0_1.7.0-3_amd64.deb 249092
MD5Sum:8e944e96b488f5d1fe119aeb4f8cf98a
'http://ftp.debian.org/debian/pool/main/e/emacs24/emacs24_24.5+1-6+b1_a
md64.deb' emacs24_24.5+1-6+b1_amd64.deb 3495008
MD5Sum:e05e15580c68aa77b15ce9b370778c54
'http://ftp.debian.org/debian/pool/main/e/emacs-defaults/emacs_46.1_all
.deb' emacs_46.1_all.deb 1634 MD5Sum:1f115942065ac452467e02377368ee22
2016-02-22 / 15:07:40 ♒♒♒  ☺    



Now if I do the same with update (my previous email has that example),
I need to lower 1 level.

> 
> On Sun, Feb 21, 2016 at 11:20:42PM +0530, Ritesh Raj Sarraf wrote:
> > When triggering update with -qqq, it goes ultra quiet.
> > 
> > 
> > rrs@learner:~$ apt -qqq --print-uris update
> > 2016-02-21 / 23:19:10 ♒♒♒  ☺    
> > rrs@learner:~$ 
> 
> And this is a problem exactly why?
> 

It is just not consistent in the update vs upgrade/install use case.


> You might have noticed that this is the case with apt-get -qq
> already,
> so apt actually takes the liberty of requiring more q's for the same
> effect 

Yes. but in case of apt-get, the single '-qq' behavior is consistent
across update, upgrade etc.

> (I never quite liked the "ultra quiet" directly after "slightly
> less chatty", but changing that while staying compatible in the code
> is
> hard, so for now I introduced 3 levels only… and the new level-2 is
> a small step up from level-1 I found useful for testing…).
> 
> I realize now that our recent redesign of the --help messages removed
> a very relevant information tidbit for this discussion:
>      -qq No output except for errors
> 
> We should probably move that to the manpage (although it isn't
> entirely
> correct, but relatively close to reality).
> 

Oh Yes. These option seem to have gone away from the documentation. I
reported the bug because I've been using it in apt-offline.

> So, works as expected or what exactly do you expect?
> 
> 
> Maybe the expectation is that "apt" doesn't have such options as they
> aren't really suited for interactive use, but then again I sometimes
> use
> them "interactively" – if only to test things and I don't think there
> is
> a lot of point in discriminating options based on the command.
> 
> 
> Oh, and as your message indicates a misunderstanding: "apt" will
> NEVER
> guarantee a stable interface – that is actually the point of
> introducing
> apt in the first place. We have a stable interface which can be used
> in
> scripts with apt-get and co as they will neither disappear nor do
> they
> change default behaviour.¹ "apt" is just another binary which comes
> with
> a slightly different set of default options we deem more reasonable
> for
> interactive usage, but uses the very same code as apt-get and co.
> 
> So if you have a script, please continue to use 'apt-get update
> --print-uris' in it.
> 

Thanks for explaining this. I added apt support because it is much
faster and did slightly better dependency resolving (I guess which is
courtesy of the different set of defaults).


-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: