2016-08-05 63 views

回答

1

尝试首先,从query_languagecleartool find,语法

cleartool find <vobtag> -element "!{created_since(target-data-time)}" -print 

如果不工作,你将不得不退却到:

  • 列表与所有文件在过去30天内创建的版本
  • 列出所有文件并提取不属于第一个列表的文件。

关于所述第一名单(从“How to determine the last time a VOB was modified”),使用cleartool find

cleartool find <vobtag> -element "{created_since(target-data-time)}" -print 
or 
cleartool find <vobtag> -version "{created_since(target-data-time)}" -print 

该文件还提到了cleartool lshistory -minor -all .,但不可靠,它使用的是可以在任何时候被废弃当地的元数据。

对于第二个清单:

cleartool find . -cview -ele -print 
+0

我试过了第一个选项。但是,因为有成千上万的文件,如果它是正确的,我不是100%确定的。 – user2636464

+0

@ user2636464只需选择一个并查看其版本树,以查看是否有最近30天创建的版本son3 – VonC

+0

顶部的cleartool find命令将用于元素创建日期,而不是版本时间戳记...我认为有一种方法,让我看看我能否创造出一些东西。我相信你可以使用find -version“created_since ...”给你一个有修改的元素列表,然后将它与VOB中所有元素的列表进行比较。 –

1

下面是一个简单的Perl脚本做你问什么。这有一个硬编码的日期字符串,以避免陷入Perl日期算法。它获取VOB中所有元素的列表,然后删除自该列表指定的日期以来修改版本的元素,最后输出未修改的元素。

#!/usr/bin/Perl -w 
my %elem_hash; 
my $datestring="01-jan-2014"; 
my $demarq= "-------------------------------------------------"; 
my $allelemtxt="-- All elements located in the current VOB --"; 
my $ver_hdr ="--  Versions modified since $datestring  --"; 
my $nonmodtext="-- Elements not modified since $datestring --"; 
# 
# Get all elements in the current VOB. 
# 
$cmdout=`cleartool find -all -print`; 
@elemtext=split('\n',$cmdout); 
# 
# Add them to a hashmap, simply because it's easier to delete from this list type 
# 
foreach $elem (@elemtext) 
{ 
    # Quick and dirty way to remove the @@ 
    $elem = substr($elem,0,length($elem)-2); 
    $elem_hash{$elem} = 1; 
} 
# 
printf("\n%s\n%s\n%s\n",$demarq,$allelemtxt,$demarq); 
foreach $elem2 (sort (keys (%elem_hash))) 
{ 
    printf("Element: %s\n",$elem2); 
} 

# 
# Get VERSIONS modified since the specified date string 
# 

$cmdout=`cleartool find -all -version "created_since($datestring)" -print`; 
@vertext=split('\n',$cmdout); 

# 
# strip the trailing version id's and then delete the resulting key from the hashmap. 
# 
printf("\n%s\n%s\n%s\n",$demarq,$ver_hdr,$demarq); 
foreach $version (@vertext) 
{ 
    printf("Version: %s\n",$version); 
    $version=substr($version,0,length($version)-(length($version)- rindex($version,"@@"))); 
    if (exists($elem_hash{$version})) 
    { 
     delete $elem_hash{$version}; 
    } 
} 

printf("\n%s\n%s\n%s\n",$demarq,$nonmodtext,$demarq); 
foreach $elem2 (sort (keys (%elem_hash))) 
{ 
    printf("Element: %s\n",$elem2); 
} 
+0

非常感谢 – user2636464