#!/usr/bin/perl
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
#  
#  
# Licensed Materials - Property of IBM 
#  
# (C) COPYRIGHT International Business Machines Corp. 2007 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)51  1.1  src/csm/core/cmds/csmversion.perl, csmcore, csm_rfish, rfishs001b 1/2/07 13:47:01
#
#  This code provides the build level and date of csm when called
#  Called from csmconfig -V  or run on the command line ( internal)
#
BEGIN
{
    $::csmpm =
      $ENV{'CSM_PM'} ? $ENV{'CSM_PM'} : '/opt/csm/pm';    #for development use
}

use strict;
use locale;
use Getopt::Long;
use Fcntl qw(:flock);
use lib $::csmpm;
use NodeUtils;
use MessageUtils;
use CSMDefs;
use ServerUtils;
%::OSDefs = ServerUtils->get_OSDefs();                    # get OS commands

############################################################
#Main
############################################################
{
    my $filename = "$::OPTCSMINSTALL/csminfo";
    my @build_level   = NodeUtils->runcmd("$::GREP build_level $filename");
    my ($keyword, $releasebuild) = split '=', $build_level[0];
    my @build_date   = NodeUtils->runcmd("$::GREP build_date $filename");
    my ($keyword, $buildtime) = split '=', $build_date[0];
    my $builddata .= $releasebuild;
    $builddata    .= " ";
    $builddata    .= $buildtime;
    $builddata    .= "\n";
    print $builddata;
    exit;

}
