Bug#649229: cupt: Provide data structure to store install date.
On Sat, 19 Nov 2011 11:16:36 +0200 Eugene V. Lyubimkin jac...@debian.org wrote: Note: Why 'cupt' and not 'dpkg'? Ideally 'dpkg' ought to store the installation date, but a review of the 'dpkg' bug list shows its cautious maintainers can be slow to change things: That's true. However, that's not a good reason to break layering. Agreed. So far no packages are layered upon 'cupt'. Creating new 'cupt' data fields somewhere in '/var/lib/cupt/lists' would be less risky. Regarding the use-case, indeed it's not possible to 'sort by installation date', but logs should be enough to remember what program(s) was/were installed recently. Specifically, Cupt logs store all package changes (done by libcupt) for 2 years by default, and logs can be either read by human or a specific log parser. By some point of view, the logs is the database. There's a lot of data in '/var/log/dpkg.log*': fields like Package:, Status:, and Version:, could each be derived from the logs. Of course I'd rather study from a lengthy technical book with a good index, than an abridged edition without an index. I've been toying with some date extraction code for 'dpkg.log'. Make a list of log derived install times: OUT1=/tmp/loglist_dpkg.txt OUT2=/tmp/install_times.txt # create one big log file, of lines containing 'status installed'. % zgrep '.*' `ls /var/log/dpkg.log* | sort -Vr` | tac | \ grep 'status installed' $OUT1 # In that file, find the first instance of each package name, # then output it to another file; date first, then package name. % for f in `dglob` ; do grep --max-count=1 $f $OUT1 ; done | \ sed -n 'h;s/ [^ ]*$//;s/.* //;x;s/^[^:]*://;s/ stat.*//;G;s/\n/ /p' $OUT2 # view packages sorted by (logged) installation date % sort -g $OUT2 | less (The code needn't check for packages later removed, since the 'dglob' command lists only currently installed packages.) My Debian system's been going since the late '90s, with several hardware upgrades. One problem with that log code above is it won't list any packages installed before 'dpkg' logging existed (3/2/09). # count 'dpkg.log' installs % wc -l $OUT2 2649 # count installed packages. % dglob | wc -l 3812 That's a lot of old packages. Generating pre 3/2/09 install times would be less exact. My file system ought to have had earliest modify times for files contained in older packages, but unfortunately I've changed file systems over the years, at times using some variant of 'cp', which updated the modify times. But it's still possible to narrow the date ranges. For example, since virtually all packages have changelogs, the latest date in the changelog is always earlier that the install time. (Come to think of it, a first installed field might be useful too. Then a user could check which packages have been around locally the longest.) HTH... -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#649229: cupt: Provide data structure to store install date.
Hi! On 2011-11-18 22:21, A. Costa wrote: Several Windows package managers (Secunia, Glary Utils, etc.) can sort installed programs by install date. The feature is surprisingly useful, for example, when one forgets the name of a recently installed package or program. Since 'dpkg' doesn't store the install date, Debian lacks a simple sort by install date function. (There are kludges, like parsing logfiles, but the logs only go back so far.) Possible remedy: Add an install date field to the 'cupt' installed package database. Note: Why 'cupt' and not 'dpkg'? Ideally 'dpkg' ought to store the installation date, but a review of the 'dpkg' bug list shows its cautious maintainers can be slow to change things: That's true. However, that's not a good reason to break layering. Regarding the use-case, indeed it's not possible to 'sort by installation date', but logs should be enough to remember what program(s) was/were installed recently. Specifically, Cupt logs store all package changes (done by libcupt) for 2 years by default, and logs can be either read by human or a specific log parser. By some point of view, the logs is the database. -- Eugene V. Lyubimkin aka JackYF, JID: jackyf.devel(maildog)gmail.com C++/Perl developer, Debian Developer -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#649229: cupt: Provide data structure to store install date.
Package: cupt Version: 2.2.2 Severity: wishlist Several Windows package managers (Secunia, Glary Utils, etc.) can sort installed programs by install date. The feature is surprisingly useful, for example, when one forgets the name of a recently installed package or program. Since 'dpkg' doesn't store the install date, Debian lacks a simple sort by install date function. (There are kludges, like parsing logfiles, but the logs only go back so far.) Possible remedy: Add an install date field to the 'cupt' installed package database. Note: Why 'cupt' and not 'dpkg'? Ideally 'dpkg' ought to store the installation date, but a review of the 'dpkg' bug list shows its cautious maintainers can be slow to change things: # Count 'dpkg' bugs open. At present there's more than three hundred. % wget -O - 'http://bugs.debian.org/cgi-bin/pkgreport.cgi?archived=nopkg=dpkgrepeatmerged=yes' 2 /dev/null | html2text | sed -n '/\* #/{s/.*#\([0-9]*\).*/\1/p}' | sort -u | wc -l 334 Hope this helps... -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 3.0.0-2-686-pae (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C) Shell: /bin/sh linked to /bin/dash Versions of packages cupt depends on: ii libboost-program-options1.46.1 1.46.1-7 ii libc6 2.13-21 ii libcupt2-0 2.2.2 ii libgcc1 1:4.6.2-4 ii libstdc++6 4.6.2-4 cupt recommends no packages. Versions of packages cupt suggests: ii libreadline66.2-7 ii sensible-utils 0.0.6 -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org