build_inf_centos: add meta-patches 77/8377/1
authorJackie Huang <jackie.huang@windriver.com>
Tue, 24 May 2022 02:44:32 +0000 (10:44 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Tue, 24 May 2022 03:45:29 +0000 (20:45 -0700)
Issue-ID: INF-274

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: I22592a15d6e84488454496d578ad6d0bbe7ef70f

scripts/build_inf_centos/build_inf_centos.sh
scripts/build_inf_centos/meta-patches/cgcs-root/stx/integ/0001-python-kubernetes-fix-MANIFEST.patch [new file with mode: 0644]
scripts/build_inf_yocto/build_inf_yocto.sh

index 45063f6..b320c34 100755 (executable)
@@ -121,6 +121,8 @@ STX_PRJ_OUTPUT=${WORKSPACE}/prj_output
 STX_MIRROR_DIR=${WORKSPACE}/mirror
 STX_MANIFEST_URL="https://opendev.org/starlingx/manifest"
 
+SRC_META_PATCHES=${SCRIPTS_DIR}/meta-patches
+
 prepare_workspace () {
     msg_step="Create workspace for the CentOS build"
     echo_step_start
@@ -230,11 +232,33 @@ repo_init_sync () {
     echo_step_end
 }
 
-code_adjust () {
-    echo_step_start "Some codes need to be adjusted for INF project"
+patch_src () {
+    echo_step_start "Some source codes need to be patched for INF project"
 
     sed -i "s|/import/mirrors|${STX_MIRROR_DIR}|" \
         $MY_REPO/stx/metal/installer/pxe-network-installer/centos/build_srpm.data
+
+    # Apply meta patches
+    cd ${SRC_META_PATCHES}
+    src_dirs=$(find . -type f -printf "%h\n"|uniq)
+    for d in ${src_dirs}; do
+        cd ${MY_REPO_ROOT_DIR}/${d}
+
+        # backup current branch
+        local_branch=$(git rev-parse --abbrev-ref HEAD)
+        if [ "${local_branch}" = "HEAD" ]; then
+            git checkout ${STX_SRC_BRANCH}
+            local_branch=$(git rev-parse --abbrev-ref HEAD)
+        fi
+        git branch -m "${local_branch}_${TIMESTAMP}"
+        git checkout ${STX_SRC_BRANCH}
+
+        for p in $(ls -1 ${SRC_META_PATCHES}/${d}); do
+            echo_info "Apllying patch: ${SRC_META_PATCHES}/${d}/${p}"
+            git am ${SRC_META_PATCHES}/${d}/${p}
+        done
+    done
+
     echo_step_end
 }
 
@@ -291,7 +315,7 @@ build_image () {
 prepare_workspace
 create_env
 repo_init_sync
-code_adjust
+patch_src
 populate_dl
-build_image_rm
-build_image || true
+#build_image_rm
+build_image
diff --git a/scripts/build_inf_centos/meta-patches/cgcs-root/stx/integ/0001-python-kubernetes-fix-MANIFEST.patch b/scripts/build_inf_centos/meta-patches/cgcs-root/stx/integ/0001-python-kubernetes-fix-MANIFEST.patch
new file mode 100644 (file)
index 0000000..1e6a7a3
--- /dev/null
@@ -0,0 +1,96 @@
+From 75ace02a50caa1f9a9c9a58a7407bdd969dcf1cc Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 11 May 2022 18:33:38 +0800
+Subject: [PATCH] python-kubernetes: fix MANIFEST
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ .../0002-MANIFEST.in-ignore-symlinks.patch         | 34 ++++++++++++++++++++++
+ .../centos/meta_patches/PATCH_ORDER                |  1 +
+ .../patches/0014-MANIFEST.in-ignore-symlinks.patch | 26 +++++++++++++++++
+ 3 files changed, 61 insertions(+)
+ create mode 100644 python/python-kubernetes/centos/meta_patches/0002-MANIFEST.in-ignore-symlinks.patch
+ create mode 100644 python/python-kubernetes/centos/patches/0014-MANIFEST.in-ignore-symlinks.patch
+
+diff --git a/python/python-kubernetes/centos/meta_patches/0002-MANIFEST.in-ignore-symlinks.patch b/python/python-kubernetes/centos/meta_patches/0002-MANIFEST.in-ignore-symlinks.patch
+new file mode 100644
+index 0000000..0a8c6e2
+--- /dev/null
++++ b/python/python-kubernetes/centos/meta_patches/0002-MANIFEST.in-ignore-symlinks.patch
+@@ -0,0 +1,34 @@
++From ed97b779c1ea6d0c2ea434ef8db9a5bf5f0d8ed7 Mon Sep 17 00:00:00 2001
++From: Jackie Huang <jackie.huang@windriver.com>
++Date: Wed, 11 May 2022 18:29:47 +0800
++Subject: [PATCH] MANIFEST.in: ignore symlinks
++
++Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
++---
++ SPECS/python-kubernetes.spec | 3 +++
++ 1 file changed, 3 insertions(+)
++
++diff --git a/SPECS/python-kubernetes.spec b/SPECS/python-kubernetes.spec
++index 9426462..0d672e0 100644
++--- a/SPECS/python-kubernetes.spec
+++++ b/SPECS/python-kubernetes.spec
++@@ -43,6 +43,7 @@ Source12: 0010-Fixes-codestyle-failures.patch
++ Source13: 0011-Fix-Watch-retries-with-410-errors.patch
++ Source14: 0012-Fixes-kubernetes-client-python-issue-1047-ResponseNo.patch
++ Source15: 0013-quick-fix-of-decoding-error-for-BOOKMARK-event.patch
+++Source16: 0014-MANIFEST.in-ignore-symlinks.patch
++ 
++ %if 0%{?with_python2}
++ %package -n python2-%{library}
++@@ -170,6 +171,8 @@ patch -p1 < %{SOURCE15}
++ popd
++ popd
++ 
+++patch -p1 < %{SOURCE16}
+++
++ %build
++ %if 0%{?with_python2}
++ # NOTE: py2_build macro is called py_build in our loadbuild servers
++-- 
++2.29.2
++
+diff --git a/python/python-kubernetes/centos/meta_patches/PATCH_ORDER b/python/python-kubernetes/centos/meta_patches/PATCH_ORDER
+index 926ba15..669982c 100644
+--- a/python/python-kubernetes/centos/meta_patches/PATCH_ORDER
++++ b/python/python-kubernetes/centos/meta_patches/PATCH_ORDER
+@@ -1 +1,2 @@
+ 0001-Include-watch.py-bug-fixes.patch
++0002-MANIFEST.in-ignore-symlinks.patch
+diff --git a/python/python-kubernetes/centos/patches/0014-MANIFEST.in-ignore-symlinks.patch b/python/python-kubernetes/centos/patches/0014-MANIFEST.in-ignore-symlinks.patch
+new file mode 100644
+index 0000000..02f7cc2
+--- /dev/null
++++ b/python/python-kubernetes/centos/patches/0014-MANIFEST.in-ignore-symlinks.patch
+@@ -0,0 +1,26 @@
++From a6aee74ecc35b46d1852a70640c2776df579c533 Mon Sep 17 00:00:00 2001
++From: Jackie Huang <jackie.huang@windriver.com>
++Date: Wed, 11 May 2022 18:17:44 +0800
++Subject: [PATCH] MANIFEST.in: ignore symlinks
++
++Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
++---
++ MANIFEST.in | 3 +++
++ 1 file changed, 3 insertions(+)
++
++diff --git a/MANIFEST.in b/MANIFEST.in
++index f16bc61..f184a7a 100644
++--- a/MANIFEST.in
+++++ b/MANIFEST.in
++@@ -5,5 +5,8 @@ include *.txt
++ include *.ini
++ exclude .gitignore
++ exclude .gitreview
+++exclude */config
+++exclude */stream
+++exclude */watch
++ 
++ global-exclude *.pyc
++-- 
++2.29.2
++
+-- 
+2.7.4
+
index e28f6f7..4a87311 100755 (executable)
@@ -348,7 +348,7 @@ prepare_src () {
 
     echo_step_end
 
-# Not andy meta-patch is needed for the time being, but new ones may be needed and added
+# Not any meta-patch is needed for the time being, but new ones may be needed and added
 # sometime in the future, so just leave these code commented out here.
 #    # Apply meta patches
 #    for l in $(ls -1 ${SRC_META_PATCHES}); do