#!/usr/bin/env perl # -*-Perl-*- # # # Perl filter to handle pre-tag checks. This program # records the last directory where tags will be taking place for # use by the tag_accum.pl script. # # Contributed by Mike Sutton use strict vars; use Getopt::Std; # # Configurable options # # Constants (remember to protect strings from RCS keyword substitution) # my $id = getpgrp(); # You *must* use a shell that does setpgrp()! my $LAST_FILE = "/tmp/#cvs.lastdir.$id"; # must match name in tag_accum.pl # # Main Body # # parse command line arguments # my %opts = (); getopts('-d', \%opts); my $debug = 1 if (exists($opts{'d'})); my $tagname = shift; my $tagop = shift; my $repodir = shift; if ($debug != 0) { print STDERR "dir - ", $repodir, "\n"; print STDERR "files - ", join(":", @ARGV), "\n"; print STDERR "id - ", $id, "\n"; } # Record this directory as the last one checked. This will be used # by the tag_accum script to determine when it is processing # the final directory of a multi-directory commit. # open(FILE, ">$LAST_FILE") or die "Cannot open $LAST_FILE, stopped\n"; print FILE "$repodir\n"; close(FILE); exit(0);