File: features_h_generator.sh

package info (click to toggle)
netplan.io 0.106-2%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,896 kB
  • sloc: python: 23,210; ansic: 11,382; xml: 4,600; sh: 225; makefile: 190
file content (8 lines) | stat: -rwxr-xr-x 345 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
#!/bin/sh
BASE=$(dirname $0)
OUTPUT=$BASE/src/_features.h
INPUT=$BASE/src/[!_]*.[hc]
printf "#include <stddef.h>\nstatic const char *feature_flags[] __attribute__((__unused__)) = {\n" > $OUTPUT
awk 'match ($0, /netplan-feature:.*/ ) { $0=substr($0, RSTART, RLENGTH); print "\""$2"\"," }' $INPUT >> $OUTPUT
echo "NULL, };" >> $OUTPUT
cat $OUTPUT