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 291 292 293 294 295 296 297 298 299 300
|
package Grid::GPT::Filelist;
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
#
# NOTE: Filelist.pm will be altered in a future release to include a completely
# different set of functions related directly to the Filelist functionality.
#
# This means that this file will be deprecated! Please use FilelistSort.pm
# in place of Filelist.pm!
#
# NOTE 2: Please make any changes to FilelistSort.pm that you make to Filelist.pm
# (and vice versa) until Filelist.pm this change occurs.
#
require Exporter;
require AutoLoader;
require Grid::GPT::PkgMngmt::Inform;
@ISA = qw(Exporter AutoLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(
);
$VERSION = '0.01';
# Preloaded methods go here.
sub new {
my ($class, %arg) = @_;
my $log = $arg{'log'};
$log = new Grid::GPT::PkgMngmt::Inform() if ! defined $log;
my $me = {
fulllist => [],
flavor => $arg{'flavor'},
log => $log,
};
bless $me, $class;
$me->{'log'}->inform("WARNING: Grid::GPT::Filelist is being depreciated. Use Grid::GPT::FilelistSort instead");
for (@{$arg{'list'}}) {
next if ! m!\w!;
my $entry = {};
m!(.*)/([^/]+)$!;
$entry->{'name'} = $2;
$entry->{'dir'} = $1;
chomp($entry->{'name'});
push @{$me->{'fulllist'}}, $entry;
}
$me->reset();
return $me;
}
sub reset {
my $self = shift;
$self->{'list'} = [];
@{$self->{'list'}} = grep { $_->{'dir'} !~ m!share/globus/packages/! }
grep { $_->{'dir'} !~ m!etc/globus_packages/! }
@{$self->{'fulllist'}};
# need to leave this because of bug that leaves noinst files in the root dir.
@{$self->{'list'}} = grep { $_->{'dir'} =~ m!\w+!
or $_->{'name'} =~ m!\.xml!
or $_->{'name'} =~ m!\.wsdd!
or $_->{'name'} =~ m!setenv!
or $_->{'name'} =~ m!\.properties! }
@{$self->{'list'}};
}
sub flavored_files {
my $self = shift;
my $f = $self->{'flavor'};
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'name'} =~ /[_-]$f/ and $_->{'name'} !~ /\.h$/) {
push @newlist, $_;
next;
}
if ($_->{'dir'} =~ /[_-]$f/ and $_->{'name'} =~ /\.h$/) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub noflavor_files {
my $self = shift;
my $f = $self->{'flavor'};
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'name'} !~ /[_-]$f/ and $_->{'name'} !~ /\.h$/) {
push @newlist, $_;
next;
}
if ($_->{'dir'} !~ /[_-]$f/ and $_->{'name'} =~ /\.h$/) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub flavored_headers {
my $self = shift;
my $f = $self->{'flavor'};
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'name'} =~ /\.h$/
and ($_->{'dir'} =~ m!include/$f! or
$_->{'dir'} =~ m!lib(64)?(/.*)?/include!)) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub noflavor_headers {
my $self = shift;
my $f = $self->{'flavor'};
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'name'} =~ /\.h$/
and ($_->{'dir'} !~ m!include/$f! and
$_->{'dir'} !~ m!lib(64)?(/.*)?/include!)) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_programs {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'dir'} =~ m!(?:/|^)(?:s?bin|libexec|test)(?:/|$)!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_setup_files {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'dir'} =~ m!(?:/|^)setup(?:/|$)!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_static_libs {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ( ( $_->{'name'} =~ m!\.a$!
or $_->{'name'} =~ m!^[^.]*\.so$!
or $_->{'name'} =~ m!^[^.]*\.sl$!
or $_->{'name'} =~ m!^[^.]*\.dylib$! )
and $_->{'name'} =~ m!^lib!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_dynamic_libs {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ( ( $_->{'name'} =~ m!(?:\.so\.|\.[^.]+\.so)!
or $_->{'name'} =~ m!(?:\.sl\.|\.[^.]+\.sl)!
or $_->{'name'} =~ m!(?:\.dylib\.|\.[^.]+\.dylib)! )
and $_->{'name'} =~ m!^lib!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_perl_modules {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'name'} =~ m!\.pm! and $_->{'dir'} =~ m!perl5?!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_libtool_libs {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'name'} =~ /\.la$/ and $_->{'name'} =~ m!^lib!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_docs {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'dir'} =~ m!(?:/|^)(?:share/doc|man)(?:/|$)!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub extract_data {
my $self = shift;
my $list = $self->{'list'};
my @newlist;
for (@{$list}) {
if ($_->{'dir'} !~ m!(?:/|^)(?:share/doc|man|s?bin|libexec|test|include|lib(64)?|perl5?|setup|share/globus/packages)(?:/|$)!) {
push @newlist, $_;
}
}
$self->{'list'} = \@newlist;
}
sub add_package_metadata_files {
my ($self, $type, $flavor) = @_;
$flavor = $self->{'flavor'} if !defined($flavor);
for my $f (@{$self->{'fulllist'}}) {
if ($f->{'name'} eq "${flavor}_$type.filelist" or
$f->{'name'} eq "pkg_data_${flavor}_$type.gpt") {
push @{$self->{'list'}}, $f;
}
}
}
sub get_list {
my $self = shift;
my @list;
for my $f (@{$self->{'list'}}) {
my $line = $f->{'dir'} . "/" . $f->{'name'};
if (grep { $line eq $_ } @list) {
next if ! defined $self->{'log'};
$self->{'log'}->inform("WARNING: $line is a duplicate file entry\n",1);
next;
}
push @list, $line;
}
return \@list;
}
# Autoload methods go after =cut, and are processed by the autosplit program.
1;
__END__
# Below is the stub of documentation for your module. You better edit it!
=head1 NAME
Filelist - Perl extension for blah blah blah
=head1 SYNOPSIS
use Filelist;
blah blah blah
=head1 DESCRIPTION
Stub documentation for Filelist was created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.
Blah blah blah.
=head1 AUTHOR
A. U. Thor, a.u.thor@a.galaxy.far.far.away
=head1 SEE ALSO
perl(1).
=cut
|