This file is indexed.

/usr/share/perl5/Grid/GPT/DepNode.pm is in grid-packaging-tools 3.6.7-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
package Grid::GPT::DepNode;

use strict;
use Carp;

require Exporter;
use vars       qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS %binary_dependencies);
use Data::Dumper;
require Grid::GPT::BaseNode;
use Grid::GPT::V1::Version;
use Grid::GPT::V1::BinaryDependency;
use Grid::GPT::V1::SourceDependency;

# set the version for version checking
$VERSION     = 0.01;

@ISA = qw(Exporter Grid::GPT::BaseNode);

sub _init {
  my ($me, %args)  = @_;
  $me->{'versions'} = undef;
  $me->{'deptype'} = undef;
  $me->{'disable_version_checking'} = 
    $args{'disable_version_checking'};

  $me->_add_pkgname($args{'name'}) if defined $args{'name'};
  $me->_add_flavor($args{'flavor'}) if defined $args{'flavor'};
  $me->_add_pkgtype($args{'pkgtype'}) if defined $args{'pkgtype'};
  $me->{'versions'} = $args{'versions'} if defined $args{'versions'};

  return if ! defined $args{'depnode'};

  $me->_v1bindep($args{'depnode'}) 
    if ref($args{'depnode'}) eq 'Grid::GPT::V1::BinaryDependency';
  $me->_v1srcdep($args{'depnode'}) 
    if ref($args{'depnode'}) eq 'Grid::GPT::V1::SourceDependency';
  $me->_GPTsrcdep($args{'depnode'}) 
    if ref($args{'depnode'}) eq 'Grid::GPT::GPTSourceDependency';
  $me->_GPTsrcdep($args{'depnode'}) 
    if ref($args{'depnode'}) eq 'Grid::GPT::GPTBinaryDependency';
}


sub _v1bindep {
  my ($me, $obj)  = @_;
  $me->_add_deptype($obj->type());
  $me->_add_pkgname($obj->name());
  $me->_add_flavor($obj->flavor());
  $me->_add_pkgtype($obj->pkg_type());
  $me->{'versions'} = $obj->versions();


}

sub _v1srcdep {
  my ($me, $obj)  = @_;
  $me->_add_deptype($obj->type());
  $me->_add_pkgname($obj->name());

  my $pkgtype = $obj->pkg_type();

  my %srcdep2binpkgtype = (
                           compile => 'dev',
                           pgm_link => 'dev',
                           lib_link => 'dev',
                           Setup => 'pgm',
                          );

  if (! defined $pkgtype) {
    if (defined $srcdep2binpkgtype{$obj->type()}) {
      $pkgtype =  $srcdep2binpkgtype{$obj->type()};
    } else {
      $pkgtype = 'ANY';
    }
  }

  $me->_add_pkgtype($pkgtype);
  $me->_add_flavor('ANY');
  $me->{'versions'} = $obj->versions();
}

sub _GPTbindep {
  my ($me, $obj)  = @_;
  $me->_add_deptype($obj->type());
  $me->_add_pkgname($obj->name());
  $me->_add_flavor($obj->flavor());
  $me->_add_pkgtype($obj->pkg_type());
  $me->{'versions'} = $obj->versions();
}

sub _GPTsrcdep {
  my ($me, $obj)  = @_;
  $me->_add_deptype($obj->type());
  $me->_add_pkgname($obj->name());
  $me->_add_pkgtype($obj->pkg_type());
  $me->{'versions'} = $obj->versions();
}

sub is_same {
  my ($me, $other) = @_;

  return $me->{'depnode'}->is_same($other->{'depnode'});

}

sub is_compatible {
  my ($me, $pkgversion) = @_;

  return 1 if defined $me->{'disable_version_checking'};

  for my $v (@{$me->{'versions'}}) {
    return 1 if $v->is_compatible($pkgversion);
  }
  return 0;
}

