diff --git a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-binary.xml b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-binary.xml
index 3c5ce4e2..2e6df778 100644
--- a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-binary.xml
+++ b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-binary.xml
@@ -18,6 +18,7 @@
+
scripts/pre-install.sh
scripts/post-install.sh
diff --git a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-insvc.xml b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-insvc.xml
index 334dc372..9477475e 100644
--- a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-insvc.xml
+++ b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-insvc.xml
@@ -13,6 +13,7 @@
+
diff --git a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-large.xml b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-large.xml
index bf6db8e4..63e01c28 100644
--- a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-large.xml
+++ b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample-large.xml
@@ -18,6 +18,7 @@
+
scripts/pre-install.sh
scripts/post-install.sh
diff --git a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample.xml b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample.xml
index d3461d6c..aaa64a74 100644
--- a/build-tools/stx/patch/EXAMPLES/patch-recipe-sample.xml
+++ b/build-tools/stx/patch/EXAMPLES/patch-recipe-sample.xml
@@ -18,6 +18,7 @@
+
scripts/pre-install.sh
scripts/post-install.sh
diff --git a/build-tools/stx/patch/README.md b/build-tools/stx/patch/README.md
index 21efa0c2..22e0a925 100644
--- a/build-tools/stx/patch/README.md
+++ b/build-tools/stx/patch/README.md
@@ -41,7 +41,7 @@ The patch builder requires the following tags in the input xml (or patch recipe)
scripts/pre-install.sh
scripts/post-install.sh
@@ -81,5 +81,5 @@ $ pip install -r requirements.txt
- Build your patch:
```bash
-$ ./patch_builder.py --recipe EXAMPLES\patch-recipe-sample.xml
+$ ./patch-builder --recipe EXAMPLES\patch-recipe-sample.xml
```
diff --git a/build-tools/stx/patch/metadata.py b/build-tools/stx/patch/metadata.py
index 54b335d3..7c8f92e2 100644
--- a/build-tools/stx/patch/metadata.py
+++ b/build-tools/stx/patch/metadata.py
@@ -20,7 +20,8 @@ from xml.dom import minidom
logger = logging.getLogger('metadata_parser')
utils.set_logger(logger)
-INPUT_XML_SCHEMA = 'config/patch-recipe-schema.xsd'
+PATCH_BUILDER_PATH = os.environ.get('PATCH_BUILDER_PATH')
+INPUT_XML_SCHEMA = f'{PATCH_BUILDER_PATH}/config/patch-recipe-schema.xsd'
# Metadata components
PATCH_ROOT_TAG = 'patch'
@@ -51,6 +52,10 @@ class PatchMetadata(object):
self.binary_packages = []
self.requires = []
+ # Verify if the path to the patch builder folder is set
+ if not PATCH_BUILDER_PATH:
+ raise Exception("Environment variable PATCH_BUILDER_PATH is not set.")
+
def __str__(self):
return json.dumps(self.__dict__)
@@ -211,6 +216,6 @@ class PatchMetadata(object):
if __name__ == "__main__":
- patch_recipe_file = "EXAMPLES/patch-recipe-sample.xml"
+ patch_recipe_file = f"${PATCH_BUILDER_PATH}/EXAMPLES/patch-recipe-sample.xml"
patch_metadata = PatchMetadata(patch_recipe_file)
patch_metadata.parse_input_xml_data()
diff --git a/build-tools/stx/patch/patch_builder.py b/build-tools/stx/patch/patch_builder
similarity index 99%
rename from build-tools/stx/patch/patch_builder.py
rename to build-tools/stx/patch/patch_builder
index dd4a07e9..b604cb39 100755
--- a/build-tools/stx/patch/patch_builder.py
+++ b/build-tools/stx/patch/patch_builder
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (c) 2023 Wind River Systems, Inc.
+# Copyright (c) 2023-2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#