Преглед изворни кода

fix(github-actions/droidspaces): update sed to properly patch get_pid_ns in kernel headers

fix the sed script to correctly handle multi-line static inline get_pid_ns function definitions. add debug grep statements to inspect the file before and after patching.
TheWildJames пре 4 месеци
родитељ
комит
1faea46919
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      .github/actions/droidspaces/action.yml

+ 3 - 1
.github/actions/droidspaces/action.yml

@@ -73,4 +73,6 @@ runs:
       if: inputs.version == 'android12-5.10' || inputs.version == 'android13-5.10'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
-        sed -i '1,/static.*inline.*get_pid_ns/ { /static.*inline.*get_pid_ns/ { s@.*@extern struct pid_namespace *get_pid_ns(struct pid_namespace *ns);@; n; /^[[:space:]]*{[[:space:]]*$/,/^[[:space:]]*}[[:space:]]*$/d; } }' include/linux/pid_namespace.h
+        grep -n "get_pid_ns" include/linux/pid_namespace.h | head -n 5
+        sed -i '1,/static.*inline.*get_pid_ns/ { /static.*inline.*get_pid_ns/ { s@.*@extern struct pid_namespace *get_pid_ns(struct pid_namespace *ns);@; :a; N; /\n[[:space:]]*}[[:space:]]*$/!ba; :b; s/\n.*\n/\n/; tb; s/\n$//; } }' include/linux/pid_namespace.h
+        grep -n "get_pid_ns" include/linux/pid_namespace.h | head -n 5