From owner-freebsd-ports@FreeBSD.ORG Thu Oct 30 00:44:39 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62DE180C for ; Thu, 30 Oct 2014 00:44:39 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E95DC1F0 for ; Thu, 30 Oct 2014 00:44:38 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id n3so2901760wiv.0 for ; Wed, 29 Oct 2014 17:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=D9Sg/zH5oI9fdrbIVzSbeWeButF+zmqOT15KRd8NedE=; b=g8F4zkjBMLnmo6ww0ACB/OipnW/ZhUzbxvSikyifWlM6AoDWCxAqeXbHSlOmHYDWEm M0zdBFFxA8WIrJ16FJylUxiYZXAYgusKSU9DibgvwBB6/FbkAg9hA0C5ZZXcDoFD+D3H rrGlz71ljkhpdClPNdf/2nIDF2hApEvbJ0UU8Cww/DEy73ED9EFIDWKl4EV8kSKVsjpT TiII1GpGzc6EvpNDeYuXj7y0mIX+cEJIvVTEXa0/WLkU2VmW9yf6vMToSlkBidLC5YK6 t5pyV0t+sBWgNi43H6YzpB9DhS6/oet6WA2zYapAtq9U8SRTvdkxfr3uEqwn1WlR3S++ rILQ== X-Received: by 10.180.86.38 with SMTP id m6mr16179585wiz.65.1414629877201; Wed, 29 Oct 2014 17:44:37 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id el4sm20434220wid.11.2014.10.29.17.44.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Oct 2014 17:44:36 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 30 Oct 2014 01:44:34 +0100 From: Baptiste Daroussin To: Nick Rogers Subject: Re: pkgng "requirements" script equivalent Message-ID: <20141030004434.GS11033@ivaldir.etoilebsd.net> References: <20141029200212.GE11033@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jo46wx5DSA4a/gWG" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "freebsd-ports@freebsd.org" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 00:44:39 -0000 --jo46wx5DSA4a/gWG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 29, 2014 at 01:43:27PM -0700, Nick Rogers wrote: > On Wed, Oct 29, 2014 at 1:02 PM, Baptiste Daroussin > wrote: >=20 > > On Wed, Oct 29, 2014 at 12:44:21PM -0700, Nick Rogers wrote: > > > Hello, > > > > > > I am in the process of upgrading some proprietary software that has > > always > > > been deployed via a "custom" package created by the old pkg_create. So > > far > > > I've been able to use "pkg create" to achieve what I want, but it see= ms > > > that the "requirements" script is no longer a part of the new pkg > > > framework. This used to be a script that you could include with a pac= kage > > > that could halt the pkg add or remove process by returning a non-zero > > exit > > > code from the script. I've been using it with the old pkg tools as a = way > > to > > > enforce some proprietary requirements logic that goes beyond requiring > > > certain pkg dependencies, architecture, etc. One example is to make s= ure > > a > > > specific custom kernel is running by analyzing uname output. > > > > > > I am wondering if anyone has a suggestion as to how to interrupt the = pkg > > > add process in a similar way. It looks like the "requirements" script= has > > > been removed entirely, and from what I can tell a failure in the > > > pre-install script does not halt pkg add. > > > > What is the requirement script you are speaking about? I never heard of= it? > > >=20 > man pkg_create(1) > https://www.freebsd.org/cgi/man.cgi?query=3Dpkg_create&apropos=3D0&sektio= n=3D1&manpath=3DFreeBSD+8.3-RELEASE&arch=3Ddefault&format=3Dhtml > -r rscript > Set rscript to be the ``requirements'' procedure for the package. > This can be any executable program (or shell script). It will be > invoked automatically at installation/deinstallation time to > determine whether or not installation/deinstallation should pro- > ceed. To differentiate between installation and deinstallation, > the keywords INSTALL and DEINSTALL are passed respectively, along > with the package's name. >=20 >=20 > > Explain me in detail the way you were producing the package with > > pkg_create and > > I'll explain you how to do the same with pkg(8). > > >=20 > I was running pkg_create with the following arguments: >=20 > pkg_create -f plistfile -c -'comment' -d -description' -v -P 'list of > dependency packages' -v -r requirements_script_file -i > pre-install_script_file -I post-install-script_file -k > pre-deinstall_script_file -K post-deinstall_script_file -s > /space/build/trunk -D displayfile -p /space/rxg -o category/name pkg.tbz >=20 > For the most part I've figured out the appropriate +MANIFEST file and > manifest directory contents, except for the "requirements procedure" scri= pt. >=20 Ok requirements are gone, and you have a perfectly justified use case, I wi= ll readd such functionnality as soon as I can when dealing with binary upgrade= it is basically a wrong idea to fail the procedure because a script fails so I= need to add the notion of trigger and run the requirements prior the procedure. Might be complicated to add but it is for sure something we need. I cannot promise anything for pkg 1.4 which is in freeze time but I'll try = to see what I can do. regards, Bapt --jo46wx5DSA4a/gWG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRRifIACgkQ8kTtMUmk6ExtYQCfRPaJGnBVyt89IXjLL4Qp4YkW QLQAn2ZP/mx9RL6MnyE6ZO9x512Hx+Hz =x5qm -----END PGP SIGNATURE----- --jo46wx5DSA4a/gWG--