Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jun 2000 15:55:06 +0200 (CEST)
From:      stijn@win.tue.nl
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/19019: pkg_version -c doesn't honor -l (limit status) flag
Message-ID:  <200006051355.PAA13714@pcwin002.win.tue.nl>

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

>Number:         19019
>Category:       bin
>Synopsis:       pkg_version -c doesn't honor -l (limit status) flag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 05 07:00:01 PDT 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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