Skip to content

Commit

Permalink
ALL: Specify -N flag to patch invocations
Browse files Browse the repository at this point in the history
This avoids reversing patches by mistake.

Co-authored-by: Donovan Watteau <contrib@dwatteau.fr>
  • Loading branch information
lephilousophe and dwatteau committed Sep 15, 2024
1 parent ec57fd3 commit cc2530f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ index a75b5e9..3235381 100644
pushd $BUILD_DIR &>/dev/null

get_sources https://github.com/tpoechtrager/xar.git $XAR_VERSION
+ patch -d "$CURRENT_BUILD_PROJECT_NAME" -p1 <<-'EOF'
+ patch -N -d "$CURRENT_BUILD_PROJECT_NAME" -p1 <<-'EOF'
+commit 9047e5820c2a65829100f183dae342700d5cf604
+Author: Le Philousophe <lephilousophe@users.noreply.github.com>
+Date: Sun Jan 24 17:22:23 2021 +0100
Expand Down Expand Up @@ -148,7 +148,7 @@ index a75b5e9..3235381 100644
function build_pbxz()
{
get_sources https://github.com/tpoechtrager/pbzx.git $PBZX_VERSION
+ patch -d "$CURRENT_BUILD_PROJECT_NAME" -p1 <<-'EOF'
+ patch -N -d "$CURRENT_BUILD_PROJECT_NAME" -p1 <<-'EOF'
+commit 3fc6a63b1489c18150cd171f8901d15269a79ea2
+Author: Le Philousophe <lephilousophe@users.noreply.github.com>
+Date: Sun Jan 24 19:06:57 2021 +0100
Expand Down
2 changes: 1 addition & 1 deletion toolchains/common/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ __do_patch () {
if [ -d "$PACKAGE_DIR/patches$suffix" ]; then
for p in "$PACKAGE_DIR/patches$suffix"/*.patch; do
echo "Applying $p"
patch -t -p1 < "$p"
patch -tN -p1 < "$p"
done
fi
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ index 732e96a..babb6f8 100755
+git checkout FETCH_HEAD || { exit 1; }
+
+for p in "$PACKAGE_DIR/$REPO_FOLDER-patches"/*; do
+ patch -p1 < "$p" || { exit 1; }
+ patch -N -p1 < "$p" || { exit 1; }
+done

## Build and install.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ index 096b094..47ec86e 100755
-fi
-cd "$REPO_FOLDER" && git fetch origin && git reset --hard "origin/${REPO_REFERENCE}" && git checkout "${REPO_REFERENCE}" || exit 1
+for p in "$PACKAGE_DIR/$REPO_FOLDER-patches"/*; do
+ patch -p1 < "$p" || { exit 1; }
+ patch -N -p1 < "$p" || { exit 1; }
+done

## Build and install.
Expand All @@ -47,7 +47,7 @@ index ab89aee..5d5ec20 100755
-fi
-cd "$REPO_FOLDER" && git fetch origin && git reset --hard "origin/${REPO_REFERENCE}" && git checkout "${REPO_REFERENCE}" || exit 1
+for p in "$PACKAGE_DIR/$REPO_FOLDER-patches"/*; do
+ patch -p1 < "$p" || { exit 1; }
+ patch -N -p1 < "$p" || { exit 1; }
+done

## Build and install.
Expand Down
4 changes: 2 additions & 2 deletions toolchains/windows-9x/packages/toolchain/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ do_http_fetch binutils $(make_url ${BINUTILS_GROUP} "binutils-${BINUTILS_VERSION

for p in arch/mingw32/*.patch; do
echo "Applying $p"
patch -t -p1 < "$p"
patch -tN -p1 < "$p"
done

./configure --target=${target} --prefix="${prefix}" --disable-werror
Expand All @@ -56,7 +56,7 @@ do_http_fetch gcc $(make_url ${GCC_GROUP} "gcc-${GCC_VERSION}-mingw32-src.tar.xz

for p in arch/mingw32/*.patch; do
echo "Applying $p"
patch -t -p1 < "$p"
patch -tN -p1 < "$p"
done

# Do off tree build
Expand Down

0 comments on commit cc2530f

Please sign in to comment.