blob: 49a334d0909e989c01a4c130e3c3b3d2f3c22957 [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>
Brad Bishopa34c0302019-09-23 22:34:48 -040014[rebased for systemd 243]
15Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080016---
17 meson.build | 4 ----
18 tools/meson-make-symlink.sh | 3 ++-
19 units/meson-add-wants.sh | 7 ++++++-
20 3 files changed, 8 insertions(+), 6 deletions(-)
21
22diff --git a/meson.build b/meson.build
Brad Bishopa34c0302019-09-23 22:34:48 -040023index e5ceb1e169..79b762faeb 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024--- a/meson.build
25+++ b/meson.build
Brad Bishopa34c0302019-09-23 22:34:48 -040026@@ -579,10 +579,6 @@ endforeach
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027
28 conf.set_quoted('TELINIT', get_option('telinit-path'))
29
30-if run_command('ln', '--relative', '--help').returncode() != 0
31- error('ln does not support --relative (added in coreutils 8.16)')
32-endif
33-
34 ############################################################
35
36 gperf = find_program('gperf')
37diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh
Brad Bishopa34c0302019-09-23 22:34:48 -040038index da0d13a341..90bc0a93c2 100755
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039--- a/tools/meson-make-symlink.sh
40+++ b/tools/meson-make-symlink.sh
41@@ -8,5 +8,6 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")"
42 if [ "$(dirname $1)" = . ]; then
Brad Bishopa34c0302019-09-23 22:34:48 -040043 ln -vfs -T "$1" "${DESTDIR:-}$2"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080044 else
Brad Bishopa34c0302019-09-23 22:34:48 -040045- ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
46+ rm -f "${DESTDIR:-}$2"
47+ lnr "${DESTDIR:-}$1" "${DESTDIR:-}$2"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080048 fi
49diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh
Brad Bishopa34c0302019-09-23 22:34:48 -040050index a483d75b86..3c01c523f1 100755
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051--- a/units/meson-add-wants.sh
52+++ b/units/meson-add-wants.sh
53@@ -25,4 +25,9 @@ case "$target" in
Brad Bishopa34c0302019-09-23 22:34:48 -040054 ;;
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080055 esac
56
57-ln -vfs --relative "$unitpath" "$dir"
58+if [ -d "$dir" ]; then
59+ rm -f "$dir/$unit"
60+ lnr "$unitpath" "$dir/$unit"
61+else
62+ lnr "$unitpath" "$dir"
63+fi