This repository has been archived by the owner on Jul 9, 2023. It is now read-only.
forked from salva/ring3k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-packagemap.pl
74 lines (70 loc) · 1.92 KB
/
gen-packagemap.pl
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
#!/usr/bin/perl
# generate a packagemap definition from the ring3k git repository
open(IN,"git ls-tree -r --name-only HEAD|") || die "git ls-tree failed";
open(OUT,">packagemap.xml");
print OUT "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print OUT "<fileset>\n";
while(<IN>)
{
chomp;
my $file = $_;
# ignore some files
next if ($file =~ /\.gitignore$/ );
next if ($file =~ /README$/ );
next if ($file =~ /^COPYING\.LIB$/ );
next if ($file =~ /install-sh$/ );
next if ($file =~ /^documents/ );
next if ($file =~ /^configure$/ );
next if ($file =~ /^config\.sub$/ );
next if ($file =~ /^config\.guess$/ );
next if ($file =~ /^config\.status$/ );
next if ($file =~ /config\.h\.in$/ );
next if ($file =~ /^TODO$/ );
next if ($file =~ /\.rc$/ );
next if ($file =~ /\.bmp$/ );
next if ($file =~ /\.ico$/ );
next if ($file =~ /\.dat$/ );
next if ($file =~ /ntwin32\.in$/ );
# classify everything else
if ($file =~ /^ring3k-setup\.in$/ ) {
$type = "shell";
} elsif ($file =~ /^ring3k\.in$/ ) {
$type = "shell";
} elsif ($file =~ /^runtest$/ ) {
$type = "shell";
} elsif ($file =~ /\.cpp$/ ) {
$type = "C++";
} elsif ($file =~ /kernel\/.*\.h$/ ) {
$type = "C++";
} elsif ($file =~ /\.inl$/ ) {
$type = "C++";
} elsif ($file =~ /\.h$/ ) {
$type = "C";
} elsif ($file =~ /\.c$/ ) {
$type = "C";
} elsif ($file =~ /Makefile\.in$/ ) {
$type = "makefile";
} elsif ($file =~ /Make\.rules\.in$/ ) {
$type = "makefile";
} elsif ($file =~ /\.pro$/ ) {
$type = "makefile";
} elsif ($file =~ /^configure.ac$/ ) {
$type = "autoconf";
} elsif ($file =~ /\.xml\.in$/ ) {
$type = "xml";
} elsif ($file =~ /\.xml$/ ) {
$type = "xml";
} elsif ($file =~ /\.pl$/ ) {
$type = "perl";
} elsif ($file =~ /\.svg$/ ) {
$type = "svg";
} else {
print STDERR "unclassified file $file\n";
next;
}
print OUT " <path>$file</path>\n";
print OUT " <type>$type</type>\n";
}
print OUT "</fileset>\n";
close IN;
close OUT;