Question about fields in INDEX files

2007-05-06 Thread Garrett Cooper

Hello all,
	As part of my Google SoC project I'm taking a look at INDEX-{ver} and 
revising it to fit Berkeley DB objects combined with pkg_*, much like 
pkgdb does.


	I have a few questions about the meanings of the fields though and 
their use. I'm using net/DarwinStreamingServer as an example, because 
it's short, and contains all of the fields I could find present in all 
of the INDEX entries, and this comes from INDEX-7, not INDEX-5 or INDEX-6.


===
Entry:
===
DarwinStreamingServer-5.5.4_1|/usr/ports/net/DarwinStreamingServer|/usr/local|Darwin 
Streaming Server, a MP3, MPEG4 and QuickTime streaming 
server|/usr/ports/net/DarwinStreamingServer/pkg-descr|[EMAIL PROTECTED]|net||p5-Net-SSLeay-1.30_1 
perl-5.8.8|http://developer.apple.com/darwin/projects/streaming/|||


===

The fields are as following (separated by pipes):
1. [Port name (without category)]-[version][{:_revision}]
2. Full path to port.
3. Installation prefix (?)
4. Comment
5. Full path to pkg-descr file
6. Maintainer
7. Category
8. [unknown] -- blank field
9. Direct dependencies
10. Developer's / Project's Webpage
11., 12. [unknown] (x2) -- blank fields

===

If someone can correct me on the meanings of these fields, that would be 
 fantastic. Also, if someone can help me discover the secret identities 
of some of the unknown fields (in particular the last 2 blank fields), 
that would be helpful as well. I understand that the majority of these 
lines do come from the Makefiles, but I'm not sure what additional 
fields could be involved in this.


Also, I was wondering if fields 3. and 5. are really necessary in the 
INDEX file. 3. can be user specified, or default to a particular value.


Also, 5. can be automatically assumed to {2.}/pkg-descr in all cases 
that I've seen. So, given this observation is there any real case that 
this assumption would be false?


Thanks for any and all help!
-Garrett
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Question about fields in INDEX files

2007-05-06 Thread Mark Linimon
The output from each port's make describe is documented at the
describe target in:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk

This is changed to a different format (a historical bug, too late to fix
now because of POLA) via make index from ports/Makefile by the following
script (see the foreach block at the end):

http://www.freebsd.org/cgi/cvsweb.cgi/ports/Tools/make_index

