File: features_py_generator.sh

package info (click to toggle)
netplan.io 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,268 kB
  • sloc: python: 34,640; ansic: 14,096; xml: 4,989; javascript: 2,165; sh: 513; makefile: 118
file content (9 lines) | stat: -rwxr-xr-x 320 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
#!/bin/sh
BASE=$(dirname $0)
OUTPUT=$BASE/netplan_cli/_features.py
INPUT=$BASE/src/[!_]*.[hc]
echo "# Generated file" > $OUTPUT
echo "NETPLAN_FEATURE_FLAGS = [" >> $OUTPUT
awk 'match ($0, /netplan-feature:.*/ ) { $0=substr($0, RSTART, RLENGTH); print "    \""$2"\"," }' $INPUT >> $OUTPUT
echo "]" >> $OUTPUT
cat $OUTPUT