From owner-freebsd-stable@FreeBSD.ORG Sun Feb 12 14:51:59 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69DCE16A420 for ; Sun, 12 Feb 2006 14:51:59 +0000 (GMT) (envelope-from sebsta@t-online.de) Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.com [194.25.134.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB77143D45 for ; Sun, 12 Feb 2006 14:51:58 +0000 (GMT) (envelope-from sebsta@t-online.de) Received: from fwd33.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1F8IZx-00071s-06; Sun, 12 Feb 2006 15:51:57 +0100 Received: from daemon.lokal.netz (r1rQ1eZpweNR6RGgZmMq4KNNQ1uxfznzpifSdfpDF-6AhsNbU+2jrA@[84.130.226.26]) by fwd33.sul.t-online.de with esmtp id 1F8IZq-1st9xA0; Sun, 12 Feb 2006 15:51:50 +0100 Date: Sun, 12 Feb 2006 15:51:50 +0100 From: Sebastian Stach To: freebsd-stable@freebsd.org Message-ID: <20060212145150.GB40333@sebsta.dialin.t-online.de> Mail-Followup-To: Sebastian Stach , freebsd-stable@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="H1spWtNR+x+ondvy" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-ID: r1rQ1eZpweNR6RGgZmMq4KNNQ1uxfznzpifSdfpDF-6AhsNbU+2jrA X-TOI-MSGID: 2bba6951-4db6-49d5-8b59-db30445e43b1 Subject: problem with pkg_version X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2006 14:51:59 -0000 --H1spWtNR+x+ondvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline When using pkg_version with the -o argument to print the origin instead of the package name it doesn't work correct. # pkg_version -o (output stripped) x11/xorg = x11/xorg = x11/xorg = (output stripped) The output should be: # pkg_version -o (output stripped) x11/xorg = x11/xorg-clients = x11/xorg-documents = (output stripped) Looking at the code in "/usr/src/usr.sbin/pkg_install/version/perform.c" in function "show_version" pkg_version removes everything after the last "-" from the origin. if (ShowOrigin != FALSE) strlcpy(tmp, plist.origin, PATH_MAX); else strlcpy(tmp, plist.name, PATH_MAX); if (!Verbose) { if ((ch = strrchr(tmp, '-')) != NULL) ch[0] = '\0'; } I think this shouldn't be done in the "ShowOrigin" case. The attached patch fixed it for me. --H1spWtNR+x+ondvy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-pkg_version --- usr.sbin/pkg_install/version/perform.c.orig Sun Feb 12 14:43:48 2006 +++ usr.sbin/pkg_install/version/perform.c Sun Feb 12 14:51:59 2006 @@ -261,11 +261,12 @@ return; if (ShowOrigin != FALSE) strlcpy(tmp, plist.origin, PATH_MAX); - else + else { strlcpy(tmp, plist.name, PATH_MAX); - if (!Verbose) { - if ((ch = strrchr(tmp, '-')) != NULL) - ch[0] = '\0'; + if (!Verbose) { + if ((ch = strrchr(tmp, '-')) != NULL) + ch[0] = '\0'; + } } if (latest == NULL) { if (source == NULL && OUTPUT('!')) { --H1spWtNR+x+ondvy--