catcr
Displays configuration record created by clearmake, omake (Windows only), or clearaudit
Applicability
Product |
Command type |
---|---|
ClearCase® |
cleartool subcommand |
Platform |
---|
UNIX |
Linux |
Windows |
Synopsis
- Display a configuration record:
- catcr [ –r/ecurse | –fla/t | –uni/on | –che/ck [ –uni/on ]
- | –mak/efile ] [ –sel/ect do-leaf-pattern ]
[ –ci ]
[ –typ/e { f | d | l } ... ] [ –ele/ment_only ] [ –vie/w_only ]
[ –cri/tical_only ] [ –nam/e tail-pattern ]
[ –zer/o ] [ –wd ] [ –nxn/ame ] [ –fol/low ] [ –l/ong | –s/hort ] do-pname ...
- Display only the configuration record header
and build scripts:
- catcr –scr/ipts_only [ –rec/urse ] [ –l/ong | –s/hort ] do-pname ...
Description
The catcr command displays the configuration records (CRs) for the specified derived objects (DOs) and, optionally, for their build dependencies. The ClearCase make tool (clearmake, or omake for Windows) creates a CR each time it executes a build script that creates one or more DOs. You can also list the configuration record header and build scripts only.
For more information about configuration records and derived objects, see the DevOps Code ClearCase Guide to Building Software.
Restrictions
None.
Options and arguments
Reporting on derived-object subtargets
- Default
- catcr lists the derived-object subtargets used to build do-pname, but it does not examine or display subtarget CRs. The –recurse, –flat, –union, –check, and –makefile options direct catcr to recurse into subtarget CRs. Use –select to isolate the CRs of one or more subtargets; use –ci to examine the CRs of pre-built, checked-in DO versions.
- –r/ecurse
- Displays the CRs of any derived objects that are subtargets of do-pname. Each CR is displayed separately.
- –fla/t
- Similar to –recurse, but consolidates the CRs into a single list of versions and derived objects, with no duplicate entries. –flat produces one report for each do-pname on the command line. The report includes file system objects only; no headers, variables and options, or build scripts. A number that precedes each file name indicates the total number of times it was referenced during the build.
- –uni/on
- Produces one report for all derived objects on the command line. Like –flat, –union consolidates the CRs of each do-pname and its subtargets into a single list of objects, with no duplicate entries. It then combines the separate lists into a single report with no duplicates. The report includes file system objects only; no headers, variables and options, or build scripts are included.
- –che/ck [ –uni/on ]
- Flags entries in the CR that have unusual characteristics, including
references to view-private files (but not references to view-private directories). You can use –check with –union. This combination determines whether a CR contains any of the following:
- Versions that are not currently checked in. This includes versions that no longer exist (an intermediate version that only existed as a view-private file, for example), versions that are currently checked out, and versions that were explicitly removed with the rmver command.
- Multiple versions of the same element. This can occur, for example, if a build used multiple libraries, which were built from different source versions.
- Multiple references to the same element with different names, such as a renamed element in different directory versions.
- –mak/efile
- Similar to –recurse, but displays the CR in simple makefile format. The listing includes the dependencies and build script for each of the derived object's subtargets. Always include the –wd option with –makefile; this causes catcr to list pathnames relative to the initial working directory of the build. (Note that this behavior differs from the standard behavior of –wd). If you fail to include –wd, cleartool displays a warning message and then displays the makefile without modifying dependency pathnames.
- –sel/ect do-leaf-pattern
- Starts the listing at the subtarget of do-pname that
match the specified pattern. do-leaf-pattern can be a pattern
(see the wildcards_ccase reference page) that matches a
simple file name; it must not include a slash character (/ \) or the ellipsis
wildcard ( ... ). Alternatively, it can be a standard path name of a derived
object.
This option is useful for isolating a derived object that was built as a dependency of another one. For example, this command displays the CR of the derived object named hello.obj that was used to build hello.exe in the current view:
cmd-context catcr -select hello.obj hello.exe
- –ci (for use in recursive listings only)
- By default, recursive listings do not display CRs for DO versions. This option displays the CRs for DO versions. –ci only has effect with –recurse, –flat, –union, and –makefile.
Specifying kinds of objects to display
- Default
- catcr reports on all objects in the CR. These objects may include source files, directories, and symbolic links; derived objects; makefiles; view-private files; and non-MVFS objects that were explicitly declared as dependencies.
- –typ/e { f | d | l } ...
- Restricts the listing to files only (f), to directories only (d), or to links only (l). If you omit –type, a –short listing includes files only and a –long listing includes all three kinds. To specify multiple kinds of objects, group them into a single argument: –type fd.
- –ele/ment_only
- Lists versions of elements only, including checked-out versions. This
option excludes from the listing derived objects (except DO versions), view-private
files and directories, symbolic links, and non-MVFS objects. Note: If a view-private file listed in the CR is converted to an element after the CR is created and has at least one checked-in version, that file is considered to be an element and is listed by –element_only.
- –vie/w_only
- Lists view-private objects only, including checked-out versions of elements. If you specify this option along with –element_only, the listing includes only checked-out versions of elements.
- –cri/tical_only
- Excludes from the listing any objects marked as noncritical in the CR. Objects typically have that property because the user specified the objects as dependents of the .NO_DO_FOR_SIBLING special target in a clearmake makefile or an omake makefile.
- –nam/e tail-pattern
- Restricts the MVFS objects listing to those whose final pathname component match the specified pattern. tail-pattern can include any of the wildcard characters described in the wildcards_ccase reference page.
- –scr/ipts_only
- Restricts the listing to the configuration record header and build script.
Controlling report appearance
- Default
- catcr reports, in three sections, on MVFS objects, on variables and options, and on the build script. The report uses full path names, and it omits comments and directory versions.
- –zer/o
- Includes the CR header and options section, even if the specified filters remove all objects. The listing includes the target name, current view, and so on, but no information on particular file system objects.
- –wd
- Lists path names relative to the current working directory, rather than full path names. With –makefile, lists path names relative to the initial working directory of the build.
- –nxn/ame
- Lists simple path names for MVFS objects, rather than version-extended path names or DO IDs.
- –fol/low
- Lists the link targets only (that is, suppresses printing of the link text).
- –l/ong
- Expands the listing to include the kinds of objects in the CR and comments. With –makefile, adds comments only. For example, an object may be listed as a version, a directory version, or derived object. (See ls –long for a complete list.) Comments indicate whether an object is in a makefile, a referenced derived object, or a new derived object.
- –s/hort
- Restricts the listing to file system objects only (omits header information, variables and options, and build scripts). With –makefile, the listing also includes build scripts.
Specifying the derived object
- Default
- None.
- do-pname ...
- One or more path names, specifying the derived objects whose CRs are to
be included in the listing. A standard or view-extended path name specifies
the DO in the view. An extended path name with a DO ID specifies a particular
DO, irrespective of view (for example, hello.obj@@2007-03-24T11:32.412).
Use the lsdo command to list derived objects with their DO IDs.
do-pname can be a DO version, specified with any version-specification method (standard path name, version-extended path name, and so on).
Examples
- List the CR for a derived object in the current view named bgrs.
cmd-context catcr bgrs
Target bgrs built by jones.dvt
Host "oxygen" running Linux 3.10.0-957.21.3.el7.x86_64 (x86_64)
Reference Time 2021-03-02T17:24:51-05:00, this audit started 2021-03-02T17:24:59-05:00
View was oxygen: /home/jones/views/920615.vws
Initial working directory was vob1/docaux/bgr/linux_x86_64
MVFS objects:
----------------------------
/vobs/docaux/bgr/libbgr/linux_x86_64/libbgr.a@@2021-03-02T17:24:59-05:00
/vobs/docaux/bgr/linux_x86_64/bgrs@@2021-03-02T17:24:59-05:00
/vobs/docaux/bgr/linux_x86_64/buga@@2021-03-02T17:24:59-05:00
.
.
.----------------------------/vobs/docaux/bgr/linux_x86_64/bugs.o@@
2006-12-11T12:03.1902
/vobs/docaux/bgr/linux_x86_64/bugsched.o@@2021-03-02T17:24:59-05:00
.
.
.
----------------------------
Variables and Options:
----------------------------
CC=/usr/bin/cc
CFLAGS=-I../I../libbgr -DBSD -DSCCS -g
ENV_LDFLAGS=../libbgr/linux_x86_64/.a
OBJECTS=main.o pick.o bugs.o bugr.o bugi.o bugf.o bugc.o bugl.o buge.o
bugd.o buga.o bugh.o bugw.o bugfld.o bugdt.o bugu1.o bugu2.o bugsched.o
----------------------------
Build Script:
----------------------------
/usr/bin/cc -I ../libbgr -DBSD -DSCCS -g main.o pick.o bugs.o
bugr.o bugi.o bugf.o bugc.o bugl.o buge.o bugd.o buga.o bugh.o
bugw.o bugfld.o bugdt.o bugu1.o bugu2.o bugsched.o
-o bgrs ../libbgr/linux_x86_64/libbgr.a
---------------------------- - Combine all CRs associated with bgrs.exe and its subtargets into a single
listing.
cmd-context catcr -flat bgrs.exe
----------------------------
MVFS objects:
----------------------------
1 \vob1\docaux\bgr\buga.c@@\main\1 <2006-12-19T11:49:03>
1 \vob1\docaux\bgr\bugc.c@@\main\1 <2006-12-19T11:49:09>
1 \vob1\docaux\bgr\bugd.c@@\main\1 <2006-12-19T11:49:14>
20\vob1\docaux\bgr\bugs.h@@\main\3 <2006-06-17T23:55:22>
1 \vob1\docaux\bgr\bugsched.c@@\main\1 <2006-12-19T11:50:07>
.
.
.
2\vob1\docaux\bgr\bugw.obj@@2006-12-11T12:04.1932
2\vob1\docaux\bgr\main.obj@@2006-12-11T12:03.1896The integer at the beginning of an entry indicates the number of times the object was referenced during the build. For example, \vob1\docaux\bgr\bugs.h was referenced 20 times.
- Excerpt from the CR for the bugsched.o subtarget of
bgrs the versions of elements involved in the build.
cmd-context catcr -select bugsched.o -element_only bgr Target bugsched.o built by akp.user Host "oxygen" running Linux 4.18.0-240.1.1.el8_3.x86_64 Reference Time 2021-03-02T17:24:51-05:00, this audit started 2021-03-02T17:24:59-05:00 View was neptune:/usr/people/akp/views/940615.vws Initial working directory was /vobs/docaux/bgr/linux_x86_64 ---------------------------- MVFS objects: ---------------------------- /vobs/docaux/bgr/bugs.h@@/main/3 <2006-06-17T23:55:22> /vobs/docaux/bgr/bugsched.c@@/main/2 <2006-12-11T15:23:04> /vobs/docaux/bgr/libbgr/stint.h@@/main/2 <2006-09-08T10:06:04> ---------------------------- Variables and Options: ---------------------------- CC=/usr/bin/cc CFLAGS=-I../libbgr -DBSD -DSCCS -g RM=rm -f SRC=.. ---------------------------- Build Script: ---------------------------- rm -f bugsched.o ; /usr/bin/cc -c -I../libbgr -DBSD -DSCCS -g ../bugsched.c ----------------------------
- List only header files (.h extension)
involved in the build of a particular derived object.
cmd-context catcr -name '*.h' bgrs.exe
----------------------------
MVFS objects:
----------------------------
20\vob1\docaux\bgr\bugs.h@@\main\3 <2006-06-17T23:55:22>
19\vob1\docaux\bgr\libbgr\intstint.h@@\main\1 <2006-12-11T11:54:50>
36\vob1\docaux\bgr\libbgr\stint.h@@\main\2 <2006-09-08T10:06:04>
1\vob1\docaux\bgr\spar.h@@\main\1 <2006-12-19T11:50:42> - List the configuration record header and build script only.
cmd-context catcr –scripts_only linux_x86_64/clearmake
Target clearmake built by bert.user
Host "bosco" running Linux 4.18.0-193.28.1.el8_2.x86_64
Reference Time 2021-03-02T17:24:51-05:00, this audit started 2021-03-02T17:24:59-05:00
View was bosco:/export/home/bert/views/bert_V5.0.BL1.vws
Initial working directory was /vobs/clearcase/bin/mmake/linux_x86_64
----------------------------
Build Script:
----------------------------
@echo "linking clearmake"
See also
clearaudit, clearmake, config_spec, diffcr, ls, lsdo, rmdo, wildcards_ccase.dita, DevOps Code ClearCase Guide to Building Software