Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:34

0001 #!/usr/bin/env perl
0002 use DirHandle;
0003 use File::Copy;
0004 $oldfile = @ARGV[0];
0005 $destination = @ARGV[1];
0006 open( INFILE, "$oldfile") || die "ERROR::could not open input file $oldfile";
0007 while( $record = <INFILE> )
0008 {
0009     if($record =~ /LD_LIBRARY_PATH=/){
0010     print "$record\n";
0011     @tok1 = split(/=\"/, $record);
0012     print "@tok1\n";
0013     #pop(@tok1);
0014     #pop(@tok1);
0015     print "this is tok1\n";
0016     print "@tok1[1]\n";
0017     mkdir ($destination);
0018     opendir(LIBS,$destination);
0019     @tokens = split(/\:/,@tok1[1]);
0020     while($#tokens != -1)
0021     {
0022         if(@tokens[$#tokens] =~ /\$/)
0023         {}
0024         else
0025         {
0026         print "token $#tokens @tokens[$#tokens]\n";
0027         opendir( DIR, @tokens[$#tokens]);
0028         @dots = grep {(/\.so/ || /\.a/ || /\.0/)} readdir(DIR);
0029         while($#dots != -1)
0030         {
0031             $foundlink = readlink "$destination\/@dots[$#dots]";
0032 #           print "$foundlink\n";
0033             system `rm $destination\/@dots[$#dots]` if $foundlink;
0034 #           symlink("@tokens[$#tokens]\/@dots[$#dots]","$destination\/@dots[$#dots]");
0035             copy("@tokens[$#tokens]\/@dots[$#dots]","$destination\/@dots[$#dots]");
0036             pop(@dots);
0037         }
0038         print "@dots\n";
0039         }
0040         pop(@tokens);
0041     }
0042     }
0043 }