annotate
apropos
catcr
catcs
cc.icon
cc.magic
cd
chactivity
chbl
checkin
checkout
checkvob
chevent
chflevel
chfolder
chmaster
chpool
chproject
chstream
chtype
chview
clearaudit
clearbug
cleardescribe
cleardiffbl
cleardiff
clearexport_ccase
clearexport_cvs
clearexport_pvcs
clearexport_rcs
clearexport_sccs
clearexport_ssafe
clearfsimport
cleargetlog
clearhistory
clearimport
clearjoinproj
clearlicense
clearmake
clearmake.options
clearmrgman
clearprojexp
clearprompt
cleartool
clearviewupdate
clearvobadmin
comments
config_ccase
config_spec
cptype
credmap
creds
deliver
describe
diffbl
diffcr
diff
dospace
edcs
endview
env_ccase
events_ccase
export_mvfs
exports_ccase
file
find
findmerge
fmt_ccase
getcache
get
getlog
help
hostinfo
init_ccase
ln
lock
lsactivity
lsbl
lscheckout
lsclients
lscomp
lsdo
lsfolder
lshistory
ls
lslock
lsmaster
lspool
lsprivate
lsproject
lsregion
lsreplica
lssite
lsstgloc
lsstream
lstype
lsview
lsvob
lsvtree
makefile_aix
makefile_ccase
makefile_gnu
makefile_pmake
makefile_smake
makefile_sun
man
merge
mkactivity
mkattr
mkattype
mkbl
mkbranch
mkbrtype
mkcomp
mkdir
mkelem
mkeltype
mkfolder
mkhlink
mkhltype
mklabel
mklbtype
mkpool
mkproject
mkregion
mkstgloc
mkstream
mktag
mktrigger
mktrtype
mkview
mkvob
mount_ccase
mount
msdostext_mode
mvfslog
mvfsstorage
mvfstime
mvfsversion
mv
omake
pathnames_ccase
permissions
profile_ccase
promote_server
protect
protectvob
pwd
pwv
query_language
quit
rebase
recoverview
reformatview
reformatvob
register
relocate
rename
reqmaster
reserve
rgy_backup
rgy_check
rgy_passwd
rgy_switchover
rmactivity
rmattr
rmbl
rmbranch
rmcomp
rmdo
rmelem
rmfolder
rmhlink
rmlabel
rmmerge
rmname
rmpool
rmproject
rmregion
rmstgloc
rmstream
rmtag
rmtrigger
rmtype
rmver
rmview
rmvob
schedule
schemes
scrubber
setactivity
setcache
setcs
setplevel
setsite
setview
shell
snapshot.conf
softbench_ccase
space
startview
type_manager
umount
uncheckout
unlock
unregister
unreserve
update
version_selector
view_scrubber
vob_restore
vob_scrubber
vob_sidwalk
vob_snapshot
vob_snapshot_setup
wildcards_ccase
winkin
xclearcase
xcleardiff
xmldiffmrg
SYNOPSIS
DESCRIPTION
The mkattr command attaches an attribute to one or more objects. You can specify the objects themselves on the command line, or you can specify a particular derived object. In the latter case, mkattr attaches attributes to versions only—some or all of the versions that were used to build that derived object.
An attribute is a name/value pair:
BugNum / 455 | Integer-valued attribute |
BenchMark / 12.9 | Real-valued attribute |
ProjectID / "orange" | String-valued attribute |
DueOn / 5-Jan | Date-value attribute |
Restrictions on Attribute Use
In several situations, attempting to attach a new attribute causes a collision with an existing attribute:
- You want to change the value of an existing attribute on an object.
- (If the attribute type was created with mkattype –vpbranch) An attribute is attached to a version, and you want to attach an attribute of the same type to another version on the same branch.
- (If the attribute type was created with mkattype –vpelement) An attribute is attached to a version, and you want to attach an attribute of the same type to any other version of the element.
A collision causes mkattr to fail and report an error, unless you use the –replace option, which first removes the existing attribute.
Referencing Objects by Their Attributes
The find command can locate objects by their attributes. Examples:
- On
a UNIX system, list all elements in the current working directory for which
some version has been assigned a BugNum attribute.
Now do the same thing on a Windows system; note the difference in quoting.
- List the version of element util.c to which the attribute BugNum has been assigned with the value 4059 (note UNIX quoting).
- On a Windows system, list the version of all elements in the current working directory to which the attribute Tested has been assigned with the string value "TRUE".
More generally, queries written in the query language can access objects using attribute types and attribute values. See the query_language reference page for details.
RESTRICTIONS
Identities
You must have one of the following identities:
Locks
An error occurs if one or more of these objects are locked: VOB, element type, element, branch type, branch, attribute type, object to which the attribute is being attached (for non-file-system objects).
Mastership
(Replicated VOBs only) If the attribute's type is unshared, your current replica must master the type. If the attribute's type is shared, your current replica must master the object to which you are applying the attribute. If the attribute's type is global and shared, your current replica must master the object to which you are applying the attribute; also, your current replica must contain a local copy of the type, or the administrative VOB at the current site must master the type.
OPTIONS AND ARGUMENTS
Moving an Attribute or Changing Its Value
- Default
- An error occurs if an attribute collision
occurs (see “Restrictions on Attribute Use”).
- –rep·lace
- Removes an existing attribute of the same
type before attaching the new one, thus avoiding the collision. (No error
occurs if a collision would not have occurred.)
Specifying the Attribute Type and Value
- Default
- None. You must specify an existing attribute
type; you must also indicate a value, either directly or with the –default option.
- attribute-type-selector
- An attribute type, previously created with mkattype. The attribute type must exist in each VOB containing objects to which you are applying attributes, or (if attribute-type-selector is a global type) in the administrative VOB hierarchy associated with each VOB. Specify attribute-type-selector in the form [attype:]type-name[@vob-selector]
- –def·ault
- If the attribute type was created with a
default value (mkattype –default),
you can use –default attribute-type-name to
specify the name/value pair. An error occurs if the attribute type was not
created with a default value.
- value
- Specifies the attribute's value. The definition
of the attribute type specifies the required form of this argument (for example,
to an integer). It may also restrict the permissible values (for example,
to values in the range 0–7).
Directly Specifying the Objects
The options and arguments in this section specify objects to be assigned attributes directly on the command line. Do not use these options and arguments when using a derived object to provide a list of versions to be assigned attributes.
- object-selector ...
- (Required) One or more names of objects to
be assigned attributes. Specify object-selector in
one of the following forms:
- [ –pna·me ] pname ...
- (Required) One or more pathnames, indicating
objects to be assigned attributes. If pname has
the form of an object selector, you must include the –pname option
to indicate that pname is a pathname.
- A standard or view-extended pathname to an element specifies
the version in the view.
- A version-extended pathname specifies an element, branch,
or version, independent of view.
Examples:
foo.c Version of foo.c selected by current view) /view/gamma/usr/project/src/foo.c Version of foo.c selected by another view foo.c@@\main\5 Version 5 on main branch of foo.c) foo.c@@/REL3 Version of foo.c with version label 'REL3') foo.c@@ The element foo.c foo.c@@\main The main branch of element foo.c Use –version to override these interpretations of pname.
- A standard or view-extended pathname to an element specifies
the version in the view.
- –ver·sion version-selector
- For each pname,
attaches the attribute to the version specified by version-selector.
This option overrides both version-selection by the view and version-extended
naming. See the version_selector reference
page for syntax details.
- –r·ecurse
- Processes the entire subtree of each pname that
is a directory element (including pname itself).
VOB symbolic links are not traversed during the recursive descent into the
subtree.
Note: mkattr differs from some other commands in its default handling of directory element pname arguments: it assigns an attribute to the directory element itself; it does not assign attributes to the elements cataloged in the directory.
Event Records and Comments
- Default
- Creates one or more event records, with commenting
controlled by your .clearcase_profile file (default: –nc).
See the comments reference page. Comments
can be edited with chevent.
- –c·omment comment | –cfi·le comment-file-pname |–cq·uery | –cqe·ach | –nc·omment
- Overrides the default with the option you
specify. See the comments reference page.
Using a Derived Object to Specify Versions
The options and arguments in this section specify versions to be assigned attributes by selecting them from the configuration records associated with a particular derived object. Do not use these options when specifying objects to be assigned attributes directly on the command line.
- –con·fig do-pname
- (Required) Specifies one derived object.
A standard pathname or view-extended pathname specifies the DO that currently
appears in a view. To specify a DO independent of view, use an extended name
that includes a DO ID (for example, hello.o@@24–Mar.11:32.412)
or a version-extended pathname to a DO version.
With the exception of checked-out versions, mkattr attaches attributes to all the versions that would be included in a catcr –flat listing of that derived object. Note that this includes any DO created by the build and subsequently checked in as a DO version.
If the DO's configuration includes multiple versions of the same element, the attribute is attached only to the most recent version.
Use the following options to modify the list of versions to which attributes are attached.
- –sel·ect do-leaf-pattern –ci –nam·e tail-pattern –typ·e { f | d } ...
- Modify the set of versions to be assigned
attributes in the same way that these options modify a catcr listing.
For details, see the catcr reference page
and the Examples section.
EXAMPLES
The UNIX examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the UNIX shell or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.
- Create an attribute type named BugNum. Then, attach that attribute with the value 21 to the version of util.c that fixes bug 21.
- Attach
a TESTED attribute to the version of hello.h in
the view, assigning it the value "TRUE".
UNIX:
Windows:
- Update
the value of the TESTED attribute on hello.h to
"FALSE". This example shows that to overwrite
an existing attribute value, you must use the –replace option.
UNIX:
cmd-context mkattr –replace TESTED '"FALSE"' hello.h
Created attribute "TESTED" on "hello.h@@/main/2".Windows:
- Attach
a RESPONSIBLE attribute to the element (not
a particular version) hello.c.
UNIX:
Windows:
cmd-context mkattr RESPONSIBLE \"Anne\" hello.c@@
Created attribute "RESPONSIBLE" on "hello.c@@". - On a UNIX system, attach a TESTED_BY attribute to the version of util.c in the view, assigning it the value of the USER environment variable as a double-quoted string. Using \" causes the shell to pass through (to cleartool) the double-quote character instead of interpreting it. (Specifying the attribute value as '"$USER"' does not work, because the single quotes suppress environment variable substitution.)
- On a Windows system, attach a TESTED_BY attribute to the version of util.c in the view, assigning it the value of the USERNAME environment variable.
- Attach
a TESTED attribute to the version of foo.c in
the current view, specifying an attribute string value that includes a space.
UNIX:
cmd-context mkattr TESTED '"NOT TRUE"' foo.c
Created attribute "TESTED" on "foo.c@@/main/CHECKEDOUT"Windows:
- On
a Windows system in cleartool interactive mode, attach
an OWNER attribute to the version of bar.c in
the current view.
The same command in cleartool single-command mode shows the difference in quoting.
- Attach a TESTED attribute with the default value to each version that was used to build derived object hello.obj. Note that the attribute is assigned to versions of both files and directories.
- On a UNIX system, attach a TESTED attribute with the value "FALSE" to those versions that were used to build hello, and whose pathnames match the *.c tail pattern.
- On a Windows system, attach a TESTED attribute with the value "FALSE" to those versions that were used to build hello.exe, and whose pathnames match the *.c tail pattern.
- On a Windows system, attach a TESTED attribute with the value "TRUE" to all versions in the VOB mounted at \src\lib that were used to build hello.exe.
- On a UNIX system, attach a TESTED attribute with the value "TRUE" to all versions in the VOB mounted at /src/lib that were used to build hello. Use interactive mode to enable use of the "..." wildcard.