################################################################## # # TRAVERSE_LINKS.sh # # Recursively traverse all inherited hyper-links # of type LINK_TYPE. Return a list of elements that are connected # to the element via the LINK_TYPE. Either return the children only, # the ancesstors only, or both. Always return the passed in element # first. # # Author: Charles W. Clarke III charles@tbi.com # Date: Sep. 17, 1996 #################################################################### USAGE: $SELF VOB_ELEMENT LINK_TYPE DIRECTION{child, parent, both} [ TEMP_FILE ] TRAVERSE_LINKS.sh uses it own internal temp_file if non is given and it cleans-up (removes) the file when done. If a file is passed in then that one is used and the caller is responsible for cleanup. The output itself can be used directly or piped to a command or file. This is useful when link types need to be traversed to determin the scope of a change. For example if you had files linked together that were to be changed together, you might link them with a "Force_Change" hyperlink, (If I checkout this ... also checkout that). Without worrying about previous relationships or file-types one could in a post checkout trigger traverse the links in on of the directions and checkout the connected list. (i.e. cleartool co -nc `TRAVERSE_LINKS.sh foo.c Force_Change both` ) In the case of "---->" is a hyperlink of HLINK_TYPE "Force_Change" (foo.c) ----> (foo.h) ----> (foo.doc) ----> (foo.req) | ----> (bar.c) ----> (bar.h) <---- (bar.sh) TRAVERSE_LINKS.sh bar.c Force_Change parent returns: bar.c foo.c TRAVERSE_LINKS.sh bar.c Force_Change child returns: bar.c bar.h TRAVERSE_LINKS.sh bar.c Force_Change both returns: bar.c foo.c foo.h foo.doc foo.req bar.h bar.sh Either of the following will also place the output in SOME_FILE TRAVERSE_LINKS.sh bar.c Force_Change both SOME_FILE TRAVERSE_LINKS.sh bar.c Force_Change both > SOME_FILE The output can also used in other commands. cleartool ci `TRAVERSE_LINKS.sh bar.c Force_Change both`