First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 139226
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Aron Griffis (RETIRED) <agriffis@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Timothy Stotts <devel@tstotts.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
epm-0.9.1-last-option.patch patch to add '--last' option patch Timothy Stotts 2006-07-04 12:25 0000 1.22 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 139226 depends on: Show dependency tree
Show dependency graph
Bug 139226 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-07-04 12:24 0000
This patch adds a new switch, '--last', which sorts the package order just
before printing to STDOUT.  The packages are ordered by Build/Install time,
newest first.

From the rpm-4.2.1 man page:

   PACKAGE QUERY OPTIONS:
       --last Orders  the  package listing by install time such that the
              latest packages are at the top.

------- Comment #1 From Timothy Stotts 2006-07-04 12:25:38 0000 -------
Created an attachment (id=90890) [edit]
patch to add '--last' option

Please consider inclusion.  This is very useful.

------- Comment #2 From Aron Griffis (RETIRED) 2006-09-08 12:47:50 0000 -------
Thanks, I added this functionality in version 1.31.  My implementation is a
little different from yours, but should work nearly the same way.  It uses
integer comparison for the mtimes instead of string comparison to avoid
magnitude bugs.

+    # Sort package order, by reverse mtime
+    if ($opt{'last'}) {
+       my %mtimes;
+       @pkgs = sort {
+           # When was this last built/installed?
+           unless (exists $mtimes{$a}) {
+               $mtimes{$a} = (stat "$dbpath/$a")[9];
+               vverb "$a = $mtimes{$a}";
+           }
+           unless (exists $mtimes{$b}) {
+               $mtimes{$b} = (stat "$dbpath/$b")[9];
+               vverb "$b = $mtimes{$b}";
+           }
+           $mtimes{$b} <=> $mtimes{$a} or $a cmp $b;
+       } @pkgs;
+    }
+

------- Comment #3 From Timothy Stotts 2006-09-08 19:40:03 0000 -------
Sounds good, and thanks!  I use this feature in conjunction with 'sed' when
determining what packages to rebuild for a new toolchain / library, since
revdep-rebuild is often insufficient.  Example: list all packages emerged prior
to gcc 4.1.1 .

I should mention that I discovered a bug in my '--last' implementation some
time ago, and I do not know if the integer comparison will solve it.  If the
file whose datestamp is tested (environment.bz2 ?) does not exist, then that
package is not listed after sorting with 'epm -qa --last', whereas an 'epm -qa'
would still list that package.

First Last Prev Next    No search results available      Search page      Enter new bug