Solved

Need a trigger to block mkelem to name elem with space

Posted on 2008-10-14
1
402 Views
Last Modified: 2012-08-13
I am attempting to stop developers from renaming elements with spaces in the filename.  I contacted IBM tech support and they recommend I create a check-in trigger that will fire a Perl script which will check the string pattern for a space (\s or \S) and will either fail and not allow the users to name the element with the space.  I am a novice with ClearCase, and any help or guidance is appreciated in advance.

Please help.
0
Comment
Question by:MADDOGIRISHMAN
1 Comment
 
LVL 39

Accepted Solution

by:
Adam314 earned 500 total points
ID: 22723337
I'm not familiar with ClearCase administration, but from looking around, this should get you close:




***** Create this perl script,

***** save it somewhere all users can access,

***** give it execute permission to all users who will run it

#!/usr/bin/perl

use strict;
 

my $FileName = $ENV{CLEARCASE_PN};

die "You can not use spaces in your file name\n" if $FileName =~ /\s/;
 
 

***** Execute this command at prompt to install the trigger

***** change the /path/to/perl/script.pl to what you saved the above

cleartool mktrtype -c "Trigger to prevent spaces in filenames" -element -all -preop checkin -exec "perl /path/to/perl/script.pl" CHECK_FILENAME_FOR_SPACES

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now