blob: df5506cc2b985df1fb3013f71ff8a68e80248ac2 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From bdbafe18c3bf99b3b691cd52b9ccff60f313892d Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 27 Jun 2018 16:09:24 +0800
Brad Bishop19323692019-04-05 15:28:33 -04004Subject: [PATCH 2/5] use lnr wrapper instead of looking for --relative option
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005 for ln
6
7Remove file manually to avoid the 'File Exists' error when creating
8symlink. This is because the original 'ln' command uses '-f' option.
9
10Upstream-Status: Inappropriate [OE-Specific]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14---
15 meson.build | 4 ----
16 tools/meson-make-symlink.sh | 3 ++-
17 units/meson-add-wants.sh | 7 ++++++-
18 3 files changed, 8 insertions(+), 6 deletions(-)
19
20diff --git a/meson.build b/meson.build
Brad Bishop19323692019-04-05 15:28:33 -040021index 56c98b9..3386546 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022--- a/meson.build
23+++ b/meson.build
Brad Bishop19323692019-04-05 15:28:33 -040024@@ -630,10 +630,6 @@ endforeach
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025
26 conf.set_quoted('TELINIT', get_option('telinit-path'))
27
28-if run_command('ln', '--relative', '--help').returncode() != 0
29- error('ln does not support --relative (added in coreutils 8.16)')
30-endif
31-
32 ############################################################
33
34 gperf = find_program('gperf')
35diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh
Brad Bishop19323692019-04-05 15:28:33 -040036index 501cd43..f4e4ac9 100755
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037--- a/tools/meson-make-symlink.sh
38+++ b/tools/meson-make-symlink.sh
39@@ -8,5 +8,6 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")"
40 if [ "$(dirname $1)" = . ]; then
41 ln -vfs -T "$1" "${DESTDIR:-}$2"
42 else
43- ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
44+ rm -f "${DESTDIR:-}$2"
45+ lnr "${DESTDIR:-}$1" "${DESTDIR:-}$2"
46 fi
47diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh
Brad Bishop19323692019-04-05 15:28:33 -040048index e2b2603..210d604 100755
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080049--- a/units/meson-add-wants.sh
50+++ b/units/meson-add-wants.sh
51@@ -25,4 +25,9 @@ case "$target" in
52 ;;
53 esac
54
55-ln -vfs --relative "$unitpath" "$dir"
56+if [ -d "$dir" ]; then
57+ rm -f "$dir/$unit"
58+ lnr "$unitpath" "$dir/$unit"
59+else
60+ lnr "$unitpath" "$dir"
61+fi
62--
Brad Bishop19323692019-04-05 15:28:33 -0400632.7.4
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064