Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 2013 14:13:56 +0900 (JST)
From:      Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/184426: ports-mgmt/portupgrade-devel date range of pkg_glob doesn't work as expected
Message-ID:  <201312020513.rB25DuQJ039483@elvenbow.cc.kyushu-u.ac.jp>
Resent-Message-ID: <201312020530.rB25U1tO017408@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         184426
>Category:       ports
>Synopsis:       ports-mgmt/portupgrade-devel date range of pkg_glob doesn't work as expected
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 02 05:30:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Yoshiaki Kasahara
>Release:        FreeBSD 9.2-PRERELEASE amd64
>Organization:
Kyushu University
>Environment:
System: FreeBSD elvenbow.cc.kyushu-u.ac.jp 9.2-PRERELEASE FreeBSD 9.2-PRERELEASE #0 r255506: Fri Sep 13 16:09:51 JST 2013 root@elvenbow.cc.kyushu-u.ac.jp:/usr/obj/usr/src/sys/ELVENBOW amd64


	
>Description:

A date range specification for pkg_glob has no effect because date_installed()
in pkginfo.rb always returns Time.at(0) when $pkgdb.with_pkgng? is false.
Actually "pkgname" is not needed and undefined here, but "rescue" hides
the actual bug.

	
>How-To-Repeat:
	

pkg_glob '>2000-01-01' returns empty list.

>Fix:

--- pkginfo.rb  2013-12-02 14:04:23.000000000 +0900
+++ pkginfo.rb.fix      2013-12-02 14:04:02.012831037 +0900
@@ -195,9 +195,9 @@
     if $pkgdb.with_pkgng?
       Time.at(get_info(:mtime).to_i)
     else
-      File.mtime(pkg_comment(pkgname)) ||
-        File.mtime(pkg_descr(pkgname)) ||
-        File.mtime(pkg_contents(pkgname)) rescue Time.at(0)
+      File.mtime(pkg_comment) ||
+        File.mtime(pkg_descr) ||
+        File.mtime(pkg_contents) rescue Time.at(0)
     end
   end

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312020513.rB25DuQJ039483>