From owner-freebsd-ports@FreeBSD.ORG Sat Apr 10 21:30:46 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543551065673 for ; Sat, 10 Apr 2010 21:30:46 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 0C8C48FC0C for ; Sat, 10 Apr 2010 21:30:44 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so1501913qwi.7 for ; Sat, 10 Apr 2010 14:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9STAoogf2qH8Q2XjuEwVokBujy3y4K4HrrSKJycP7Vs=; b=D0jDGfXM3ACxuNiAKzGa8W22317iOpOt2JQPCOBSuiGF7rtQLDuVcjZHkAyLtgImUL 7wigDSHpXZTlPJWPRjE4f3dfIvYXfkauxDXgsPDLAjtv2JGK+Q9PmGWQgIWkf0S3VPRn zAe6NBLR+EJJGQxLTH9o2Y0XsHGNPKwUgtYJ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=vkqUZdyl2eFtnCLuT5LKjOA7rafx0bZwoFmv3rFUnAMs3hqy+CmQPSM4usY3VaIUQK 50IOYcbJIUU8ARwlHQe1joDEjL85z1BVkTnCVGGpimX0vZ1KKo8v77ZCUxUnwsuoCzcY +CGyRtysKpJIjz0z2VIqj4bTneE0RbpJfDm/s= MIME-Version: 1.0 Received: by 10.229.28.85 with HTTP; Sat, 10 Apr 2010 14:30:43 -0700 (PDT) In-Reply-To: <4BC0607D.9060402@bsdforen.de> References: <4BC04503.4000808@bsdforen.de> <4BC0568E.6000008@bsdforen.de> <4BC0607D.9060402@bsdforen.de> Date: Sat, 10 Apr 2010 14:30:43 -0700 Received: by 10.229.128.82 with SMTP id j18mr3006097qcs.61.1270935043765; Sat, 10 Apr 2010 14:30:43 -0700 (PDT) Message-ID: From: Garrett Cooper To: Dominic Fandrey Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-ports@freebsd.org Subject: Re: Trivial PR, fix package-noinstall X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2010 21:30:46 -0000 On Sat, Apr 10, 2010 at 4:26 AM, Dominic Fandrey wro= te: > On 10/04/2010 12:49, Garrett Cooper wrote: >> On Sat, Apr 10, 2010 at 3:44 AM, Dominic Fandrey = wrote: >>> On 10/04/2010 12:18, Garrett Cooper wrote: >>>> On Sat, Apr 10, 2010 at 2:29 AM, Dominic Fandrey wrote: >>>>> This morning I took a look at my outstanding PRs. There are >>>>> is a ports PR I consider old and trivial: >>>>> >>>>> This one fixes a bug in the package-noinstall target. wxs told >>>>> me that he prefers my proposed fix over his own: >>>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/144164 >>>> >>>> This suggested fix completely breaks pkg_creates operation because it >>>> does a chdir(2) prior to package creation (from >>>> .../usr.sbin/pkg_install/create/perform.c:555): >>>> >>>> =A0 =A0 if (chdir(log_dir) =3D=3D FAIL) { >>>> =A0 =A0 =A0 =A0 warnx("can't change directory to '%s'!", log_dir); >>>> =A0 =A0 =A0 =A0 return FALSE; >>>> =A0 =A0 } >>> >>> I don't see what appears to be the problem. The fix is tested, >>> there is no chdiring and pkg_create is not modified in any way. >>> >>> All it does is change the parameters pkg_create is called with. >> >> =A0 =A0 Have you tested in the following cases: >> >> 1. With the pkg_install scripts. >> 2. Without the pkg_install scripts. >> >> =A0 =A0 If not, then you need to do that before asking for someone to >> commit your code :). > > The do-package code is used by the package and the package-noinstall > targets. > > package-noinstall is called by package-recursive on ALL-DEPENDS. > I.e. it is only used on completely installed packages, just what > "pkg_create -b" was made for. > > The regular package target is always run after install (search for > "Main logic" in bsd.port.mk). So do-package is only called after > install has completed, hence the code can, in every case, rely on > logdir containing all required data. Ok, interesting. If you look at another spot in bsd.port.mk, there's another area where +INSTALL and friends are installed: fake-pkg: # ... if [ -f ${PKGINSTALL} ]; then \ ${CP} ${PKGINSTALL} ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \ fi; \ if [ -f ${PKGDEINSTALL} ]; then \ ${CP} ${PKGDEINSTALL} ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \ fi; \ if [ -f ${PKGREQ} ]; then \ ${CP} ${PKGREQ} ${PKG_DBDIR}/${PKGNAME}/+REQUIRE; \ if [ -f ${PKGMESSAGE} ]; then \ ${CP} ${PKGMESSAGE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \ fi; \ # ... So if I don't define NO_PKG_REGISTER and I define FORCE_PKG_REGISTER, then this logic will be executed. This change does need to be tested for the make package-noinstall case with pkg-install, pkg-deinstall, etc being present and not being present [in their .in files form and non-.in files form]. Otherwise this is going to potentially introduce a regression into bsd.port.mk. Thanks, -Garrett