Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | From bdbafe18c3bf99b3b691cd52b9ccff60f313892d Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 2 | From: Chen Qi <Qi.Chen@windriver.com> |
| 3 | Date: Wed, 27 Jun 2018 16:09:24 +0800 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 4 | Subject: [PATCH 2/5] use lnr wrapper instead of looking for --relative option |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 21 | index 56c98b9..3386546 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 22 | --- a/meson.build |
| 23 | +++ b/meson.build |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 24 | @@ -630,10 +630,6 @@ endforeach |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 36 | index 501cd43..f4e4ac9 100755 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 48 | index e2b2603..210d604 100755 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 | -- |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 63 | 2.7.4 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 64 | |