Company Logo

NAVIGATIONVERSION IDENTIFICATION

CM Home
CM Resources
Getting Started
Config. Spec.
CM Procedures
Scripts
Triggers
CM Plan
ClearCase Best Practices
Merging
ClearCase FAQ

set_version

#!/bin/sh
exec Perl $0.bat $*

set_version.bat

@rem = 'Perl, ccperl read this as an array assignment & skip the goto
@echo off
goto endofperl
@rem ';
#!/usr/atria/bin/Perl
#----------------------------------------------------------------------
#    Copyright (C) 1997 - 2001  Highley Recommended, Inc.
#    Full text of copyright terms can be found in files Copying
#    or gpl.html.
#----------------------------------------------------------------------
  local ($NAME, $PURPOSE, $USAGE, $EXAMPLE, $RETURN, $NOTES);

    $NAME = "set_version";

 $PURPOSE = "Purpose: \n" .
	    "Create a C code function file with a \"what\" string \n" .
	    "with the version label selecting the current \n" .
	    "directory and execution login for printing version \n" .
	    "string.  Should be invoked from a make process.\n";

   $USAGE = "Usage: \n" .
	    "$NAME \n";

 $EXAMPLE = "Example: \n" .
	    "$NAME \n";

  $RETURN = "Return: \n" .
	    "0    - completed sucessfully.\n";

   $NOTES = "Notes: \n" .
	    "void version()\n";
#----------------------------------------------------------------------

# Exit Return Values
  local ($Allow, $DisAllow);
  $Allow    = 0;
  $DisAllow = 1;

# Standard Tools:
  local ($Ctool, $Cprompt);
  $Ctool   = "cleartool ";
  $Cprompt = "clearprompt ";

# Check to see if asking for help.
if ($ARGV[0] eq "-help")
{
    system ("$Cprompt" .
	' proceed' .
	' -type ok' .
	' -default proceed' .
	' -mask proceed' .
	' -prompt' .
	' "' .
	"Name:\n" .
	"$NAME\n\n" .
	"$PURPOSE\n" .
	"$USAGE\n" .
	"$EXAMPLE\n" .
	"$NOTES\n" .
	'"' .
	' -prefer_gui');

    exit $Allow;
}

# Get all labels in VOB.
local (*LABEL, $Label, %Labels);
open(LABEL, "$Ctool lstype " .
    '-obsolete ' .
    '-kind lbtype '.
    '-fmt "%n\n" |');

# Create a hash of the labels.
while($Label =