sub label {
  my($me, %args) = @_;
  my $result = "$me->{'deptype'}-" . $me->Grid::GPT::BaseNode::label();

  return $result if ! defined $args{'versions'};

  $result .= " Ver Reqs: ";
  for my $v (@{$me->{'versions'}}) {
    $result .= $v->label() . " ";
  }
  return $result;
}

sub printnode {
  my($me) = @_;

  print "/deptype=$me->{'deptype'}->";
  $me->Grid::GPT::BaseNode::printnode();
}

sub formnode {
  my($me) = @_;

  return $me->label();
}


sub AUTOLOAD {
  use vars qw($AUTOLOAD);
  my $self = shift;
  my $type = ref($self) || croak "$self is not an obj";
  my $name = $AUTOLOAD;
  $name =~ s/.*://;   # strip fully-qualified portion
  unless (exists $self->{$name} ) {
    croak "Can't access `$name' field in obj of class $type";
  } 
  if (@_) {
    return $self->{$name} = shift;
  } else {
    return $self->{$name};
  } 
}

sub DESTROY {}
END { }       # module clean-up code here (global destructor)

1;
__END__
# Below is the stub of documentation for your module. You better edit it!

=head1 NAME

Grid::GPT::DepNode - Perl extension for managing the dependencies in binary packages

=head1 SYNOPSIS

  use Grid::GPT::DepNode;
  my $dep = new Grid::GPT::DepNode(versions => \@versions, 
						       name => $name,
						       type => $type,
						       pkg_type => $pkg_type,
						       my_pkg_type => $my_pkg_type);
  my $result = $dep->fulfills_dependency($name, $version, $pkg_type);

=head1 DESCRIPTION

I<Grid::GPT::DepNode> is used to encapsulate a dependency
that one binary package has to another dependency.  These dependencies
are seperated into the following types:

=over 4

=item Compile

Dependency occurs when the package is used for compiling.  Usually
caused by header files including headers from other packages.

=item Build_Link

Dependency occurs when the package is linked to other applications.
This commonly known as dependent libraries.  

=item Regeneration

Dependency occurs when a statically built package needs to be rebuilt
because of updates to dependent packages.  This results in a new
binary package even though nothing inside the package has changed and
the version number has not been updated.

=item Runtime_Link

Dependency occurs when a package needs to load another package's binary at run-time.

=item Runtime

Dependency occurs when a package needs to read a file or execute a
program from another package.

=back

=head1 Methods

=over 4

=item new

Create a new I<Grid::GPT::DepNode> obj.  The function has the following named objs:

=over 4

=item versions

Reference to an array of L<Grid::GPT::V1::Version|Grid::GPT::V1::Version> objs.

=item name

Name of the dependent package.

=item type

The type of dependency.

=item pkg_type

The binary package type of the dependent package.

=item my_pkg_type

The binary package type of the package owning this dependency.

=back

=item fulfills_dependency(name, version, pkg_type)

Returns a 1 if the arguments met the requirements of the
dependency. Returns a 0 if not.  Note that package types pgm and
pgm_static are considered equivalent.

=item write_tag(xml_obj)

Adds dependency contents into an L<Grid::GPT::XML|Grid::GPT::XML> obj. 


=item convert_dependency_hash2xml(dependency_hash_reference, xml_obj)

Class function which adds the contents of all dependency objs in a
hash reference to an L<Grid::GPT::XML|Grid::GPT::XML> obj.

=item create_dependency_hash(xml_obj, package_type_of_dependency_owner)

This is a class function which creates a hash of
I<Grid::GPT::DepNode> objs out of an
L<Grid::GPT::XML|Grid::GPT::XML> obj.  The key to each hash entry
is of the form <name>_<pkg_type>.

=back

=head1 ToDo

=over 4

=item The internal validate function has not been tested. 

=back

=head1 AUTHOR

Eric Blau <eblau@ncsa.uiuc.edu> Michael Bletzinger <mbletzin@ncsa.uiuc,edu>

=head1 SEE ALSO

perl(1) Grid::GPT::XML(1) Grid::GPT::V1::Version(1).

=cut