Well, the script in the description is a bit too simple. In my
application, I was looking for 'Auto-Installed:' field with value 0 to
find manually installed packages, and due to the change in the way the
file is build nowadays I do not find them by the code anymore. Now the
field is pointless. I suppose now I could find the packages by set
substraction, if I want to optimize my code.

"time apt-mark showauto >/dev/null"
is slow no matter when I run it. It is about the same if you run it for any 
single package. Do you call those a borderline cases? It might not be slow by 
latest and greatest supercomputers though, but I make code for slower hardware, 
too, and try to strive for reasonable responsiveness in my applications.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1713219

Title:
  'apt-mark showauto' and 'apt show' is slow

Status in apt package in Ubuntu:
  Triaged

Bug description:
  $ time apt-mark showauto >/dev/null

  real  0m0.587s
  user  0m0.552s
  sys   0m0.016s

  When I run the command first time, it is even much slower.

  I could do the job in fraction of a time using awk in POSIX shell
  script:

  auto_file='/var/lib/apt/extended_states'
  eval $(apt-config shell auto_file Dir::State::extended_states/f)
  awk '/^Package:/ {
        pkg=$2
        getline; arch=$2
        getline
        if($2==1) print pkg ":" arch
  }' "$auto_file" | CL_ALL=C sort -u

  real  0m0.019s
  user  0m0.008s
  sys   0m0.000s

  That prints architecture for every package and shows entries in
  slightly different order, though. And the file could be out of date
  showing packages that are not installed?!?

  Similarly

  apt show <pkg>

  is slow. (It also shows whether a package is manually or automatically
  installed.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: apt 1.0.1ubuntu2.17
  ProcVersionSignature: Ubuntu 4.4.0-92.115~14.04.1-generic 4.4.76
  Uname: Linux 4.4.0-92-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3.25
  Architecture: amd64
  CurrentDesktop: XFCE
  Date: Sat Aug 26 12:59:00 2017
  EcryptfsInUse: Yes
  InstallationDate: Installed on 2014-09-21 (1070 days ago)
  InstallationMedia: Ubuntu-Studio 14.04.1 LTS "Trusty Tahr" - Release amd64 
(20140722.1)
  SourcePackage: apt
  UpgradeStatus: No upgrade log present (probably fresh install)
  modified.conffile..etc.cron.daily.apt: [modified]
  modified.conffile..etc.kernel.postinst.d.apt.auto.removal: [modified]
  mtime.conffile..etc.cron.daily.apt: 2017-05-03T10:27:27.617839
  mtime.conffile..etc.kernel.postinst.d.apt.auto.removal: 
2017-06-01T14:39:39.236080

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1713219/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to