X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=clients%2FAmeriquest%2Ftriggers%2FNoPBLs.pl;fp=clients%2FAmeriquest%2Ftriggers%2FNoPBLs.pl;h=d7d128194dbf40ae5d1e42ccc2cd44d194580877;hb=a8c84d2892f07a6863b68a11eb0a4a79ffd71fb5;hp=0000000000000000000000000000000000000000;hpb=95384f94f88aceeb5eef2d322210ba4a438b6512;p=clearscm.git diff --git a/clients/Ameriquest/triggers/NoPBLs.pl b/clients/Ameriquest/triggers/NoPBLs.pl new file mode 100644 index 0000000..d7d1281 --- /dev/null +++ b/clients/Ameriquest/triggers/NoPBLs.pl @@ -0,0 +1,65 @@ +#!/usr/bin/perl +################################################################################ +# +# File: NoPBLs.pl +# Description: This trigger stops all users except for vobadm and Steve Lipson +# (userid to be specified) from checking in PBLs which are +# PowerBuilder libraries and should never be checked into a vob. +# Why Steve Lipson would want this capability is unknown. +# +# Author: Andrew@DeFaria.com +# Created: May 18, 2004 +# Language: Perl +# Modifications: +# +# (c) Copyright 2004, Andrew@DeFaria.com, all rights reserved +# +################################################################################ +use strict; +use warnings; +use File::Spec; + +# This will be set in the BEGIN block but by putting them here the become +# available for the whole script. +my ( + $abs_path, + $me, + $bin_path, + $triggers_path, + $lib_path, + $log_path, + $windows +); + +BEGIN { + # Extract relative path and basename from script name. + $0 =~ /(.*)[\/\\](.*)/; + + $abs_path = (!defined $1) ? "." : File::Spec->rel2abs ($1); + $me = (!defined $2) ? $0 : $2; + + # Check to see if we are running on Windows + $windows = ($^O =~ /MSWin/) ? "yes" : "no"; + + # Setup paths + $bin_path = "$abs_path"; + $triggers_path = "$abs_path/../triggers"; + $lib_path = "$abs_path/../lib"; + $log_path = "$abs_path/../log"; + + # Add the appropriate path to our modules to @INC array. + unshift (@INC, "$lib_path"); +} # BEGIN + +use TriggerUtils; + +my $steve_lipson = "sl020353"; +my $user = $ENV {CLEARCASE_USER}; +my $pname = $ENV {CLEARCASE_PN}; + +if ($pname =~ /\.pbl$/i and lc ($user) !~ $steve_lipson) { + clearmsg "Check in's of pbl's are not allowed except for administrators"; + exit 1; +} # if + +exit 0;