From stijn@pcwin002.win.tue.nl  Mon Jun  5 06:54:20 2000
Return-Path: <stijn@pcwin002.win.tue.nl>
Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72])
	by hub.freebsd.org (Postfix) with ESMTP id CBDFB37B5FB
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Jun 2000 06:54:08 -0700 (PDT)
	(envelope-from stijn@pcwin002.win.tue.nl)
Received: (from stijn@localhost)
	by pcwin002.win.tue.nl (8.9.3/8.9.3) id PAA13714;
	Mon, 5 Jun 2000 15:55:06 +0200 (CEST)
	(envelope-from stijn)
Message-Id: <200006051355.PAA13714@pcwin002.win.tue.nl>
Date: Mon, 5 Jun 2000 15:55:06 +0200 (CEST)
From: stijn@win.tue.nl
Sender: stijn@pcwin002.win.tue.nl
Reply-To: stijn@win.tue.nl
To: FreeBSD-gnats-submit@freebsd.org
Subject: pkg_version -c doesn't honor -l (limit status) flag
X-Send-Pr-Version: 3.2

>Number:         19019
>Category:       bin
>Synopsis:       pkg_version -c doesn't honor -l (limit status) flag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bmah
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 05 07:00:01 PDT 2000
>Closed-Date:    Thu Oct 19 23:00:35 PDT 2000
>Last-Modified:  Thu Oct 19 23:01:41 PDT 2000
>Originator:     Stijn Hoop
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Eindhoven Technical University
>Environment:

FreeBSD 5.0-CURRENT as of 22 May 2000

>Description:

pkg_version(1) doesn't honor the -l flag if given the -c flag. The command

pkg_version -c

is used to show commands to update packages on the system to the latest
version. The -l flag is used (according to the manpage) to limit the output
of pkg_version to packages older than the index, newer than the index
or at the same version.

However, this functionality cannot be combined, and pkg_version -c will
only work if an overview of newer packages is requested (-l '<').

>How-To-Repeat:

I expect

pkg_version -c -l '='

to produce a list of instructions about how to reinstall all current packages,
however this doesn't produce any output.

>Fix:

Here is a simple patch that defaults to the old behavior but does
respect the -l flag in combination with the -c flag (if -l is listed
after the -c on the command line).

--- /usr/sbin/pkg_version	Mon May 22 16:26:13 2000
+++ pkg_version	Mon Jun  5 13:36:38 2000
@@ -141,6 +141,7 @@
 }
 if ($opt_c) {
     $ShowCommandsFlag = $opt_c;
+    $LimitFlag = "<?";
 }
 if ($opt_d) {
     $DebugFlag = $opt_d;
@@ -239,7 +240,6 @@
 	    $rc = &CompareVersions($currentVersion, $indexVersion);
 	    
 	    if ($rc == 0) {
-		next if $ShowCommandsFlag;
 		$versionCode = "=";
 		$Comment = "up-to-date";
 	    }
@@ -248,7 +248,6 @@
 		$Comment = "needs updating (index has $indexVersion)"
 	    }
 	    elsif ($rc > 0) {
-		next if $ShowCommandsFlag;
 		$versionCode = ">";
 		$Comment = "succeeds index (index has $indexVersion)";
 	    }


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->billf 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Aug 7 06:46:05 PDT 2000 
Responsible-Changed-Why:  
Over to the maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19019 
State-Changed-From-To: open->closed 
State-Changed-By: bmah 
State-Changed-When: Thu Oct 19 23:00:35 PDT 2000 
State-Changed-Why:  
Committed, with the addition of a comment.  Thanks! 


Responsible-Changed-From-To: billf->bmah 
Responsible-Changed-By: bmah 
Responsible-Changed-When: Thu Oct 19 23:00:35 PDT 2000 
Responsible-Changed-Why:  
MAINTAINER changed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19019 
>Unformatted:
