From owner-freebsd-ports Mon Aug 24 23:40:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA09581 for freebsd-ports-outgoing; Mon, 24 Aug 1998 23:40:51 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from vader.cs.berkeley.edu (vader.CS.Berkeley.EDU [128.32.38.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA09576 for ; Mon, 24 Aug 1998 23:40:50 -0700 (PDT) (envelope-from asami@vader.cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca10-63.ix.netcom.com [205.186.214.63]) by vader.cs.berkeley.edu (8.8.7/8.7.3) with ESMTP id XAA21221; Mon, 24 Aug 1998 23:39:58 -0700 (PDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.8.8/8.6.9) id XAA00876; Mon, 24 Aug 1998 23:39:55 -0700 (PDT) Date: Mon, 24 Aug 1998 23:39:55 -0700 (PDT) Message-Id: <199808250639.XAA00876@silvia.hip.berkeley.edu> To: ac199@hwcn.org CC: ports@FreeBSD.ORG In-reply-to: (message from Tim Vanderhoek on Mon, 24 Aug 1998 22:47:59 -0400 (EDT)) Subject: Re: cvs commit: ports/x11-wm/afterstep/pkg PLIST (more bsd.port.mk mods) From: asami@FreeBSD.ORG (Satoshi Asami) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * Hehe. You _did_ ask for an MLINKS variable. :) I should be careful what I wish for.... * Seriously, when I started I thought it would be just a simple * shell script tacked onto generate-plist: and man-compress:. I * hadn't intended to write some 94 lines. :( Really. This isn't the stuff for makefiles. Looking at bsd.man.mk, they seem to have a much easier time dealing with it. Do you know why it is? * I hate reading the ones that use bsd.man.mk. This was an attempt * at an improvement. :-) I see. * +__fl!= ${ECHO} '${MLINKS:S/ / /g}' | \ * + ${SED} -e 's/\([^ ]*\) *\-\> *\([^ ]*\)/\1/g' * +__tl!= ${ECHO} '${MLINKS:S/ / /g}' | \ * + ${SED} -e 's/\([^ ]*\) *\-\> *\([^ ]*\)/\2/g' * * Those are the only two lines that require it. It _should_ work * fine if you just delete the arrows or make them optional, * although that will make an already minimal amount of error * checking even more minimal. I guess it's ok then, although I'm still a little concerned about introducing a variable with the same name and different syntaxes. * All my new variables do seem to slow things down a little, * though. :-( Maybe we can .if them out like you suggested. * generate-plist: * [...] * ${SED} ${_sedsubplist} ${PLIST} >> ${TMPPLIST} * @${ECHO} @cwd / >> ${TMPPLIST} * @for link in ${_HMLINKS}; do \ Ok, fixed. This is kinda yucky though. What's going to happen if the user uses "pkg_add -p"? I think we should always use relative symlinks (if SYMMLINKS is set) and flag an error if the sections are different. (Of course we can still use relative symlinks for different sections but with possibilies of MAN?PREFIX putting one section in a different root than others, it's not worth the effort.) Or are there some packages out there that require linking different section man pages? (Eek....) * I'll give you some diffs to make some current ports use MLINKS * for testing. How many do you want? Well, I can set up my own test cases. (Testing....) Ok, there are two problems. One, the for loop in compress-man is in the wrong side of an endif. Should look like this (beware of cut & paste): === : .for manpage in ${_MANPAGES} @${GZIP_CMD} ${manpage} .endfor .endif @for link in ${_HMLINKS}; do \ cnt=$$(($$cnt + 1)); \ ${LN} $${link} ${_WORD:S/SENT/${_FMLINKS}/:S/NUMB/\$cnt/} \ ${_WORD:S/SENT/${_TMLINKS}/:S/NUMB/\$cnt/}; \ done .endif : === Another is that the direction of the link is backwards. Ok, it's the same is bsd.man.mk's MLINKS, but then we shouldn't have to write "to.1 -> from.1". I changed the sed lines to === __fl!= ${ECHO} '${MLINKS:S/ / /g}' | \ ${SED} -e 's/\([^ ]*\) *\<\- *\([^ ]*\)/\1/g' __tl!= ${ECHO} '${MLINKS:S/ / /g}' | \ ${SED} -e 's/\([^ ]*\) *\<\- *\([^ ]*\)/\2/g' === to remind ourselves of the fact. Another is that if one forgets the "<-", it's going to generate a funny-looking TMPPLIST. "MLINKS= oneko.6 koneko.6" causes this: === ## make reinstall ===> Installing for oneko-1.2 ===> oneko-1.2 depends on shared library: X11\.6 - found /usr/bin/install -c -s oneko /usr/X11R6/bin/oneko install in . done rm -f /usr/X11R6/man/man6/oneko.6* /usr/bin/install -c -m 0444 oneko.man /usr/X11R6/man/man6/oneko.6 gzip -n /usr/X11R6/man/man6/oneko.6 install.man in . done ln: /usr/X11R6/man//man6/oneko.6.gz: No such file or directory *** Error code 1 Stop. *** Error code 1 Stop. *** Error code 1 Stop. *** Error code 1 Stop. ## make reinstall SYMMLINKS=t ===> Installing for oneko-1.2 ===> oneko-1.2 depends on shared library: X11\.6 - found /usr/bin/install -c -s oneko /usr/X11R6/bin/oneko install in . done rm -f /usr/X11R6/man/man6/oneko.6* /usr/bin/install -c -m 0444 oneko.man /usr/X11R6/man/man6/oneko.6 gzip -n /usr/X11R6/man/man6/oneko.6 install.man in . done ===> Registering installation for oneko-1.2 ## cat work/.PLIST.mktmp man/man6/oneko.6.gz bin/oneko @cwd / /usr/X11R6/man//man6/oneko.6.gz /usr/X11R6/man//man6/koneko.6.gz ## ls -lg /usr/X11R6/man/man6/*oneko* 0 lrwxrwxrwx 1 root wheel 32 Aug 24 23:36 /usr/X11R6/man/man6/koneko.6.gz@ -> /usr/X11R6/man//man6/koneko.6.gz 0 lrwxrwxrwx 1 root wheel 31 Aug 24 23:36 /usr/X11R6/man/man6/oneko.6.gz@ -> /usr/X11R6/man//man6/oneko.6.gz ## === Ok, you said there's no error checking. :) * Okay, since as you point-out, this isn't entirely obvious to the * casual reader, I'll make some comments on how it's _supposed_ to * work... Hopefully this'll encourage a couple lurkers on -ports * to offer their opinions on whether or not this is worthwhile. :) : * How's that? Thanks, but still too hard for me. My head is spinning. ;) Satoshi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message