USGS - science for a changing world

USGS Geoscience Data Catalog

How the metadata collection is maintained

The metadata on this site are all contained in subdirectories of http://geo-nsdi.er.usgs.gov/metadata. I run mp on each of the metadata records by using the UNIX make utility. That utility checks the file dates and times and only updates files if their source data has changed.

Makefile

make is a UNIX utility designed for automating the process of compiling code in software projects. Its purpose is to keep a set of targets up to date when the corresponding sources have been changed. In programming projects, the targets are usually executable programs, and the sources are files containing the source code of those programs. When a programmer changes the source code, the executable program needs to be updated. For example, a makefile might contain

process.exe:	process.c
	cc process.c -o process.exe
Invoked as make process.exe, the make utility first discovers that process.exe depends on process.c. It checks the date when these files were last changed, and if the source code file process.c has been changed since the executable file was last changed, it executes the second line, calling the C compiler to create the output file process.exe.

This particular makefile contains a rule; a shorthand notation indicating how to build one kind of target from one kind of source. That rule is specified using these lines:

.SUFFIXES: .met .err .html .sgml .txt

.met.sgml:
	mp -c standard.cfg $*.met
	err2html -c standard.cfg $*.err
This indicates that whenever a file whose name ends with .sgml needs to be updated, its date should be compared with a file of the same name ending instead with .met. If the source file (*.met) was changed more recently than the target (*.sgml), mp is run with the source file name and a configuration file specified as the input. You can't tell from this rule that mp will generate the target file (*.sgml); that is specified in the configuration file.

standard.cfg

The configuration file tells mp which metadata extensions to use, and in this case it also tells mp which output files to produce. Note the use of the base option under output:html in the configuration file; that indicates to mp the URL that should be provided in the HTML output files through a <BASE> tag. It ensures that links in the metadata will be relative to that base and not to the UNIX directory in which the metadata are processed.

Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://geo-nsdi.er.usgs.gov/how.html
Page Contact Information: Peter Schweitzer
Page Last Modified: Friday, 04-Jan-2013 10:15:52 EST