From nobody@FreeBSD.org  Sat Jan  5 18:06:59 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7172016A417
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Jan 2008 18:06:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 82AB413C457
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Jan 2008 18:06:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m05I62cj006021
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 5 Jan 2008 18:06:02 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m05I62Xb006020;
	Sat, 5 Jan 2008 18:06:02 GMT
	(envelope-from nobody)
Message-Id: <200801051806.m05I62Xb006020@www.freebsd.org>
Date: Sat, 5 Jan 2008 18:06:02 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] pkg_add(1) doesn't keep dependent packages with -K flag
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         119368
>Category:       bin
>Synopsis:       [PATCH] pkg_add(1) doesn't keep dependent packages with -K flag
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    krion
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 05 18:10:01 UTC 2008
>Closed-Date:    Thu Jun 12 15:22:22 UTC 2008
>Last-Modified:  Sun Feb 03 22:27:34 UTC 2013
>Originator:     Garrett Cooper
>Release:        Affects FreeBSD 4.x~5.x+
>Organization:
n/a
>Environment:
n/a
>Description:
pkg_add(1) in its current form doesn't keep 

The 'bug' is a usage bug, and is solved using the following patch:

<http://students.washington.edu/youshi10/posted/pkg_add_keep_flag_prop.patch>.

The patch was originally requested by Maslan [1], and due to lack of feedback a PR wasn't filed.

This trivial patch has been tested and is functionally correct, as noted by Jason C Wells [2].

Please note that the link above will only be available until March~April 2008 as I have graduated and my student account at the University of Washington will expire then.

1. hackers@ discussion thread:
<http://lists.freebsd.org/pipermail/freebsd-hackers/2007-November/022133.html>.

2. ports@ discussion thread: <http://lists.freebsd.org/pipermail/freebsd-ports/2008-January/046019.html>.
>How-To-Repeat:
n/a
>Fix:
See link/enclosed patch noted.

Patch attached with submission follows:

--- add/perform.c	2007-11-09 18:46:02.000000000 -0800
+++ add/perform.c.old	2007-11-09 18:44:10.000000000 -0800
@@ -343,7 +343,7 @@
 			if (!Force)
 			    ++code;
 		    }
-		    else if (vsystem("(pwd; /bin/cat +CONTENTS) | %s %s %s %s -S", PkgAddCmd, Verbose ? "-v" : "", PrefixRecursive ? prefixArg : "", KeepPackage ? "-K" : "")) {
+		    else if (vsystem("(pwd; /bin/cat +CONTENTS) | %s %s %s -S", PkgAddCmd, Verbose ? "-v" : "", PrefixRecursive ? prefixArg : "")) {
 			warnx("pkg_add of dependency '%s' failed%s",
 				p->name, Force ? " (proceeding anyway)" : "!");
 			if (!Force)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->krion 
Responsible-Changed-By: remko 
Responsible-Changed-When: Mon Jan 7 17:28:23 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119368 
State-Changed-From-To: open->analyzed 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 10 02:29:15 UTC 2008 
State-Changed-Why:  
Replies from the mailing list indicate that this patch is effective. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119368 

From: "Garrett Cooper" <yanefbsd@gmail.com>
To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org
Cc:  
Subject: Re: bin/119368: [PATCH] pkg_add(1) doesn't keep dependent packages with -K flag
Date: Mon, 9 Jun 2008 19:27:48 -0700

 The link from an individual that validated the patch can be found
 here: http://lists.freebsd.org/pipermail/freebsd-ports/2008-January/046119.html
 
 HTH,
 -Garrett
State-Changed-From-To: analyzed->closed 
State-Changed-By: flz 
State-Changed-When: Thu Jun 12 15:22:22 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119368 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/119368: commit references a PR
Date: Thu, 12 Jun 2008 15:21:29 +0000 (UTC)

 flz         2008-06-12 15:21:13 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.sbin/pkg_install/add perform.c 
     usr.sbin/pkg_install/lib lib.h 
     usr.sbin/pkg_install/updating main.c 
   Log:
   SVN rev 179760 on 2008-06-12 15:21:13Z by flz
   
   - add: Keep dependent packages too if -K is specified.
   - updating: terminating '\n' is not part of the package origin.
   - bump PKG_INSTALL_VERSION to 20080612.
   
   PR:             bin/119368 [1], bin/124459 [2]
   Submitted by:   gcooper [1], Beat Gatzi <beat@chruetertee.ch> [2]
   MFC after:      3 days
   
   Revision  Changes    Path
   1.85      +1 -1      src/usr.sbin/pkg_install/add/perform.c
   1.68      +1 -1      src/usr.sbin/pkg_install/lib/lib.h
   1.4       +2 -0      src/usr.sbin/pkg_install/updating/main.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
