Date: Thu, 1 Sep 2011 17:20:17 +0100 From: Chris Rees <utisoft@gmail.com> To: Eygene Ryabinkin <rea@freebsd.org> Cc: ports@freebsd.org Subject: Re: Extra fields in INDEX Message-ID: <CADLo83_8M5nbMsG-rRun1D7eLaGxksJp_ek0XBzgbD-yj-A3RA@mail.gmail.com> In-Reply-To: <suBQSu7IRMFsXQaKZ6JnadltbIY@2xgNtugC3Vp4M/MGOjF7DliWokI> References: <CADLo83_Oc7L%2BBnkeAkSBXpxyqwTCtOF2zkULTQC_7xSAhMOeFQ@mail.gmail.com> <suBQSu7IRMFsXQaKZ6JnadltbIY@2xgNtugC3Vp4M/MGOjF7DliWokI>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1 September 2011 17:12, Eygene Ryabinkin <rea@freebsd.org> wrote: > Chris, good day. > > Fri, Aug 19, 2011 at 03:32:43PM +0100, Chris Rees wrote: >> I'm having a look at modifying INDEX to have a field at the end (to >> cause minimum breakage), but I've discovered that in a few ports there >> (6630 out of 22731) appears to be extra 'stuff' in fields past field >> 10 (which is for the first WWW: line in pkg-descr). >> >> Can anyone with knowledge of make index explain why this is happening? >> Using the command line at [1] gets a list >> >> [crees@hydra]~% alias findextrasinindex "< `make -C /usr/ports -V >> INDEXDIR`/`make -C /usr/ports -V INDEXFILE` grep -n >> '^\([^|]*|\)\{11\}[^|]\+'" > > This regexp won't catch empty field #12, so you're effectively counting > the number of entries with non-empty field #12: > {{{ > $ cat INDEX-9 | cut -f 12 -d '|' | grep -v '^$' | wc -l > =A0 =A06221 > $ grep -n '^\([^|]*|\)\{11\}[^|]\+' INDEX-9 | wc -l > =A0 =A06221 > }}} > > Every line in INDEX has 13 fields: > {{{ > $ grep -n '^\([^|]*|\)\{12\}[^|]*$' INDEX-9 | wc -l > =A0 22287 > $ wc -l INDEX-9 > =A0 22287 INDEX-9 > }}} > as every line in 'make describe': > {{{ > $ make -C archivers/fastjar describe | tr '|' '\n' | wc -l > =A0 =A0 =A013 > }}} > >> They have extra fields on the end ... Where have they come from?? > > There are no extra fields, but /usr/ports/Tools/make_index just > reorders them: the order becomes 0...6, 10, 11, 7...9, 12 if compared > to the initial field indices. =A0What is effectively done by 'make > index' in the case of fastjar index line is the following: > {{{ > (make -C archivers/fastjar describe; \ > =A0make -C lang/perl5.8 describe; \ > =A0make -C devel/gmake describe) | \ > perl /usr/ports/Tools/make_index 2>/dev/null | \ > sed -e 's/ =A0*/ /g' -e 's/| =A0*/|/g' -e 's/ =A0*|/|/g' -e 's./.^A.g' | = \ > sort -t '|' +1 -2 | sed -e 's.^A./.g' | grep ^fastjar > }}} > and '^A' here is the real '^A', not two chars '^' and 'A'. > > make_index respects the trailing fields (those that come after 13th) > and they will be put to the end, so if you will add something > as additional trailing field produced by 'make describe', it will > survive piping through make_index and will be in its place in the > INDEX file. Thanks very much Eygene -- I'd tracked down all these by talking to linimon, and neglected to reply to this email. I'm sorry I've wasted your time :( Also, you're right about the regexp, damnit! Chris --=20 Chris Rees =A0 =A0 =A0 =A0 =A0| FreeBSD Developer crees@FreeBSD.org =A0 | http://people.freebsd.org/~crees
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo83_8M5nbMsG-rRun1D7eLaGxksJp_ek0XBzgbD-yj-A3RA>