A user wants to tar up files that have a label applied to them, but sees other files listed in the view that should not be included and wants to know what files will be included in the tar file.
In this example we only want to tar up files that have the RELEASE1 label applied to them, but are not sure if other non-labelled files will also get copied.
EXAMPLE:
The view config spec has the following label rule:
prompt% cleartool catcs
element * CHECKEDOUT
element * RELEASE1
#element * /main/LATEST
The output of a directory listing shows 2 elements with the notation no version selected
prompt% cleartool ls
bar.c@@ [no version selected]
foo.c@@/main/1 Rule: RELEASE1
lost+found@@ [no version selected]
patches@@/main/1 Rule: RELEASE1
Answer
The tar command will not copy files that are not seen in the view or, in the case of the above example, do not have the RELEASE1 label applied to them.
prompt% tar cvf RELEASE1.tar *
tar: bar.c: No such file or directory
a foo.c 1K
tar: lost+found: No such file or directory
a patches/ 0K
a patches/bug_patch 1K
tar: patches/doc_patch: No such file or directory
prompt% ls -l
total 10
-rw-rw-rw- 1 fokeefe user 4096 May 19 16:42 RELEASE1.tar
-r--r--r-- 1 fokeefe user 29 May 19 16:36 foo.c
drwxrwxrwx 2 fokeefe user 162 May 19 16:38 patches
The following command output shows the contents of the tar file where only the labelled files were copied:
prompt% tar tvf RELEASE1.tar
tar: blocksize = 8
-r--r--r-- 22234/20 29 May 19 16:36 2008 foo.c
drwxrwxrwx 22234/20 0 May 19 16:38 2008 patches/
-r--r--r-- 22234/20 29 May 19 16:37 2008 patches/bug_patch
No comments:
Post a Comment