- Introduced a new function `apply_patch` to encapsulate patch application logic.
- The function first checks (using a reverse check) if the patch is
already applied.
- If not, it uses `git apply --check` and `git apply` to apply the patch,
then commits the change.
- Updated `fetch_meta` to call `apply_patch` for all patches instead of
using `git am`.
- This refactoring simplifies the patching process and ensures that
partially applied or faulty patches do not leave the repository
in an inconsistent state.
Added a condition to only execute the git checkout command if a valid
branch_hash is provided.
This prevents the "empty string is not a valid pathspec" error when
branch_hash is empty.
- Replaced hardcoded 'poky' with `$(basename $YOCTO_GIT_URL)` for better
maintainability.
- Ensured compatibility with dynamically fetched URLs for Yocto and
potential future sources.
- Introduced DEFAULT_IMAGE_VERSION and COMPATIBLE_IMAGE_VERSIONS for
flexible version management.
- Mapped multiple compatible versions to a single configuration block
to avoid duplication.
- Ensured IMAGE_VERSION adjusts dynamically based on user input,
with validation against COMPATIBLE_IMAGE_VERSIONS.
- Streamlined environment variable naming and organized source
layer configuration.
- Added conditional execution for Python2 layer fetching based on the
presence of PYTHON2_SRCREV.
This commit improves the script's maintainability and robustness by clarifying version management and optimizing configuration handling.
- Update DIST_BASEDIR assignment to use $DIST_DIR for improved
clarity and consistency in directory management.
- Rename HTTPD_DIST_HOSTNAME and HTTPD_DIST_DIR to
UPDATE_SERVER_URL and DIST_DIR respectively, across the script to
better reflect their purpose and usage.
- Introduce LOCAL_CONFIG_FILE_INC_PATH variable initialization in
the global scope for enhanced script modularity and maintainability.
- Adjust getopt configuration to align with the renamed and newly
introduced variables.