Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 2 | Subject: [PATCH 01/12] ltmain.in: Handle trailing slashes on install commands correctly |
| 3 | |
| 4 | A command like: |
| 5 | |
| 6 | libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/image/usr/lib/gnome-keyring/standalone/' |
| 7 | |
| 8 | where the path ends with a trailing slash currently fails. This occurs in |
| 9 | software like gnome-keyring or pulseaudio and is because the comparision |
| 10 | code doesn't see the paths as equal. Strip both paths to ensure this works |
| 11 | reliably. |
| 12 | |
| 13 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 14 | |
| 15 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00010.html] |
| 16 | |
| 17 | diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 18 | index a5f21a1..f884824 100644 |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 19 | --- a/build-aux/ltmain.in |
| 20 | +++ b/build-aux/ltmain.in |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 21 | @@ -2381,8 +2381,14 @@ func_mode_install () |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 22 | func_append dir "$objdir" |
| 23 | |
| 24 | if test -n "$relink_command"; then |
| 25 | + # Strip any trailing slash from the destination. |
| 26 | + func_stripname '' '/' "$libdir" |
| 27 | + destlibdir=$func_stripname_result |
| 28 | + func_stripname '' '/' "$destdir" |
| 29 | + s_destdir=$func_stripname_result |
| 30 | + |
| 31 | # Determine the prefix the user has applied to our future dir. |
| 32 | - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` |
| 33 | + inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` |
| 34 | |
| 35 | # Don't allow the user to place us outside of our expected |
| 36 | # location b/c this prevents finding dependent libraries that |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 37 | -- |
| 38 | 2.25.1 |
| 39 | |