Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
awk -v 'objtype='$objtype '
4
BEGIN{
5
	if(ARGC < 2)
6
		exit;
7
	collect = isdev = 0;
8
}
9
 
10
/^[ \t]*$/{
11
	next;
12
}
13
/^#/{
14
	next;
15
}
16
collect && /^[^	\t]/{
17
	collect = isdev = 0;
18
}
19
collect && $0 ~ /[^ \t]+/{
20
	if(isdev)
21
		obj["dev" $1 "'.$O'"]++;
22
	else
23
		obj[$1 "'.$O'"]++;
24
	for(i = 2; i <= NF; i++){
25
		if($i !~ "[+=-].*")
26
			obj[$i "'.$O'"]++;
27
	}
28
}
29
$0 ~ /^[^ \t]/{
30
	if($1 ~ "dev"){
31
		isdev = 1;
32
		collect = 1;
33
	}
34
	else if($1 ~ "misc" || $1 ~ "link" || $1 ~ "ip")
35
		collect = 1;
36
	next;
37
}
38
 
39
END{
40
	x = ""
41
	for(i in obj)
42
		x = x i "\n";
43
	if(objtype ~ "386" && obj["pci" "'.$O'"])
44
		x = x "bios32'.$O' \n";
45
	printf x;
46
}' $*