From 2648cfd33292a6d4d1610b6f3a9f2add0c201e79 Mon Sep 17 00:00:00 2001 From: Aemiii91 <44569252+Aemiii91@users.noreply.github.com> Date: Mon, 16 Dec 2024 21:18:59 +0100 Subject: [PATCH] Update patch script --- scripts/create_patch.sh | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/scripts/create_patch.sh b/scripts/create_patch.sh index 6985154..de44eea 100755 --- a/scripts/create_patch.sh +++ b/scripts/create_patch.sh @@ -5,7 +5,6 @@ SUBMODULE_DIR="${SUBMODULE_DIR:-submodules/RetroArch}" BUILD_DIR="${BUILD_DIR:-build}" PATCH_DIR="${PATCH_DIR:-patches}" SRC_DIR="${SRC_DIR:-src}" -TEMP_DIR=$(mktemp -d) # Create patches directory if it doesn't exist mkdir -p $PATCH_DIR @@ -21,31 +20,14 @@ NEW_PATCH_NUM=$(printf "%05d" $((LAST_PATCH + 1))) echo -e "\e[33mEnter a descriptive name for the patch file:\e[0m" read PATCH_NAME -# Generate a timestamp for the patch file -TIMESTAMP=$(date +"%Y%m%d_%H%M%S") - # Create the patch file with the descriptive name -PATCH_FILE="$PATCH_DIR/${NEW_PATCH_NUM}_${TIMESTAMP}_${PATCH_NAME}.patch" +PATCH_FILE="$PATCH_DIR/${NEW_PATCH_NUM}_${PATCH_NAME}.patch" echo -e "\e[32mCreating patch file: $PATCH_FILE\e[0m" -# Run make assemble using the temporary directory as the build directory -make assemble \ - BUILD_DIR=$TEMP_DIR \ - SUBMODULE_DIR=$SUBMODULE_DIR \ - PATCH_DIR=$PATCH_DIR \ - SRC_DIR=$SRC_DIR \ - > /dev/null 2>&1 || - exit 1 - -cd $BUILD_DIR && make -f Makefile.miyoomini clean > /dev/null 2>&1 && cd .. - -# Generate the patch, ignoring files in the src directory -rsync -a --exclude-from=<(cd $SRC_DIR && find . -type f) $TEMP_DIR/ $BUILD_DIR/ --delete -git diff --no-index --ignore-space-at-eol $TEMP_DIR $BUILD_DIR > $PATCH_FILE 2> /dev/null - -# Delete the temporary directory -rm -rf $TEMP_DIR +# Generate the patch +cd "$SUBMODULE_DIR" +git diff --no-index --ignore-space-at-eol > $PATCH_FILE 2> /dev/null # Check if the patch file is empty and delete it if it is if [ ! -s $PATCH_FILE ]; then