I will send you portsmon's portsIndexUtils.py file that you can work from
to figure out this mess.  (I don't see any reason to post it to the list).

mcl
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Question about fields in INDEX files

2007-05-06 Thread Garrett Cooper

Mark Linimon wrote:

The output from each port's make describe is documented at the
describe target in:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk

This is changed to a different format (a historical bug, too late to fix
now because of POLA) via make index from ports/Makefile by the following
script (see the foreach block at the end):

http://www.freebsd.org/cgi/cvsweb.cgi/ports/Tools/make_index

I will send you portsmon's portsIndexUtils.py file that you can work from
to figure out this mess.  (I don't see any reason to post it to the list).

mcl


Mark,
Thanks for the speedy reply.
	Would you happen to know what the Perl module / class is that's used 
for storing the pkg objects with? I just want to look at the structure a 
bit closer.

Thanks,
-Garrett
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Question about fields in INDEX files

2007-05-06 Thread Garrett Cooper

Mark Linimon wrote:

The output from each port's make describe is documented at the
describe target in:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk

This is changed to a different format (a historical bug, too late to fix
now because of POLA) via make index from ports/Makefile by the following
script (see the foreach block at the end):

http://www.freebsd.org/cgi/cvsweb.cgi/ports/Tools/make_index

I will send you portsmon's portsIndexUtils.py file that you can work from
to figure out this mess.  (I don't see any reason to post it to the list).

mcl


Mark,
Thanks for the speedy reply.
Would you happen to know what the Perl module / class is that's used
for storing the pkg objects with? I just want to look at the structure a
bit closer.
Thanks,
-Garrett

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Question about fields in INDEX files

2007-05-06 Thread Matthew Seaman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Garrett Cooper wrote:
 Hello all,
 As part of my Google SoC project I'm taking a look at INDEX-{ver}
 and revising it to fit Berkeley DB objects combined with pkg_*, much
 like pkgdb does.
 
 I have a few questions about the meanings of the fields though and
 their use. I'm using net/DarwinStreamingServer as an example, because
 it's short, and contains all of the fields I could find present in all
 of the INDEX entries, and this comes from INDEX-7, not INDEX-5 or INDEX-6.
 
 ===
 Entry:
 ===
 DarwinStreamingServer-5.5.4_1|/usr/ports/net/DarwinStreamingServer|/usr/local|Darwin
 Streaming Server, a MP3, MPEG4 and QuickTime streaming
 server|/usr/ports/net/DarwinStreamingServer/pkg-descr|[EMAIL 
 PROTECTED]|net||p5-Net-SSLeay-1.30_1
 perl-5.8.8|http://developer.apple.com/darwin/projects/streaming/|||
 
 ===
 
 The fields are as following (separated by pipes):
 1. [Port name (without category)]-[version][{:_revision}]
 2. Full path to port.
 3. Installation prefix (?)
 4. Comment
 5. Full path to pkg-descr file
 6. Maintainer
 7. Category
 8. [unknown] -- blank field
 9. Direct dependencies
 10. Developer's / Project's Webpage
 11., 12. [unknown] (x2) -- blank fields
 
 ===
 
 If someone can correct me on the meanings of these fields, that would be
  fantastic. Also, if someone can help me discover the secret identities
 of some of the unknown fields (in particular the last 2 blank fields),
 that would be helpful as well. I understand that the majority of these
 lines do come from the Makefiles, but I'm not sure what additional
 fields could be involved in this.
 
 Also, I was wondering if fields 3. and 5. are really necessary in the
 INDEX file. 3. can be user specified, or default to a particular value.
 
 Also, 5. can be automatically assumed to {2.}/pkg-descr in all cases
 that I've seen. So, given this observation is there any real case that
 this assumption would be false?
 
 Thanks for any and all help!
 -Garrett

Been there, done that.  Take a look at the code in Port.pm from my
FreeBSD::Portindex stuff.  Particularly the print() method:


#
# Print out one line of the INDEX file
#
sub print ($*;$)
{
my $self = shift;
my $fh   = shift;
my $allports = shift;
my $counter  = shift;

print $fh $self-PKGNAME(), '|';
print $fh $self-ORIGIN(),  '|';
print $fh $self-STUFF(),   '|';
print $fh $self-_chase_deps( $allports, 'BUILD_DEPENDS' ), '|';
print $fh $self-_chase_deps( $allports, 'RUN_DEPENDS' ),   '|';
print $fh $self-WWW(), '|';
print $fh $self-_chase_deps( $allports, 'EXTRACT_DEPENDS' ), '|';
print $fh $self-_chase_deps( $allports, 'PATCH_DEPENDS' ),   '|';
print $fh $self-_chase_deps( $allports, 'FETCH_DEPENDS' ),   \n;

counter( \%::Config, $counter );
return $self;
}

STUFF is the amalgamation of fields 3,4,5,6,7 which you've already
identified. The PREFIX (field 3) is usually /usr/local although for
a limited time there are still a number of X11 related entries using
/usr/X11R6.  Similarly the pkg-desc (field 5) is almost always 
/usr/ports/category/portname/pkg-descr -- but there are a
significant number of exceptions, which are slave ports.  Eg. compare
these two INDEX entries:

% grep ^mod_jk INDEX-6  
mod_jk-1.2.21,1|/usr/ports/www/mod_jk|/usr/local|Apache JK module for 
connecting to Tomcat using AJP1X|/usr/ports/www/mod_jk/pkg-descr|[EMAIL 
PROTECTED]|www|apache-1.3.37_3 expat-2.0.0_1 gettext-0.16.1_1 gmake-3.81_1 
libiconv-1.9.2_2 perl-5.8.8|apache-1.3.37_3 expat-2.0.0_1 
perl-5.8.8|http://tomcat.apache.org/connectors-doc/|||
mod_jk-ap2-1.2.21|/usr/ports/www/mod_jk-apache2|/usr/local|Apache2 JK module 
for connecting to Tomcat using 
AJP1X|/usr/ports/www/mod_jk-apache2/../mod_jk/pkg-descr|[EMAIL 
PROTECTED]|www|apache-2.0.59 expat-2.0.0_1 gettext-0.16.1_1 gmake-3.81_1 
libiconv-1.9.2_2 perl-5.8.8|apache-2.0.59 expat-2.0.0_1 libiconv-1.9.2_2 
perl-5.8.8|http://tomcat.apache.org/connectors-doc/|||

Note that either of these fields can vary with local customization as
well -- nothing says that you've always got to keep the ports tree rooted
at /usr/ports or install everything with a prefix of /usr/local, although
if you change any of that, you're going to be building your own INDEX
anyhow.

The 5 'DEPENDS' entries in the last 6 fields consist of the output of
various FOO_DEPENDS variables from the port's Makefile processed to turn
the port origins 'editors/emacs21' into the package names 'emacs-21.3_9'

These values are then combined in various ways, ie. RUN_DEPENDS in the
Index file is the combination of the values from the $RUN_DEPENDS and
$LIB_DEPENDS variables from the Makefile, plus the accumulated sum of
the RUN_DEPENDS for each of the dependencies, and each of their
dependencies, recursively.

eg. If '$EXTRACT_DEPENDS' in the port Makefile is set to:

EXTRACT_DEPENDS= rpm2cpio.pl:${PORTSDIR}/archivers/rpm2cpio

then the EXTRACT_DEPENDS field in the 

Re: question about fields in INDEX files

2007-05-06 Thread Garrett Cooper

Michel Talon wrote:

Take a look at:
http://www.lpthe.jussieu.fr/~talon/freebsdports.html
all fields are explained.



Thanks to Michel (many kudos and much thanks!), I now have a list of all 
of the fields:


   1. pkgname
   2. path
   3. prefix
   4. comment
   5. descr
   6. maintainer
   7. categories
   8. build_deps
   9. run_deps
  10. website
  11. extract_deps
  12. patch_deps
  13. fetch_deps

I looked through the INDEX file pretty quickly, and I can't see any 
instances of 12. or 13.


Also, I'm still wondering if 3. is necessary because the user can 
specify the install directory, and/or we could set the default to 
/usr/local. The only case where I see this as incorrect is with already 
installed packages, but that should be specified in the /var/db/pkg/* 
files, right?


Thanks again all!

-Garrett
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: question about fields in INDEX files

2007-05-06 Thread Garrett Cooper

Garrett Cooper wrote:

Michel Talon wrote:

Take a look at:
http://www.lpthe.jussieu.fr/~talon/freebsdports.html
all fields are explained.



Thanks to Michel (many kudos and much thanks!), I now have a list of all 
of the fields:


   1. pkgname
   2. path
   3. prefix
   4. comment
   5. descr
   6. maintainer
   7. categories
   8. build_deps
   9. run_deps
  10. website
  11. extract_deps
  12. patch_deps
  13. fetch_deps

I looked through the INDEX file pretty quickly, and I can't see any 
instances of 12. or 13.


Also, I'm still wondering if 3. is necessary because the user can 
specify the install directory, and/or we could set the default to 
/usr/local. The only case where I see this as incorrect is with already 
installed packages, but that should be specified in the /var/db/pkg/* 
files, right?


Thanks again all!

-Garrett


Ok, question about 3. was answered, and so was the questions for 12. and 
 13. I assume. I'll reread the email Matthew Seaman, and see if I can 
find any spots where I'm confused.


Thanks!
-Garrett
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to [EMAIL PROTECTED]