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> |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 14 | [rebased for systemd 243] |
| 15 | Signed-off-by: Scott Murray <scott.murray@konsulko.com> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 16 | --- |
| 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 | |
| 22 | diff --git a/meson.build b/meson.build |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 23 | index e5ceb1e169..79b762faeb 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 24 | --- a/meson.build |
| 25 | +++ b/meson.build |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 26 | @@ -579,10 +579,6 @@ endforeach |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 27 | |
| 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') |
| 37 | diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 38 | index da0d13a341..90bc0a93c2 100755 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 39 | --- 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 Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 43 | ln -vfs -T "$1" "${DESTDIR:-}$2" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 44 | else |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 45 | - ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" |
| 46 | + rm -f "${DESTDIR:-}$2" |
| 47 | + lnr "${DESTDIR:-}$1" "${DESTDIR:-}$2" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 48 | fi |
| 49 | diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 50 | index a483d75b86..3c01c523f1 100755 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 51 | --- a/units/meson-add-wants.sh |
| 52 | +++ b/units/meson-add-wants.sh |
| 53 | @@ -25,4 +25,9 @@ case "$target" in |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 54 | ;; |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 55 | 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 |