#!/usr/bin/perl # # This is a helper program. It should live in CVSROOT, and be called # by loginfo, with a line like # ALL cvs_watch_binary.pl %s # which will cause this program to be run with a list of file names # for the arguments. It will then set "cvs watch on" provided the # file shows up as binary. # #Copyright 2002, David H. Thornley. #Permission granted to use under Gnu General Public License, version 2 or later. #This license is available at http://www.thornleyweb.com/perl/license.html #No warranty, express or implied, except by separate agreement. my $file_name; my @status_return; my $reponse_line; my @file_list; foreach $file_name (@ARGV) { @status_return = `cvs status $file_name`; foreach $response_line (@status_return) { if ($response_line =~ /Sticky Options:\s+(\S+)/) { if ($1 =~ /b/) { push @file_list, $file_name; } last; } } } system("cvs", "watch", "on", @file_list); exit 0;