Program to operate on PkgData files


The pkg-data files are obviously of no use unless we have a way to do all the same work that is done in the present ports setup. I believe the best way to handle this is with a program that understands pkg-data files, and that does all the necessary work based on parameters to the program. I personally expect that we will avoid a lot of headaches if we make this a standalone C program, instead of trying to implement everything via clever contortions with sed, make, awk, and shell commands.

What follows is a list of some operations that I expect this program to perform. I have not done all that much work on the ports collection, so I am sure there are many important operations that I have missed here. Please let me know what those are.

I suspect that in some situations we might want the program to do its work based on the value of some environment variable. It might be convenient if the program supported a way to say "here is a variable name, and the real value should be taken from that variable". Something like "env=name". I think this would be easier and more readable than trying to keep track of all the various quoting and value-escaping rules that one needs to safely use the value of some environment variable. I remember some of the headaches that were encountered when moving pkg-comment into the Makefiles, for instance, because some ports had a COMMENT value that included various "inconvenient" characters.

I know that `make describe' presently works with the pkg-descr file, and if a port has that file then the full pathname is put in /usr/ports/INDEX. Right now I do not have a good idea for how to handle that in a pkg-data world. My initial guess is that we could put a pathname to the pkg-data file in /usr/ports/INDEX, and then change whatever processes reference that field to call the pkg-handling program with some option to print out the pkg-descr section of the file.
 


Comments can be sent to:   drosih@rpi.edu
Web page last on updated:  Apr 12/2004