-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
0017-Foribly-remove-then-forcibly-mv-in-javareconf.in.patch
28 lines (25 loc) · 1.41 KB
/
0017-Foribly-remove-then-forcibly-mv-in-javareconf.in.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From b15c503e71e0f2edfc1c3ffeb6813bf38ab92ed8 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Tue, 2 Oct 2018 10:48:53 +0100
Subject: [PATCH 17/17] Foribly remove then forcibly mv in javareconf.in
---
src/scripts/javareconf.in | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/scripts/javareconf.in b/src/scripts/javareconf.in
index d23fcfb47d..33b92c4b8c 100644
--- a/src/scripts/javareconf.in
+++ b/src/scripts/javareconf.in
@@ -421,7 +421,10 @@ fi
for file in $files; do
${SED-sed} -e "s|JAVA =.\{0,\}|JAVA = $JAVA|" -e "s|JAVA_HOME =.\{0,\}|JAVA_HOME = ${JAVA_HOME}|" -e "s|: \${JAVA_HOME=.\{1,\}|: \${JAVA_HOME=${JAVA_HOME}}|" -e "s|: \${R_JAVA_LD_LIBRARY_PATH=.\{1,\}|: \${R_JAVA_LD_LIBRARY_PATH=${JAVA_LD_LIBRARY_PATH_SH}}|" -e "s|JAVA_LIBS =.\{0,\}|JAVA_LIBS = ${JAVA_LIBS}|g" -e "s|JAVA_LD_LIBRARY_PATH =.\{0,\}|JAVA_LD_LIBRARY_PATH = ${JAVA_LD_LIBRARY_PATH}|" -e "s|JAVAC =.\{0,\}|JAVAC = $JAVAC|" -e "s|JAVAH =.\{0,\}|JAVAH = $JAVAH|" -e "s|JAR =.\{0,\}|JAR = $JAR|" -e "s|JAVA_CPPFLAGS =.\{0,\}|JAVA_CPPFLAGS = ${JAVA_CPPFLAGS}|g" "${file}" > "${file}.new"
if test -f "${file}.new"; then
- mv "${file}.new" "${file}"
+ if test -f "${file}"; then
+ rm -rf "${file}" >/dev/null 2>&1
+ fi
+ mv -f "${file}.new" "${file}"
else
echo "*** cannot create ${file}.new~*** Please run as root if required.~" | ${SED-sed} -e 'y/~/\n/' >&2
exit 1
--
2.18.0