Browse Source

🧑‍💻 Strip #errors in Configurations deployment

Scott Lahteine 2 years ago
parent
commit
416fb66118
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      buildroot/share/git/mfconfig

+ 10
- 1
buildroot/share/git/mfconfig View File

74
   # a 'BASE' branch with only defaults as a starting point.
74
   # a 'BASE' branch with only defaults as a starting point.
75
   #
75
   #
76
 
76
 
77
+  SED=$(which gsed sed | head -n1)
78
+
77
   echo "- Initializing BASE branch..."
79
   echo "- Initializing BASE branch..."
78
 
80
 
79
   # Use the import branch as the source
81
   # Use the import branch as the source
82
   # Copy to a temporary location
84
   # Copy to a temporary location
83
   TEMP=$( mktemp -d ) ; cp -R config $TEMP
85
   TEMP=$( mktemp -d ) ; cp -R config $TEMP
84
 
86
 
87
+  # Strip all #error lines
88
+  IFS=$'\n'; set -f
89
+  for fn in $( find $TEMP/config -type f -name "Configuration.h" ); do
90
+    $SED -i~ -e "20,30{/#error/d}" "$fn"
91
+    rm "$fn~"
92
+  done
93
+  unset IFS; set +f
94
+
85
   # Make sure we're not on the 'BASE' branch...
95
   # Make sure we're not on the 'BASE' branch...
86
   git checkout init-repo >/dev/null 2>&1 || exit
96
   git checkout init-repo >/dev/null 2>&1 || exit
87
 
97
 
149
   ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset TPARA..." >/dev/null
159
   ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset TPARA..." >/dev/null
150
 
160
 
151
   # Update the %VERSION% in the README.md file
161
   # Update the %VERSION% in the README.md file
152
-  SED=$(which gsed sed | head -n1)
153
   VERS=$( echo $EXPORT | $SED 's/release-//' )
162
   VERS=$( echo $EXPORT | $SED 's/release-//' )
154
   eval "${SED} -E -i~ -e 's/%VERSION%/$VERS/g' README.md"
163
   eval "${SED} -E -i~ -e 's/%VERSION%/$VERS/g' README.md"
155
   rm -f README.md~
164
   rm -f README.md~

Loading…
Cancel
Save