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

Re: Functional Difference of dpkg --get-selections vs --get-selections "*"



On 2016-06-16 18:36 +0000, Bruce Gates wrote:

> What is the functional difference between dpkg --get-selections and dpkg --get-selections "*"?

>From the manpage:

,----
|  --get-selections [package-name-pattern...]
|         Get list of package selections, and  write  it  to  stdout.
|         Without a pattern, non-installed packages (i.e. those which
|         have been previously purged) will not be shown.
`----

In most cases the output will be the same, though.

> It seems to me that the first command would find all packages anyway,
> making the wildcard erroneous...perhaps I'm mistaken?

There is a difference if you have selected currently purged packages for
installation, e.g. with "dpkg --set-selections":

,----
| # apt-get install dselect && dselect update && echo "ed install" | dpkg --set-selections
| [...]
| # diff -u <(dpkg --get-selections) <(dpkg --get-selections "*")
| --- /dev/fd/63  2016-06-16 19:36:02.856792917 +0000
| +++ /dev/fd/62  2016-06-16 19:36:02.856792917 +0000
| @@ -31,6 +31,7 @@
|  dselect                                                install
|  e2fslibs:i386                                  install
|  e2fsprogs                                      install
| +ed                                             install
|  fakeroot                                       install
|  file                                           install
|  findutils                                      install
`----

Old versions of dpkg also used to keep information about packages in the
status file after purging them, but this was changed in dpkg 1.15.4¹.

Cheers,
       Sven


¹. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472208


Reply to: