From owner-freebsd-ports@FreeBSD.ORG Thu Jun 24 17:44:06 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 65FEB106567A for ; Thu, 24 Jun 2010 17:44:06 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 199678FC1A for ; Thu, 24 Jun 2010 17:44:05 +0000 (UTC) Received: by gyh20 with SMTP id 20so5882153gyh.13 for ; Thu, 24 Jun 2010 10:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Tg6eouwTOvrnSbFN+LXgoAKprMfIWkzUNPKTSlDZOjk=; b=l1YgZ4cc0NUiyeXU5qGa+Yxdal/edC+iGH12J5xgo7tgdslkl6WAylIzM7jZPj7IVI Xch0F4ZWIetE8Ps23R1PFy1EwJPHN21eo88veWi1iEjMTzyDCHZrH43+aXZhd7NYXiIe RT3x/5sJxMtq/mo/JJLoJFpBL4qS9C/SrEcWg= 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=uhreg5CAFahfMjl66EQJdGhlxgXT3iB6URr4m2vVtfTv3Pxst3vHtlOLrJpijlvRXv NXe5QUYgp29N5P1K9SFUyOaU+voQJF8iVBXd27/Y8/eodvB8sNNQVlftdhJRFPcDrtGa BGkzNnE7X7m2+XY1+nBCjqgLEiDKXMRu2o+0w= MIME-Version: 1.0 Received: by 10.229.181.3 with SMTP id bw3mr5619261qcb.155.1277401444991; Thu, 24 Jun 2010 10:44:04 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Thu, 24 Jun 2010 10:44:04 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Jun 2010 10:44:04 -0700 Message-ID: From: Garrett Cooper To: David DEMELIER Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Freddie Cash , freebsd-ports Subject: Re: New pkg-message[.in] guideline idea 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: Thu, 24 Jun 2010 17:44:06 -0000 On Thu, Jun 24, 2010 at 9:43 AM, David DEMELIER wrote: > 2010/6/24 Freddie Cash : >> On Thu, Jun 24, 2010 at 12:04 AM, David DEMELIER >> wrote: >>> 2010/6/24 Janne Snabb : >>>> On Wed, 23 Jun 2010, David DEMELIER wrote: >>>> >>>>> 2010/6/23 Janne Snabb : >>>>>> >>>>>> I find it completely useless and plainly stupid to edit the >>>>>> pkg-messages of all ports to include lots of equal signs for tty-bas= ed >>>>>> formatting purposes. >>>>> >>>>> We can take a long time to do that (we don't have to do it quickly), >>>>> but it could be useful to standardize it for one reason : >>>>> You will see that it's a message from the port maintainer/submitter >>>>> and not from the program itself! Sometimes configure scripts stage sa= y >>>>> some useless things to the user. >>>> >>>> You obviously did not get my point. >>>> >>>> I fully agree with you that displaying a line of equals signs on >>>> tty based interfaces to make the messages stand out from other crap >>>> when installing ports makes sense, but I STRONGLY oppose to the >>>> idea of putting this visual formatting in the actual message files. >>>> It is just not the right place to put it in. >>>> >>> I see, so maybe in the future you would like some tools that can print >>> the message, like a GTK+ dialog, QT dialog, or an other tool, if it's >>> your point I agree. I don't specially want a equal "=3D=3D" line, I wou= ld >>> just something consistent, why not : nothing ? Yes we can just print >>> the text without any visual characters, and the [future] tool will >>> print the message as it want. >> >> No, what he's saying is: >> =A0- put the logic to print the separators into the appropriate bsd.*.mk= file >> =A0- remove all separators from all pkg-message* files >> >> That way, you can update the separators at any time by editing a >> single file, instead of editing 20,000+ pkg-message files. =A0And, that >> way, future tools can override the separator set in the mk file. >> >> Leave the pkg-message files as unformatted text. =A0Put the formatting >> into the mk file. >> >> Separate content from style. >> > > Yes, that was I said, sorry if you did not understand well :-) The only problem is that pushing all of this logic into bsd.*.mk only solves half the problem: from source installations. It doesn't cover binary installations via pkg_install. I think Doug and Phillip were on the right track with pushing the data into a pkg_install consumable format, but the only problem is that creating additional code that handles one more corner case for @comment will serve to only slow down the plist parser unnecessarily. That's why I was suggesting a scripting infrastructure, like so: pkgmsg() { local message=3D$1 pkgmsg_separator echo "$message" pkgmsg_separator } Example: echo "This is an install message for my awesome new package foo-" > +DISPLAY pkgmsg `cat +DISPLAY` And considering that you almost get the functionality for free via pkg_install (from pkg_create(8)): -D displayfile Display the file (by concatenating it to stdout) after install= ing the package. Useful for things like legal notices on almost-f= ree software, etc. The thing about using a script function like pkgmsg too is that it can be dynamically overwritten by certain groups in order to tailor the messages (or mute output for customer purposes after everything has passed QA if they use pkg_install in a product) to the meet their needs when doing localized installations or deployments as well. So, why not just add the relevant bits as I described? Thanks, -Garrett