From owner-svn-src-head@FreeBSD.ORG Fri Dec 21 20:21:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92749A4A; Fri, 21 Dec 2012 20:21:57 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 514DD8FC12; Fri, 21 Dec 2012 20:21:56 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.16]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id qBLKLt71025043 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 21 Dec 2012 14:21:55 -0600 Received: from [10.0.0.102] (10.14.152.61) by smtp.fisglobal.com (10.132.206.16) with Microsoft SMTP Server (TLS) id 14.2.309.2; Fri, 21 Dec 2012 14:21:54 -0600 Subject: Re: svn commit: r244553 - head/usr.sbin/pkg MIME-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset="us-ascii" From: Devin Teske In-Reply-To: <201212212001.qBLK1DCQ027189@svn.freebsd.org> Date: Fri, 21 Dec 2012 12:21:52 -0800 Content-Transfer-Encoding: quoted-printable Message-ID: References: <201212212001.qBLK1DCQ027189@svn.freebsd.org> To: Matthew Seaman X-Mailer: Apple Mail (2.1283) X-Originating-IP: [10.14.152.61] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327, 1.0.431, 0.0.0000 definitions=2012-12-21_06:2012-12-21,2012-12-21,1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2012 20:21:57 -0000 Sweet! This will simplify things on the bsdconfig side for the pkgng module I'm wr= iting. --=20 Devin On Dec 21, 2012, at 12:01 PM, Matthew Seaman wrote: > Author: matthew (ports committer) > Date: Fri Dec 21 20:01:13 2012 > New Revision: 244553 > URL: http://svnweb.freebsd.org/changeset/base/244553 >=20 > Log: > In preparation for making 'pkg -n' the one true method of determining > whether a system has been configured to use pkgng, cause /usr/sbin/pkg > recognise a -n option and exit with a failure code when the pkg port > is not installed. >=20 > Approved by: bapt > MFC after: 2 weeks >=20 > Modified: > head/usr.sbin/pkg/pkg.c >=20 > Modified: head/usr.sbin/pkg/pkg.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg/pkg.c Fri Dec 21 19:36:08 2012 (r244552) > +++ head/usr.sbin/pkg/pkg.c Fri Dec 21 20:01:13 2012 (r244553) > @@ -452,6 +452,16 @@ main(__unused int argc, char *argv[]) > getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); >=20 > if (access(pkgpath, X_OK) =3D=3D -1) { > + /*=20 > + * To allow 'pkg -n' to be used as a reliable test for whether > + * a system is configured to use pkg, don't bootstrap pkg > + * when that argument is given as argv[1]. > + */ > + if ( argv[1] !=3D NULL && strcmp(argv[1], "-n") =3D=3D 0) { > + printf("%s", "pkg is not installed\n"); > + exit(EXIT_FAILURE); > + } > + > /* > * Do not ask for confirmation if either of stdin or stdout is > * not tty. Check the environment to see if user has answer _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.