On Tue, 17 Mar 2009 10:01:27 -0400, James Gray <jamespgray@gmail.com> wrote:
My dpkg.py is simply a wrapper around dpkg which parses out the command line arguments to determine which packages are being added/removed; it also uses SUDO_USER to determine the user who called sudo.
apt-get will also install dependencies of the packages you specify. A simple command line parsing script wouldn't catch this. Perhaps you handle this already or don't care to track individual libraries. However, It seemed important enough to mention.
Yes, apt-get and aptitude automatically figure out dependencies and install them, but both apt-get and aptitude call dpkg, or whatever you have the dpkg variable set to in apt.conf, with a list of packages to install (or remove). For example if you run 'apt-get install emacs' apt will download the necessary packages/dependencies and then eventually call 'dpkg --configure emacs emacs22-common emacsen-common emacs22-bin-common emacs22-gtk'; so if you wrap dpkg you'll get a list of all the packages that are installed/removed since all package additions, whether they're dependences or not, are done through dpkg, regardless if you use apt-get or aptitude or install one package or many packages w/ and w/o dependencies. Actually the nice thing about apt is that the people who wrote apt went through great pains to make sure dpkg is called a minimal amount of times; twice for package(s) installation, first for unpacking a package(s) then again to configure the package(s). For package removal dpkg is only called once. This is really nice because if i wrote inefficient code my wrapper will still only get called twice at most, even if i decide to install 100 packages at once. If dpkg was called 100 times to install 100 packages, that would drastically increase the time complexity of installing packages, especially if it's running my code :). -- brad