Bug 4050

Summary: rpm -qlvp format not exactly like ls
Product: [Retired] Red Hat Linux Reporter: petr
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-07-17 19:01:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description petr 1999-07-15 10:10:33 UTC
I've noticed strange behavior - Midnigt Commander shows
incorrect year for some files inside rpm files, e.g. Sep
1998 is displayed as Sep 1999.

I've discovered that the problem is in rpm -qlvp listing
format. In opposite to ls command, it displays time of files
for all dates not older than one year and this confuses mc.

Of course, it's hard to say that it is rpm's failure, but
maybe it would be better to conform POSIX standard.

This is the fragment from ls.c (fileutils-4.0):


if (current_time > when + 6L * 30L * 24L * 60L * 60L      /*
Old. */
    || current_time < when - 60L * 60L)   /* In the future.
*/
  {
    /* The file is fairly old or in the future.
       POSIX says the cutoff is 6 months old;
       approximate this by 6*30 days.
       Allow a 1 hour slop factor for what is considered
"the future",
       to allow for NFS server/client clock disagreement.
       Show the year instead of the time of day.  */

    fmt = "%b %e  %Y";
  }
else
  {
    fmt = "%b %e %H:%M";
  }

Comment 1 Jeff Johnson 1999-07-17 19:01:59 UTC
Fixed in cvs (will be rpm-3.0.3).