Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 6e62be87a2722fbe531310a1b052c1301bdf06fb Mon Sep 17 00:00:00 2001 |
| 2 | From: Chen Qi <Qi.Chen@windriver.com> |
| 3 | Date: Wed, 27 Jun 2018 16:09:24 +0800 |
| 4 | Subject: [PATCH 2/9] use lnr wrapper instead of looking for --relative option |
| 5 | for ln |
| 6 | |
| 7 | Remove file manually to avoid the 'File Exists' error when creating |
| 8 | symlink. This is because the original 'ln' command uses '-f' option. |
| 9 | |
| 10 | Upstream-Status: Inappropriate [OE-Specific] |
| 11 | |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | Signed-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 | |
| 20 | diff --git a/meson.build b/meson.build |
| 21 | index 04331dd41..6d5edcb4e 100644 |
| 22 | --- a/meson.build |
| 23 | +++ b/meson.build |
| 24 | @@ -558,10 +558,6 @@ endforeach |
| 25 | |
| 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') |
| 35 | diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh |
| 36 | index 501cd43d4..f4e4ac9ac 100755 |
| 37 | --- 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 |
| 47 | diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh |
| 48 | index 70f7172ae..a42666aac 100755 |
| 49 | --- 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 | -- |
| 63 | 2.11.0 |
| 64 | |