IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10125


Ignore:
Timestamp:
Nov 21, 2006, 2:32:13 PM (20 years ago)
Author:
Paul Price
Message:

Need to allow redirection when looking up file names from the rules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Config/lib/PS/IPP/Config.pm

    r9898 r10125  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.4 2006-11-07 22:56:41 price Exp $
     3# $Id: Config.pm,v 1.5 2006-11-22 00:32:13 price Exp $
    44
    55package PS::IPP::Config;
     
    164164    }
    165165
    166     my $file = _mdLookupMD($filerules, $name); # The file of interest
     166    my $file = _mdLookupMDwithRedirect($filerules, $name); # The file of interest
    167167    unless (defined $file) {
    168168        carp "Can't find $name within FILERULES in camera configuration.\n";
     
    239239
    240240
     241# Lookup the metadata, checking the type is MD; may be redirection
     242sub _mdLookupMDwithRedirect
     243{
     244    my $mdc = shift;            # Metadata config to look up
     245    my $name = shift;           # Name of item to look ip
     246
     247    # Iterate through the array of hashes
     248    foreach my $item (@$mdc) {
     249        if ($item->{name} eq $name) {
     250            if ($item->{type} eq "STR") {
     251                # Redirect
     252                return _mdLookupMDwithRedirect($mdc, $item->{value});
     253            }
     254            carp "$name within metadata is not of type METADATA.\n" unless $item->{class} eq "metadata";
     255            return $item->{value};
     256        }
     257    }
     258
     259    carp "Unable to find $name within metadata.\n";
     260    return undef;
     261}
     262
     263
    2412641;
    242265
Note: See TracChangeset for help on using the changeset viewer.