~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/moocho/config/strip_dup_incl_paths.pl

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
# This perl script removes duplicate include paths left to the right
3
 
use strict;
4
 
my @all_incl_paths = @ARGV;
5
 
my @cleaned_up_incl_paths;
6
 
foreach( @all_incl_paths ) {
7
 
        $_ = remove_rel_paths($_);
8
 
        if( !($_=~/-I/) ) {
9
 
                push @cleaned_up_incl_paths, $_;
10
 
        }
11
 
        elsif( !entry_exists($_,\@cleaned_up_incl_paths) ) {
12
 
                push @cleaned_up_incl_paths, $_;
13
 
        }
14
 
}
15
 
print join( " ", @cleaned_up_incl_paths );
16
 
#
17
 
# Subroutines
18
 
#
19
 
sub entry_exists {
20
 
        my $entry = shift; # String
21
 
        my $list  = shift; # Reference to an array
22
 
        foreach( @$list ) {
23
 
                if( $entry eq $_ ) { return 1; }
24
 
        }
25
 
        return 0;
26
 
}
27
 
#
28
 
sub remove_rel_paths {
29
 
        my $entry_in = shift;
30
 
        if ($entry_in=~/-I\.\./) {
31
 
                return $entry_in;
32
 
        }
33
 
        my @paths = split("/",$entry_in);
34
 
        my @new_paths;
35
 
        foreach( @paths ) {
36
 
                if( !($_=~/\.\./) ) {
37
 
                        push @new_paths, $_;
38
 
                }
39
 
                else {
40
 
                        pop @new_paths
41
 
                }
42
 
        }
43
 
        return join("/",@new_paths);
44
 
}