#!/usr/local/bin/perl -w # Allow knowledgeable users to short-circuit the trigger with this EV. BEGIN { exit 0 if $ENV{CLEARCASE_SKIP_RMNAME_PRE} } # Conceptually this is "use constant MSWIN ..." but ccperl can't do that. # Perl 5.005 and above uses MSWin32, prior versions use Windows_NT. sub MSWIN { ($^O || $ENV{OS}) =~ /MSWin32|Windows_NT/i ? 1 : 0 } # On Windows we must rely on PATH to find cleartool. On Unix, # /usr/atria/bin/cleartool is always a valid path so we use it. my $CT = MSWIN() ? 'cleartool' : '/usr/atria/bin/cleartool'; # Symlinks can't be checked out. exit 0 if -l $ENV{CLEARCASE_PN}; die "Error: checked-out files should not be removed!\n" if qx($CT lsco -s -d -cvi "$ENV{CLEARCASE_PN}"); __END__ =head1 DESCRIPTION This trigger refuses to allow an element to be rmname-d while it's checked out, because naive users often think a file SHOULD be checked out before removal. It's really a teaching tool. =head1 AUTHOR David Boyce (dsb@cleartool.com) =head1 COPYRIGHT Copyright (c) 1998-2002 David Boyce (dsb@cleartool.com), Clear Guidance Consulting. All rights reserved.