File: fix-link.pl

package info (click to toggle)
kde-dev-scripts 4%3A18.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,496 kB
  • sloc: perl: 15,466; lisp: 5,627; sh: 4,157; python: 3,892; ruby: 2,158; makefile: 16; sed: 9
file content (183 lines) | stat: -rwxr-xr-x 6,275 bytes parent folder | download | duplicates (6)
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
#!/usr/bin/perl

# laurent Montel <montel@kde.org> 2007 GPL
# This script will remove not necessary cmake variable (already defined by dependancy)
#

use File::Basename;
use lib dirname( $0 );
use functionUtilkde;
use strict;

open(my $F, "-|", qw(find . -name CMakeLists.txt));
my $file;
my $warning;
while ($file = <$F>) {
    chomp $file;
    next if functionUtilkde::excludeFile( $file);
    my $modified;
    open(my $FILE, $file) or warn "We can't open file $file:$!\n";
    my @l = map {
	my $orig = $_;

	if( /KDE4_KWALLETCLIENT_LIBS/ )
	{
		s!\${/KDE4_KWALLETCLIENT_LIBS} !!;
	}
	if( /KDE4_KSPELL2_LIBS/ )
	{
		s!\${KDE4_KSPELL2_LIBS} !!;
	}
        if( /KDE4_KDEPRINT_LIBS/ )
        {
                s!\${KDE4_KDEPRINT_LIBS} !!;
        }
    	if ( /target_link_libraries/ or /TARGET_LINK_LIBRARIES/) {
                if( $_ =~ m/\${KDE4_KDECORE_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }
		if( $_ =~ m/\${KDE4_KIO_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
		{
			s!\${KDE4_KDEUI_LIBS} !!;
		}
		# dependancy for kfile
                if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDEUI_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }                
		if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
                {
                        s!\${KDE4_KIO_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_SOLID_LIBS}/ )
                {
                        s!\${KDE4_SOLID_LIBS} !!;
                }
 		# dependancy for kdesu
                if( $_ =~ m/\${KDE4_KDESU_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDESU_LIBS} !!;
                }
		# dependancy for kparts
		if( $_ =~ m/\${KDE4_KPARTS_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KPARTS_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDEUI_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KPARTS_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
                {
                        s!\${KDE4_KIO_LIBS} !!;
                }
		#dependancy for knewstuff2
                if( $_ =~ m/\${KDE4_KNEWSTUFF2_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
                {
                        s!\${KDE4_KIO_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KNEWSTUFF2_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KNEWSTUFF2_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDEUI_LIBS} !!;
                }
		#dependancy for kutils
                if( $_ =~ m/\${KDE4_KUTILS_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }

                if( $_ =~ m/\${KDE4_KUTILS_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDEUI_LIBS} !!;
                }
		#dependancy for khtml
		if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
		{
			s!\${KDE4_KDECORE_LIBS} !!;
		}
                if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
                {
                        s!\${KDE4_KIO_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDEUI_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KPARTS_LIBS}/ )
                {
                        s!\${KDE4_KPARTS_LIBS} !!;
                }
		#dependancy for ktexteditor
                if( $_ =~ m/\${KDE4_KTEXTEDITOR_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KTEXTEDITOR_LIBS}/ and $_ =~ m/\${KDE4_KPARTS_LIBS}/ )
                {
                        s!\${KDE4_KPARTS_LIBS} !!;
                }
		#dependancy for KDE4_KPIMIDENTITIES_LIBS
		if( $_ =~ m/\${KDE4_KPIMIDENTITIES_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KPIMIDENTITIES_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDEUI_LIBS} !!;
                }
                if( $_ =~ m/\${KDE4_KPIMIDENTITIES_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
                {
                        s!\${KDE4_KIO_LIBS} !!;
                }
		#dependancy for KDE4_KDNSSD_LIBS
		if( $_  =~ m/\${KDE4_KDNSSD_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
                {
                        s!\${KDE4_KDECORE_LIBS} !!;
                }
                if( $_  =~ m/\${KDE4_KDNSSD_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
                {
                        s!\${KDE4_KDEUI_LIBS} !!;
                }

		# Not remove them it will necessary when we removed kde3support into apps.
		#if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
		#{
		#	s!\${KDE4_KDECORE_LIBS} !!;
		#}
		#if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
		#{
		#        s!\${KDE4_KDECORE_LIBS} !!;
		#}
		#if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
		#{
		#        s!\${KDE4_KDEUI_LIBS} !!;
		#}
		#if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
		#{
		#        s!\${KDE4_KIO_LIBS} !!;
		#}
		#if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KPARTS_LIBS}/ )
		#{
		#        s!\${KDE4_KPARTS_LIBS} !!;
		#}
	}
	$modified ||= $orig ne $_;
	$_;
    } <$FILE>;

    if ($modified) {
	open (my $OUT, ">", $file);
	print $OUT @l;
    }

}
functionUtilkde::diffFile( <$F> );