DFPorterDoc.tioga
Michael Plass, April 14, 1992 1:09 pm PDT
Willie-s, August 27, 1992 4:00 pm PDT
DFPorter
CEDAR 10.0
DFPorter
Michael Plass
© Copyright 1988, 1989, 1990, 1991 Xerox Corporation. All rights reserved.
Abstract: Command for making a suite of PCedar DF files from existing DF files, and other useful DF file hacks.
Created by: Michael Plass
Maintained by: <Michael Plass:PARC>
Keywords: port, DF Software, programming aids, Cedar
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

News:
DFPort no longer generates whole suites unless you ask for them with the -s switch.
DFNeeds can now do set differencing.
New DFContents command. (March 4, 1991)
DFPort now knows to make a -Sun4O3.df (included in the -Suite) and also knows to put .require and .command files.
Commands:
DFPort [-c] [-g] [-s] Ported.df Cedar10.1 Foo [PCedar2.0]<top>foo-Suite.df ...
will write the Foo.df, and, optionally, Foo-Source.df, Foo-PCR.df, Foo-PrincOps.df, Foo-Sun3.df, Foo-Sun4.df, Foo-Sun4O3.df, all targeted for Cedar10.1. There may be multiple input files, which will be combined before spliting. The input DF files need not be for princops; they may be previously-ported packages. Ported.df is used as a "database" of the DF files that have been previously ported.
To get an initial Ported.df, see DFNeeds, below.
The information gleaned from the DF files is fairly heavily cached, so even though the first run of DFPort will take awhile, subsequent runs will go faster.
switches:
-c => omit intermediate sources (e.g., .c2c.c files)
-g => omit non-goal object files
-s => emit PCedar - style suites of DF files
DFSort [-i] foo.df ...
will create a script that is ordered by the dependencies between the named DF files (following includes). For example,

DFSort [Cedar7.0]<Top>Cedar.df
will tell you an order for rebuilding Cedar. Lines with multiple entries indicate an interdependence among the DF files, which happens once in a while. Such an interdependence is generally not desirable.
The -i switch generates a series of Include statements, which is useful for making a draft of Ported.df for the DFPort command. The -d switch (in conjunction with -i) says to use dates for the files, rather than ~=.
DFNeeds foo.df ... { - bar.df ... | + baz.df ... }*
Is similar to DFSort, but chases down imports as well as includes. This is useful for determining what a given package needs to be ported.
By default, DFNeeds generates a series of Include statements (like the -i switch of DFSort), which is useful for making a draft of Ported.df for the DFPort command, if you know of an existing package with needs that are likely to subsume the needs of your new package:

%
DFNeeds [Cedar10.1]<Top>TiogaExecCommands.df > Ported.df
DFNeeds can also exclude things; anything after a minus sign will be excluded rather than included. For subtracted items, DFNeeds does not chase down imports, but only includes.
If given the -d switch, DFNeeds will put out dates, rather than ~= for Include items.
DFContents ( <switch> | <DFFile> ) ...
Produce a list of filenames from DF files, subject to filters. Switches:
-b derived files only
-d definition files only (mesa interfaces)
-i implementation files only (mesa programs and monitors)
-o <pattern> include files matching pattern
-p <picture> format output according to picture (default: /dir/subdir/base.ext!vers)
-r use remote filename for -d/-i filter
-s source files only
This is a powerful command for producing lines formatted from the contents of DF files. For example, two ways to open all the interface files in the DF component:
% open $(DFContents -o *.mesa -dr /pcedar/top/df-Suite.df)
% DFContents -o *.mesa -dr /pcedar/top/df-Suite.df -p "Open /dir/subdir/base.ext" | Commander
DFPCRLoadees [-r] World.df sunModel ComponentName1 ComponentName2 ...
Writes (to StdOut) the contents of a Loadees file for loading the named components into pcr. World.df is used to determine version numbers. The -r switch causes "RequireFrom" to be generated instead of "LoadAndRun" For example,

% DFPCRLoadees [PCedar2.0]<Top>PCedar.df sun4 CedarCore BasicCedar BigCardinalsImpl SchemePackage ImagerPackage InterpressPackage SchemeImagePackage
LoadAndRun /pseudo/pcedar2.0/cedarcore/sun4/cedarcore.c2c.o.~2~ CedarCore
-- Error: BasicCedar is not accessible via [PCedar2.0]<Top>PCedar.df
LoadAndRun /pseudo/pcedar2.0/bigcardinals/sun4/bigcardinalsimpl.c2c.o.~2~ BigCardinalsImpl
LoadAndRun /pseudo/pcedar2.0/scheme/sun4/schemepackage.c2c.o.~2~ SchemePackage
LoadAndRun /pseudo/pcedar2.0/imager/sun4/imagerpackage.c2c.o.~3~ ImagerPackage
LoadAndRun /pseudo/pcedar2.0/interpress/sun4/interpresspackage.c2c.o.~2~ InterpressPackage
LoadAndRun /pseudo/pcedar2.0/scheme/sun4/schemeimagepackage.c2c.o.~3~ SchemeImagePackage
%
It might be advantageous to make a DF file that describes just the parts of the world you need, both for speed and to avoid confusion about conflicting shortnames in different components; for example:

% Type SmallWorld.df

Include [PCedar2.0]<Top>CedarCore.df OF #
Include [PCedar2.0]<Top>BasicCedar.df OF #
Include [PCedar2.0]<Top>BigCardinals-Top.df OF #
Include [PCedar2.0]<Top>Scheme-Sun4.df OF #
Include [PCedar2.0]<Top>Imager-Sun4.df OF #
Include [PCedar2.0]<Top>Interpress-Sun4.df OF #

% DFPCRLoadees SmallWorld.df sun4 CedarCore BasicCedar BigCardinalsImpl SchemePackage ImagerPackage InterpressPackage SchemeImagePackage
LoadAndRun /pseudo/pcedar2.0/cedarcore/sun4/cedarcore.c2c.o.~2~ CedarCore
LoadAndRun /pseudo/pcedar2.0/basiccedar/sun4/basiccedar.c2c.o.~6~ BasicCedar
LoadAndRun /pseudo/pcedar2.0/bigcardinals/sun4/bigcardinalsimpl.c2c.o.~2~ BigCardinalsImpl
LoadAndRun /pseudo/pcedar2.0/scheme/sun4/schemepackage.c2c.o.~2~ SchemePackage
LoadAndRun /pseudo/pcedar2.0/imager/sun4/imagerpackage.c2c.o.~3~ ImagerPackage
LoadAndRun /pseudo/pcedar2.0/interpress/sun4/interpresspackage.c2c.o.~2~ InterpressPackage
LoadAndRun /pseudo/pcedar2.0/scheme/sun4/schemeimagepackage.c2c.o.~3~ SchemeImagePackage
%
It might be advantageous to make a DF file that describes just the parts of the world you need, both for speed and to avoid confusion about conflicting shortnames in different components; for example:
DFDoForSources [ -d ] CommandName DFName ...
Executes the named CommandTool command for each of the source files defined by the listed DF files. The -d switch includes Cedar/Mesa DEFINITIONS files as sources; otherwise they are excluded, since you might wish to avoid altering interface files. This command is not as interesting anymore, given the DFContents command.
Known Bugs:
DFPort
Tosses comments into Foo-Source.df. Fix by hand as appropriate.
The sorting of the file names loses (potentially) interesting order.
Source-sharing is not well supported.