Date: Sun, 29 Aug 1999 22:09:48 +0200 From: Neil Blakey-Milner <nbm@mithrandr.moria.org> To: FreeBSD Documentation Project <doc@FreeBSD.org> Subject: A new way to determine LANGCODE Message-ID: <19990829220948.A52645@mithrandr.moria.org>
next in thread | raw e-mail | index | archive | help
Hi, Just a quickie - We can use: .if !defined(LANGCODE) LANGCODE:= ${.CURDIR} .for _ in 1 2 3 4 5 .if !(${LANGCODE:H:T} == "doc") LANGCODE:= ${LANGCODE:H} .endif .endfor LANGCODE:= ${LANGCODE:T} .endif Instead of: LANGCODE:= ${.CURDIR} .for _ in 1 2 LANGCODE:= ${LANGCODE:H} .endfor LANGCODE:= ${LANGCODE:T} To allow for depths besides two. It works fine, except in the case of being in "doc/" itself, where it returns ".", and that it relies on the top-level directory being called "doc". It uses a maximum of 5 levels, which is easily adjusted. We also hint that if the user sets LANGCODE on the command line, we respect it, but we don't in the original. Neil -- Neil Blakey-Milner nbm@rucus.ru.ac.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990829220948.A52645>