linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
gen-fspec.awk
(1044B)
1 BEGIN {
2 gsub(/\//, "\\/", pkgexclude);
3 }
4
5 function eval_path(path) {
6 gsub(/\$bindir/, bindir, path);
7 gsub(/\$datadir/, datadir, path);
8 gsub(/\$mandir/, mandir, path);
9 gsub(/\$etcdir/, etcdir, path);
10 gsub(/\$libdir/, libdir, path);
11 gsub(/\$libexecdir/, libexecdir, path);
12 gsub(/\$includedir/, includedir, path);
13
14 return path;
15 }
16
17 function eval_source(source) {
18 gsub(/\$dir/, dir, source);
19 return source;
20 }
21
22 function exclude(path) {
23 pattern = "^(" pkgexclude ")$"
24 return pkgexclude != "" && path ~ pattern
25 }
26
27 $1 == "reg" {
28 path = eval_path($3);
29
30 if (exclude(path)) {
31 next
32 }
33
34 print prefix path;
35 print "type=" $1;
36 print "mode=" $2;
37 print "source=" eval_source($4);
38 print "";
39 print "";
40 }
41
42 $1 == "sym" {
43 path = eval_path($3);
44
45 if (exclude(path)) {
46 next
47 }
48
49 print prefix path;
50 print "type=" $1;
51 print "mode=" $2;
52 print "target=" $4;
53 print "";
54 print "";
55 }
56
57 $1 == "dir" {
58 path = eval_path($3);
59
60 if (exclude(path)) {
61 next
62 }
63
64 print prefix path;
65 print "type=" $1;
66 print "mode=" $2;
67 print "";
68 print "";
69 }