aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-12-21 14:25:58 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-12-21 14:25:58 +0100
commit309783fee4f46f88f5cddcd5f69c691a329b82b5 (patch)
treea3a1cbb6acf24bf256e62c396184a5ffcf036bce
parentDrastically simplify (diff)
downloadandroid_kernel_wireguard-309783fee4f46f88f5cddcd5f69c691a329b82b5.tar.xz
android_kernel_wireguard-309783fee4f46f88f5cddcd5f69c691a329b82b5.zip
patch-kernel: do not do freaky things to index
-rw-r--r--Android.mk2
-rwxr-xr-xpatch-kernel.sh12
2 files changed, 5 insertions, 9 deletions
diff --git a/Android.mk b/Android.mk
index 6001ce0..4667903 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,7 +6,7 @@ WIREGUARD_PATH := $(call my-dir)
TARGET_KERNEL_BINARIES: patch-wireguard
patch-wireguard:
- @WG_PATCHER_GIT_IGNORE=1 $(WIREGUARD_PATH)/patch-kernel.sh "$(TARGET_KERNEL_SOURCE)"; \
+ @$(WIREGUARD_PATH)/patch-kernel.sh "$(TARGET_KERNEL_SOURCE)"; \
ret=$$?; [ $$ret -eq 0 ] && exit 0; [ $$ret -ne 77 ] && exit $$ret; \
echo -e "" \
"\e[1;37;41m=================================================\e[0m\n" \
diff --git a/patch-kernel.sh b/patch-kernel.sh
index fc57de8..793e92c 100755
--- a/patch-kernel.sh
+++ b/patch-kernel.sh
@@ -29,12 +29,8 @@ chmod +x scripts/fetch-latest-wireguard.sh
[[ $(< scripts/Kbuild.include) == *fetch-latest-wireguard.sh* ]] || echo '$(shell cd "$(srctree)" && ./scripts/fetch-latest-wireguard.sh)' >> scripts/Kbuild.include
-if [[ -d .git ]]; then
- if [[ $WG_PATCHER_GIT_IGNORE -eq 1 ]]; then
- echo -e 'scripts/fetch-latest-wireguard.sh\nnet/.gitignore' >> .gitignore
- git update-index --assume-unchanged .gitignore scripts/Kbuild.include net/Kconfig net/Makefile
- else
- git add scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile
- git commit -s -m "net/wireguard: add wireguard importer" scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile
- fi
+MODIFIED_FILES=( scripts/Kbuild.include scripts/fetch-latest-wireguard.sh net/.gitignore net/Kconfig net/Makefile )
+if [[ -d .git && -n $(git status --porcelain "${MODIFIED_FILES[@]}") ]]; then
+ git add "${MODIFIED_FILES[@]}"
+ git commit -s -m "net/wireguard: add wireguard importer" "${MODIFIED_FILES[@]}"
fi