Date: Wed, 4 Sep 2002 21:27:44 -0400 From: Tim Vanderhoek <vanderh@ecf.utoronto.ca> To: Kris Kennaway <kris@obsecurity.org> Cc: ports@FreeBSD.org, portmgr@FreeBSD.org Subject: Re: ports/19868 - deleting catpages Message-ID: <20020905012743.GA77608@turquoise> In-Reply-To: <20020901034012.GA9368@xor.obsecurity.org> References: <20020831230149.GA41911@turquoise> <20020901034012.GA9368@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 31, 2002 at 08:40:12PM -0700, Kris Kennaway wrote: > On Sat, Aug 31, 2002 at 07:01:49PM -0400, Tim Vanderhoek wrote: > > The PR ports/19868 is a PR for pkg_delete not deleting catpages. > >=20 > > Once upon a time (say back on July 18, 2000) I had a patch to > > fix this PR. I think my patch may also have fixed a problem where [...]=20 > I don't think there are any immediate plans to remove catpages from > -current (let alone -stable), so it would still be worthwhile to do this. Okay, I pulled the patch from the dust and tested it out again. I've copied my original email and the updated patch below. Can we get this included in the next package-building run and then committed assuming nothing blows-up (I don't expect any blow-ups). Originally there was a problem with my usage of "sed -E", but the -E flag is now used in targets like do-fetch:, so I think now it's okay to add it here. Some older versions of FreeBSD don't have a -E flag in sed. Bug fixing by filibustering. :) Watch-out for the embedded control characters in the patch. =46rom vanderh@ecf.utoronto.ca Tue Jul 18 02:50:18 2000 Date: Tue, 18 Jul 2000 02:50:18 -0400 From: Tim Vanderhoek <vanderh@ecf.utoronto.ca> To: Satoshi Asami <asami@freebsd.org> Subject: Re: ports/19868: modify ports/Mk/bsd.port.mk to remove ALL the ins= =3D tall manpages Message-ID: <20000718025018.A1158@mad> References: <200007121525.LAA40866@baby.int.thehousleys.net> <vqcsnteao9i.f= =3D sf@silvia.hip.berkeley.edu> X-Mailer: Mutt 0.95i In-Reply-To: <vqcsnteao9i.fsf@silvia.hip.berkeley.edu>; from Satoshi Asami = =3D on Wed, Jul 12, 2000 at 05:04:57PM -0700 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=3D3Diso-8859-1 Status: RO On Wed, Jul 12, 2000 at 05:04:57PM -0700, Satoshi Asami wrote: >=3D20 > I'm sure you can fix this "properly" with all your sed-magics. :) Well, for some definition of "properly", anyways. :) It seems I broke NOMANCOMPRESS + MLINKS in r.1.315 of bsd.port.mk. This patch fixes that (it was a one-line braino where I must've forgotten to switch ".gz" to "${MANEXT}" before submitting the patch). I'm a little surpised no-one noticed. NOMANCOMPRESS is probably under-utilised. This has been tested with and without NOMANCOMPRESS, with absolute pathnames in MLINKS, and with MANLANG. For absolute pathnames in MLINKS, it is a nop. For the others, it just deletes the catpage, in both its compressed and uncompressed form. I believe it produces the correct output in each case. Caveat: I've only actually tested it with a single real-life port. I think this should be safe to put into 4.1-release. [... deleted old patch, attached updated patch ...] --- bsd.port.mk.orig Wed Sep 4 19:33:59 2002 +++ bsd.port.mk Wed Sep 4 20:53:40 2002 @@ -305,21 +305,21 @@ # These manpages will be automatically listed in ${PLIST}. Depending # on the setting of NOMANCOMPRESS, the make rules will compress the # manpages for you. # # MAN<sect> - A list of manpages, categorized by section. For # example, if your port has "man/man1/foo.1" and # "man/mann/bar.n", set "MAN1=3Dfoo.1" and "MANN=3Dbar.n". # The available sections chars are "123456789LN". # MLINKS - A list of <source, target> tuples for creating links # for manpages. For example, "MLINKS=3D a.1 b.1 c.3 d.3" -# will do an "ln -sf a.1 b.1" and "ln -sf c.3 and d.3" in +# will do an "ln -sf a.1 b.1" and "ln -sf c.3 d.3" in # appropriate directories. (Use this even if the port # installs its own manpage links so they will show up # correctly in ${PLIST}.) # MANPREFIX - The directory prefix for ${MAN<sect>} and ${MLINKS} # (default: ${PREFIX}). # MAN<sect>PREFIX - If manual pages of some sections install in different # locations than others, use these (default: ${MANPREFIX}). # MANCOMPRESSED - This variable can take values "yes", "no" or # "maybe". "yes" means manpages are installed # compressed; "no" means they are not; "maybe" means @@ -1707,21 +1707,21 @@ __pmlinks!=3D ${ECHO_CMD} '${MLINKS:S/ / /}' | ${AWK} \ '{ if (NF % 2 !=3D 0) { print "broken"; exit; } \ for (i=3D1; i<=3DNF; i++) { \ if ($$i ~ /^-$$/ && i !=3D 1 && i % 2 !=3D 0) \ { $$i =3D $$(i-2); printf " " $$i " "; } \ else if ($$i ~ /^[^ ]+\.[1-9ln][^. ]*$$/ || $$i ~ /^\//) \ printf " " $$i " "; \ else \ { print "broken"; exit; } \ } \ - }' | ${SED} -e 's=08 \([^/ ][^ ]*\.\(.\)[^. ]*\)=08 $${MAN\2PREFIX}/man/= $$$$$$$${__lang}/man\2/\1.gz=08g' -e 's/ /=08/g' -e 's/MANlPREFIX/MANLPREFI= X/g' -e 's/MANnPREFIX/MANNPREFIX/g' + }' | ${SED} -e 's=08 \([^/ ][^ ]*\.\(.\)[^. ]*\)=08 $${MAN\2PREFIX}/man/= $$$$$$$${__lang}/man\2/\1${MANEXT}=08g' -e 's/ /=08/g' -e 's/MANlPREFIX/MAN= LPREFIX/g' -e 's/MANnPREFIX/MANNPREFIX/g' .if ${__pmlinks:Mbroken} =3D=3D "broken" .BEGIN: @${ECHO_CMD} "${PKGNAME}: Unable to parse MLINKS." @${FALSE} .endif _MLINKS=3D ${_MLINKS_PREPEND} .for lang in ${MANLANG} .for ___pmlinks in ${__pmlinks} .for __lang in ${lang} _MLINKS+=3D ${___pmlinks:S/=08/ /g} @@ -3310,31 +3310,34 @@ generate-plist: @${ECHO_MSG} "=3D=3D=3D> Generating temporary packing list" @${MKDIR} `dirname ${TMPPLIST}` @if [ ! -f ${PLIST} -o ! -f ${COMMENT} -o ! -f ${DESCR} ]; then ${ECHO_CM= D} "** Missing package files for ${PKGNAME}."; exit 1; fi @>${TMPPLIST} @for man in ${__MANPAGES}; do \ ${ECHO_CMD} $${man} >> ${TMPPLIST}; \ done .for _PREFIX in ${PREFIX} .if ${_TMLINKS:M${_PREFIX}*}x !=3D x - @for i in ${_TMLINKS:M${_PREFIX}*:S,^${_PREFIX}/,,}; do \ + @for i in ${_TMLINKS:M${_PREFIX}*:S,^${_PREFIX}/,,:S,//,/,g}; do \ ${ECHO_CMD} "$$i" >> ${TMPPLIST}; \ done .endif .if ${_TMLINKS:N${_PREFIX}*}x !=3D x @${ECHO_CMD} @cwd / >> ${TMPPLIST} @for i in ${_TMLINKS:N${_PREFIX}*:S,^/,,}; do \ ${ECHO_CMD} "$$i" >> ${TMPPLIST}; \ done @${ECHO_CMD} '@cwd ${PREFIX}' >> ${TMPPLIST} .endif + @for i in $$(${ECHO} ${__MANPAGES} ${_TMLINKS:M${_PREFIX}*:S,^${_PREFIX}/= ,,:S,//,/,g} ' ' | ${SED} -E -e 's,man([1-9ln])/([^/ ]+) ,cat\1/\2 ,g'); do= \ + ${ECHO} "@unexec rm -f %D/$${i%.gz} %D/$${i%.gz}.gz" >> ${TMPPLIST}; \ + done .if ${XFREE86_HTML_MAN} =3D=3D "yes" .for mansect in 1 2 3 4 5 6 7 8 9 L N .for man in ${MAN${mansect}} @echo lib/X11/doc/html/${man}.html >> ${TMPPLIST} .endfor .endfor @${ECHO_CMD} "@unexec %D/bin/mkhtmlindex %D/lib/X11/doc/html" >> ${TMPPLI= ST} @${ECHO_CMD} "@exec %D/bin/mkhtmlindex %D/lib/X11/doc/html" >> ${TMPPLIST} .endif .endfor --=20 If I could think of a two-line witty aphorism for you to remember me by, this would definitely be it. 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?20020905012743.GA77608>