Summary: | patch to add rpm '--last' option to epm-0.9.1 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Timothy Stotts <devel> |
Component: | [OLD] Unspecified | Assignee: | Aron Griffis (RETIRED) <agriffis> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | agriffis |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | patch to add '--last' option |
Description
Timothy Stotts
2006-07-04 12:24:06 UTC
Created attachment 90890 [details, diff]
patch to add '--last' option
Please consider inclusion. This is very useful.
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; + } + 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. |