From nobody@FreeBSD.org  Fri Apr 24 19:48:57 2009
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 F41D9106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Apr 2009 19:48:56 +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 E33968FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Apr 2009 19:48:56 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n3OJmuKl051616
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 24 Apr 2009 19:48:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n3OJmuPk051615;
	Fri, 24 Apr 2009 19:48:56 GMT
	(envelope-from nobody)
Message-Id: <200904241948.n3OJmuPk051615@www.freebsd.org>
Date: Fri, 24 Apr 2009 19:48:56 GMT
From: Randy Belk <randy.belk@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pkg_create -n gives an error
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         133979
>Category:       bin
>Synopsis:       pkg_create(1): pkg_create -n gives an error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 24 19:50:03 UTC 2009
>Closed-Date:    Sat Apr 24 11:30:36 UTC 2010
>Last-Modified:  Sat Apr 24 11:30:36 UTC 2010
>Originator:     Randy Belk
>Release:        7.1-RELEASE-p4
>Organization:
N/A
>Environment:
FreeBSD umc132050.umsmed.edu 7.1-RELEASE-p4 FreeBSD 7.1-RELEASE-p4 #0: Sun Mar 22 12:35:36 UTC 2009     root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Using the -n (noclobber option) pkg_create gives an error on 7.1-RELEASE-p4. After looking at the source of pkg_create, I found that the option 'n' is not coded as an option in the source. The noclobber mode '-n' is mentioned in the manual page source and it is also displayed as an option in the pkg_create usage help.
>How-To-Repeat:
chroot# mkdir /usr/ports/packages/All
chroot# cd /usr/ports/packages/All
chroot# pkg_info | awk '{print $1}' | xargs -n1 pkg_create -Rvnb
>Fix:
Do not use the -n option

chroot# mkdir /usr/ports/packages/All
chroot# cd /usr/ports/packages/All
chroot# pkg_info | awk '{print $1}' | xargs -n1 pkg_create -Rvb

It will rewrite some dependencies multiple times.

>Release-Note:
>Audit-Trail:

From: Efstratios Karatzas <gpf.kira@gmail.com>
To: bug-followup@freebsd.org, randy.belk@gmail.com
Cc:  
Subject: Re: bin/133979: pkg_create(1): pkg_create -n gives an error
Date: Thu, 28 Jan 2010 23:59:16 +0200

 Helloo!
 
 I've done some digging and I think I can provide some feedback.
 The PR originator states that the option "-n" is not coded. This does not
 apply to modern versions of pkg_create.
 
 First of all, take a look at this file: src/usr.sbin/pkg_install/create/main.c
 
 http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/pkg_install/create/main.c?rev=1.36.2.7
 
 You can see that if the "-n" option is supplied, we change the value
 of a global variable
 
 case 'n':
 	    Regenerate = FALSE;
 	    break;
 
 
 Now take a look at this file: src/usr.sbin/pkg_install/create/perform.c
 
 http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/pkg_install/create/perform.c?rev=1.80.2.5
 
 goto function make_dist() and take a look at this:
 
     /*
      * If the package tarball exists already, and we are running in `no
      * clobber' mode, skip this package.
      */
     if (stat(tball, &sb) == 0 && Regenerate == FALSE) {
 	if (Verbose)
 	    printf("Skipping package '%s'.  It already exists.\n", tball);
 	return;
     }
 
 Which does just what the man page says it does.
 Since this behavior cannot be recreated in recent versions, I believe
 the state of
 the PR should change to closed or at least to feedback.
 
 Cheers
 
 -- 
 
 Efstratios "GPF" Karatzas
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Fri Jan 29 02:45:11 UTC 2010 
State-Changed-Why:  
To submitter: does the problem still persist? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133979 
Responsible-Changed-From-To: freebsd-bugs->portmgr 
Responsible-Changed-By: flz 
Responsible-Changed-When: Thu Apr 1 17:20:32 UTC 2010 
Responsible-Changed-Why:  
pkg_install is maintained by portmgr. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133979 
State-Changed-From-To: feedback->closed 
State-Changed-By: flz 
State-Changed-When: Sat Apr 24 11:29:23 UTC 2010 
State-Changed-Why:  
The current version of pkg_create works as advertised.  7.1-RELEASE is 
quite old now, upgrade to 7.3-RELEASE or use pkg_install from ports. 

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