summaryrefslogtreecommitdiffstats
path: root/config/busybox-1.0.0-pre3/Extract
blob: ed84b04c62ab2de2e7058399119f03c5b890f83e (plain)
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
#!/usr/bin/perl

# find out which version of busybox we have; this is taken from the name
# of this directory
$bb_version = `basename \`pwd\``;
chomp $bb_version;
$bb_version =~ s/busybox-//;

#
# first extract all configuration files from the original source tree
#

@configfiles = `find ../../build/busybox* -name "Config.in"`;

while($_ = shift @configfiles) {
	chomp $_;
	my $filename = $_;   $filename =~ s/(.*\/busybox.*?)\/(.*$)/$2/;
	my $dir = $filename; $dir      =~ s/(.*\/)(.*$)/$1/;
	system("mkdir -p $dir");
	system("../../scripts/mkprefix -v -p BB_ < $_ > $filename");
}


#
# fix some entries 
# 

print "---------------------------------------------------------------------\n";
print "Fixing some stuff...\n";
print "---------------------------------------------------------------------\n";

@fixfiles = `find . -name "Config.in"`;

while($file = shift @fixfiles) {

	open (FILE, "$file");
	@file = <FILE>;
	close FILE;

	for (@file) { $_ =~ s/^source (.*)/source config\/busybox-$bb_version\/$1/g; }
	for (@file) { $_ =~ s/^mainmenu (.*$)/# mainmenu $1/g;           }
	for (@file) { $_ =~ s/^(menu .*)$/$1\n	depends on BUSYBOX/g;    }

	open (FILE, ">$file");
	print FILE @file;
	close FILE;

}