File: features_py_generator.sh

package info (click to toggle)
netplan.io 1.1.2-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,440 kB
  • sloc: python: 34,441; ansic: 13,683; xml: 4,989; javascript: 2,165; sh: 419; makefile: 118
file content (9 lines) | stat: -rwxr-xr-x 320 bytes parent folder | download | duplicates (2)
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