]>
Commit | Line | Data |
---|---|---|
2380c486 JR |
1 | #!/usr/bin/perl |
2 | # | |
3 | use strict; | |
4 | use warnings; | |
5 | use File::Find qw(find); | |
6 | ||
7 | my $rpmdir = shift @ARGV or die; | |
8 | my $fileoutdir = shift @ARGV or die; | |
9 | my @tosort; | |
10 | ||
11 | find(\&wanted, "."); | |
12 | ||
13 | sub wanted { | |
14 | return unless -f; | |
15 | return unless /^Kconfig/ or /^Makefile/ or /^Kbuild/; | |
16 | #return if /\.orig$/; | |
17 | return if $File::Find::name =~ /(Documentation|scripts)/; | |
18 | (my $file = $File::Find::name) =~ s#^\./##; | |
19 | $file =~ m#^(.*)/#; | |
20 | my $dir = $1 || ""; | |
21 | my $subdir = ""; | |
22 | foreach my $sub ( split( '/', $dir )) { | |
23 | $subdir .= "/" . $sub; | |
24 | push @tosort, "\%dir $rpmdir$subdir\n"; | |
25 | } | |
26 | push @tosort, "$rpmdir/$file\n"; | |
27 | } | |
28 | ||
29 | my $last = ""; | |
30 | my @toprint = grep {if ($_ ne $last) { $last = $_; 1} else {0}} sort @tosort; | |
31 | ||
32 | open F_OUT, "> $fileoutdir/aux_files" or die "Can't create aux_files: $!\n"; | |
33 | print F_OUT @toprint; | |
34 | close F_OUT and print "aux_files created\n"; | |
35 | ||
36 | open F_OUT, "> $fileoutdir/aux_files_exc" or die "Can't create aux_files_exc: $!\n"; | |
37 | print F_OUT map {"\%exclude $_"} @toprint; | |
38 | close F_OUT and print "aux_files_exc created\n"; |