Date: Fri, 18 Jun 2004 19:17:00 -0700 From: Kris Kennaway <kris@obsecurity.org> To: ports@FreeBSD.org Cc: knu@FreeBSD.org Subject: Change to INDEX format Message-ID: <20040619021700.GA27883@xor.obsecurity.org>
next in thread | raw e-mail | index | archive | help
--OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This patch extends the format of the INDEX file to separately list FETCH_DEPENDS, EXTRACT_DEPENDS and PATCH_DEPENDS instead of lumping them all together with BUILD_DEPENDS. I need a version of this in order to support recent changes to the package build cluster, which adds the dependencies separately before the corresponding build stage, to test for errors that would be seen on a clean system. It's somewhat backwards-compatible since the new fields are appended and do not reorder existing fields, but I suspect some tools like portupgrade and porteasy that parse the INDEX will need to be taught about the new fields. (I've also removed the 'parallel' target since this is pretty much specific to the package builds, and I can do a better job of it in the Tools/portbuild/scripts/makeparallel script.) Kris Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /c/pcvs/ports/Makefile,v retrieving revision 1.85 diff -u -r1.85 Makefile --- Makefile 11 Jun 2004 23:52:44 -0000 1.85 +++ Makefile 19 Jun 2004 00:17:02 -0000 @@ -122,18 +122,7 @@ echo " Done." =20 print-index: ${.CURDIR}/${INDEXFILE} - @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\= t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }' = < ${.CURDIR}/${INDEXFILE} - -parallel: ${.CURDIR}/${INDEXFILE} -.if !defined(branch) - @echo "The parallel target requires a branch parameter," - @echo "e.g.: \"make parallel branch=3DX\"" - @false -.endif -.for dir in ${SUBDIR} - @[ -r ${dir}/Makefile ] && echo "all: ${dir}-all" || true -.endfor - @awk -F '|' '{me=3D$$1; here=3D$$2; bdep=3D$$8; rdep=3D$$9; split(here, t= mp, "/"); if (bdep !=3D "") { gsub("$$", ".tgz", bdep); gsub(" ", ".tgz ", = bdep); } if (rdep !=3D "") { gsub("$$", ".tgz", rdep); gsub(" ", ".tgz ", r= dep); } print tmp[4] "-all: " me ".tgz"; print me ": " me ".tgz"; print me = ".tgz: " bdep " " rdep; printf("\t@/var/portbuild/scripts/pdispatch ${branc= h} /var/portbuild/scripts/portbuild %s.tgz %s", me, here); if (bdep !=3D ""= ) printf(" %s", bdep); if (rdep !=3D "") printf(" %s", rdep); printf("\n")}= ' < ${.CURDIR}/${INDEXFILE} + @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\= t%s\nB-deps:\t%s\nR-deps:\t%s\nE-deps:\t%s\nP-deps:\t%s\nF-deps:\t%s\nWWW:\= t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$11, $$12, $$13, $$10); }' < = ${.CURDIR}/${INDEXFILE} =20 CVS?=3D cvs SUP?=3D cvsup Index: Mk/bsd.port.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /c/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.491 diff -u -r1.491 bsd.port.mk --- Mk/bsd.port.mk 10 Jun 2004 07:30:19 -0000 1.491 +++ Mk/bsd.port.mk 11 Jun 2004 05:32:16 -0000 @@ -4386,13 +4386,14 @@ print q{|/dev/null}; \ } \ print q{|${MAINTAINER}|${CATEGORIES}|}; \ - @bdirs =3D map((split /:/)[1], split(q{ }, q{${EXTRACT_DEPENDS} ${PATCH_= DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS}})); \ + @edirs =3D map((split /:/)[1], split(q{ }, q{${EXTRACT_DEPENDS}})); \ + @pdirs =3D map((split /:/)[1], split(q{ }, q{${PATCH_DEPENDS}})); \ + @fdirs =3D map((split /:/)[1], split(q{ }, q{${FETCH_DEPENDS}})); \ + @bdirs =3D map((split /:/)[1], split(q{ }, q{${BUILD_DEPENDS}})); \ @rdirs =3D map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \ - @mdirs =3D ( \ - map((split /:/)[0], split(q{ }, q{${DEPENDS}})), \ - map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})) \ - ); \ - for my $$i (\@bdirs, \@rdirs, \@mdirs) { \ + @ddirs =3D map((split /:/)[0], split(q{ }, q{${DEPENDS}})); \ + @ldirs =3D map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})); \ + for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldir= s) { \ my @dirs =3D @$$i; \ @$$i =3D (); \ for (@dirs) { \ @@ -4404,14 +4405,26 @@ } \ } \ } \ - for (@bdirs, @mdirs) { \ - $$x{$$_} =3D 1; \ + for (@edirs, @ddirs) { \ + $$xe{$$_} =3D 1; \ } \ - print join(q{ }, sort keys %x), q{|}; \ - for (@rdirs, @mdirs) { \ - $$y{$$_} =3D 1; \ + print join(q{ }, sort keys %xe), q{|}; \ + for (@pdirs, @ddirs) { \ + $$xp{$$_} =3D 1; \ } \ - print join(q{ }, sort keys %y), q{|}; \ + print join(q{ }, sort keys %xp), q{|}; \ + for (@fdirs, @ddirs) { \ + $$xf{$$_} =3D 1; \ + } \ + print join(q{ }, sort keys %xf), q{|}; \ + for (@bdirs, @ddirs, @ldirs) { \ + $$xb{$$_} =3D 1; \ + } \ + print join(q{ }, sort keys %xb), q{|}; \ + for (@rdirs, @ddirs, @ldirs) { \ + $$xr{$$_} =3D 1; \ + } \ + print join(q{ }, sort keys %xr), q{|}; \ if (open(DESCR, q{${DESCR}})) { \ while (<DESCR>) { \ if (/^WWW:\s+(\S+)/) { \ Index: Tools/make_index =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /c/pcvs/ports/Tools/make_index,v retrieving revision 1.10 diff -u -r1.10 make_index --- Tools/make_index 24 Feb 2003 16:07:07 -0000 1.10 +++ Tools/make_index 18 Jun 2004 22:50:36 -0000 @@ -1,13 +1,11 @@ -#!/usr/bin/perl +#!/usr/bin/perl5~ # # $FreeBSD: ports/Tools/make_index,v 1.10 2003/02/24 16:07:07 steve Exp $ # -# Written to speed-up INDEX file generation. The new scheme -# basically visits each port once and writes out each port's -# build-depends and run-depends as a list of directories. This +# INDEX builds visit each port once and write out each port's +# *-depends as a list of directories, using 'make describe'. This # script goes back in and maps the directories back to pkgnames, -# fixes up the build-depends and run-depends list, and writes -# out the new INDEX file. +# fixes up the *-depends list, and writes out the new INDEX file. =20 require 5.002; =20 @@ -38,14 +36,40 @@ my $pkg =3D shift(@_); return if $pkg->{checked}; =20 - # build-depends =3D build-depends + recursive list of run-depends - # for each build-depends + # extract-depends =3D extract-depends + recursive list of run-depends + # for each extract-depends my @deps =3D (); - foreach $name (@{$pkg->{bdep}}) { + foreach $name (@{$pkg->{edep}}) { recurse($index{$name}); push(@deps, @{$index{$name}->{rdep}}); } =20 + $pkg->{edep} =3D uniqify(@{$pkg->{edep}}, @deps); + + # same as above except for patch-depends this time + @deps =3D (); + foreach $name (@{$pkg->{pdep}}) { + recurse($index{$name}); + push(@deps, @{$index{$name}->{rdep}}); + } + $pkg->{pdep} =3D uniqify(@{$pkg->{pdep}}, @deps); + + # same as above except for fetch-depends this time + @deps =3D (); + foreach $name (@{$pkg->{fdep}}) { + recurse($index{$name}); + push(@deps, @{$index{$name}->{rdep}}); + } + $pkg->{fdep} =3D uniqify(@{$pkg->{fdep}}, @deps); + $pkg->{checked} =3D 1; + + # same as above except for build-depends this time + @deps =3D (); + foreach $name (@{$pkg->{bdep}}) { + recurse($index{$name}); + push(@deps, @{$index{$name}->{rdep}}); + } $pkg->{bdep} =3D uniqify(@{$pkg->{bdep}}, @deps); + $pkg->{checked} =3D 1; =20 # same as above except for run-depends this time @deps =3D (); @@ -55,6 +79,7 @@ } $pkg->{rdep} =3D uniqify(@{$pkg->{rdep}}, @deps); $pkg->{checked} =3D 1; + } =20 # Given one or more lists as arguments return the set @@ -85,9 +110,12 @@ =20 # Create a hash table of the infomation we need about this port. my $pkg =3D { - 'bdep' =3D> [split(/ /, $f[7])], - 'rdep' =3D> [split(/ /, $f[8])], - 'rest' =3D> join('|', splice(@f, 9)), + 'edep' =3D> [split(/ /, $f[7])], + 'pdep' =3D> [split(/ /, $f[8])], + 'fdep' =3D> [split(/ /, $f[9])], + 'bdep' =3D> [split(/ /, $f[10])], + 'rdep' =3D> [split(/ /, $f[11])], + 'rest' =3D> join('|', splice(@f, 12)), 'text' =3D> join('|', splice(@f, 0, 7)) }; $index{$name} =3D $pkg; @@ -100,11 +128,26 @@ foreach $name (keys %index) { my $pkg =3D $index{$name}; # first the build dependencies + if (@{$pkg->{edep}}) { + my @edep =3D map { by_path($_, $name) } @{$pkg->{edep}}; + $pkg->{edep} =3D \@edep; + } + #=20 + if (@{$pkg->{pdep}}) { + my @pdep =3D map { by_path($_, $name) } @{$pkg->{pdep}}; + $pkg->{pdep} =3D \@pdep; + } + # first the build dependencies + if (@{$pkg->{fdep}}) { + my @fdep =3D map { by_path($_, $name) } @{$pkg->{fdep}}; + $pkg->{fdep} =3D \@fdep; + } + # first the build dependencies if (@{$pkg->{bdep}}) { my @bdep =3D map { by_path($_, $name) } @{$pkg->{bdep}}; $pkg->{bdep} =3D \@bdep; } - # and now the run dependencies + # first the build dependencies if (@{$pkg->{rdep}}) { my @rdep =3D map { by_path($_, $name) } @{$pkg->{rdep}}; $pkg->{rdep} =3D \@rdep; @@ -123,7 +166,13 @@ print join(' ', sort(@{$pkg->{bdep}})) if @{$pkg->{bdep}}; print "|"; print join(' ', sort(@{$pkg->{rdep}})) if @{$pkg->{rdep}}; - print "|$pkg->{rest}\n"; + print "|$pkg->{rest}|"; + print join(' ', sort(@{$pkg->{edep}})) if @{$pkg->{edep}}; + print "|"; + print join(' ', sort(@{$pkg->{pdep}})) if @{$pkg->{pdep}}; + print "|"; + print join(' ', sort(@{$pkg->{fdep}})) if @{$pkg->{fdep}}; + print "\n"; ++$pkg->{'PRINTED'}; } } --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA06IcWry0BWjoQKURAtf6AKD95MEiaJMJI0Z2JfCNGBccVI0nCgCfbMOC fJmhlJPW70b4mqQUsFS2dr4= =3UoT -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040619021700.GA27883>