Download

package VerifyODF;
use strict;
use English;
use Carp;
use vars
  qw(@ISA $VERSION $name $author $date $version @instList $numberOfStreams);
@ISA = qw(Module);
use ModuleResources;

# Declare identity, version, author, date, etc.
$name    = __PACKAGE__;
$VERSION = '1.18';
$version = $VERSION;
$author="Dean Hinshaw/Duncan John Fyfe";
$date="2006-07-05";

#
# ChangeLog
# =========
#
# Version 1.18 - 2006-07-05 (DJF)
# ------------
#
# + Changed numberOfStreams to use standerdized function.
#
# Version 1.17 - 2004-02-15 (DJF)
# ------------
#
# + Actually remove tcsfix this time.
#
# Version 1.16 - 2004-02-02 (DJF)
# ------------
#
# + Removed tcsfix.  It has been superseeded by additional tcs file in odf.
#
# Version 1.15 - 2003-07-22 (DJF)
# ------------
#
# + Moved tcsfix call from ingest stage to here
#
# Version 1.14 - 2003-06-20 (DJF)
# ------------
#
# + obssumm removed.  This funtionality is now provided by ppssumm 3.0+
#
# Version 1.13 - 2002-02-22 (DJF)
#
# + Corrected arrangement of linkbar parameters to obssumm
#
# Version 1.12 - 2002-02-22 (DH)
# ------------
#
# + newFile call for pps product index changed to pps run summary.
#
# Version 1.11 - 2002-02-20 (DJF)
# ------------
#
# + Move empty index file creation from obssumm task to module.
# + Add makeemptyindices, indexnames and indexkeys parameters.
# + Add newFile for creation of each empty index.
#
# Version 1.10 - 2002-02-18 (DH)
# ------------
#
# + Add dummyindices='Y' parameter to obssumm.
#
# Version 1.09 - 2001-12-03 (DH)
# ------------
#
# + Change to the way the INDEX.HTM is generated.  Now just make a second instance of
#   the observation summary file with a different name.
#
# Version 1.08 - 2001-05-04 (DH)
# ------------
#
# + Ingnore patch number when comparing versions of odfingest
#
# Version 1.07 - 2001-05-04 (DH)
# ------------
#
# + Add production of html index file INDEX.HTM, which
#   is just a copy of the PPS SUMMARY html file.
#
# Version 1.06 - 2001-03-16 (DH)
# ------------
#
# + Print out version number in performAction() for
#   tracking purposes.
#
# Version 1.05 - 2001-03-08 (DH)
# ------------
#
# + Move obs summary file production to this module.
#
# Version 1.04 - 2001-01-23 (DH)
# ------------
#
# + First production version.
#

@instList=qw(all);

sub numberOfStreams
{
        return 1;
}

sub evaluateRules {
    start() if complete(module => 'Initiate', instrument => 'obs');
}

sub performAction {
    info("Module version number: $version");
    # Verify that the expected version of odfingest was used.

    my $version = commandVersion('odfingest');
    unless( $version =~ /^\s*(\d+\.\d+)/ ){
	info("Version number of 'odfingest' is not in a recognized format");
	return exception();
    }
    my $versionNumber = $1;

    my $summFile = findFile(class => 'odf',
                            content => 'Observation summary');

    my $summVersionNumber;
    foreach( readASCIIFile(name => $summFile) ){
	if( /odfingest\(odfingest-([\d\.]+)\)/ ){
	    $summVersionNumber = $1;
	    info("Version of odfingest used was $summVersionNumber");
	    $summVersionNumber = $1 if $summVersionNumber=~/^(\d+\.\d+)\./;
	    last;
	}	    
    }

    unless( $versionNumber eq $summVersionNumber ){
	info("Wrong version of odfingest used: expected $versionNumber, used $summVersionNumber");
#	return exception();
    }

    return success();
}

1;