Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Feb 1998 12:57:01 +0100 (CET)
From:      Mikael Karpberg <karpen@ocean.campus.luth.se>
To:        asami@FreeBSD.ORG (Satoshi Asami)
Cc:        obrien@NUXI.com, chuckr@glue.umd.edu, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-ports@FreeBSD.ORG
Subject:   Re: cvs commit: ports/print/c2ps Makefile
Message-ID:  <199802281157.MAA04516@ocean.campus.luth.se>
In-Reply-To: <199802280210.SAA19632@vader.cs.berkeley.edu> from Satoshi Asami at "Feb 27, 98 06:10:54 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
According to Satoshi Asami:
>  * > print/a2ps-letter/Makefile:
>  * > ===
>  * >  :
>  * > .if defined(PAPERSIZE) && ${PAPERSIZE} != letter
>  * > BROKEN=	This port is for Letter-sized printerheads.  Go to ${PORTSDIR}/print/a2ps-a4 for A4 paper size.
>  * > .endif
>  * > ===
>  * 
>  * No need to make it broken.  All (most?) of the printing ports already
>  * have a default, but it is easily overridable.
> 
> This pertains to the second part of my message, about being able to
> type "make PAPERSIZE=a4" from ports/print and let it DTRT.  Sort of a
> "safety belt" for people used to the current framework.

Eeew... This seems awfully akward to me. PLEASE don't split ports into
two dirs. As (I think) Chuck pointed out... if people download just one port
it will break since they will not have the other makefile.

Why not just leave it as one port, and generate two packages called
XXX-a4.tgz and XXX-letter.tgz from it? Or...

Even better...
Make it have a little cooler package install file that simply does the right
thing by installing one of it's two binaries depending on PAPERSIZE, or if
not set, just as the user a question.

But as a question... Are there really ports that are sucky enough not to be
able to generate both formats from one binary? Those would be a problem.
If it's just a matter of getting a default value for the runtime when the
user doesn't have the env variable PAPERSIZE set, just make all ports
that use it depend on one papersize_default "port", which simply querries the
user for his prefered default format and writes that to a file like
/usr/local/etc/papersize_default and so all ports can just do something like:

 check_options();
 if (papersize == NULL && (papersize = getenv(PAPERSIZE)) == NULL)
    papersize = get_file_as_string("/usr/local/etc/papersize_default");
 if (papersize == NULL)
    papersize = "A4";

That last '= "A4"' doesn't really matter what it is. It should "never" happen.
That would save us lots of work, just to have a program start with another
default value, and generally be much nicer, IMHO.

Ok, so having a file for the default paper format, and such details should
probably be made a little more generic so the fil can hold more then one
setting. But the same "port" could ask all the questions and write the file,
unless it existed. Which would mean that the portsbuilder could just have
such a file, and their automatic thingies wouldn't fall over.

Hmm... Just my $.02

  /Mikael



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802281157.MAA04516>