Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 1998 23:39:55 -0700 (PDT)
From:      asami@FreeBSD.ORG (Satoshi Asami)
To:        ac199@hwcn.org
Cc:        ports@FreeBSD.ORG
Subject:   Re: cvs commit: ports/x11-wm/afterstep/pkg PLIST (more bsd.port.mk mods)
Message-ID:  <199808250639.XAA00876@silvia.hip.berkeley.edu>
In-Reply-To: <Pine.BSF.3.96.980824214720.7081A-100000@localhost> (message from Tim Vanderhoek on Mon, 24 Aug 1998 22:47:59 -0400 (EDT))

next in thread | previous in thread | raw e-mail | index | archive | help
 * 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



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