Install symlinks as-is, don't dereference them
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Thu, 14 Jul 2022 11:17:38 +0000 (13:17 +0200)
committerFabian Gruenbichler <debian@fabian.gruenbichler.email>
Sat, 14 Jan 2023 08:38:46 +0000 (08:38 +0000)
Our patch to mdbook installs symlinks to systems versions of font-awesome,
highlight, etc. Upstream mdbook otherwise doesn't use symlinks, so this
doesn't affect anything else that's already generated.

Gbp-Pq: Name d-bootstrap-install-symlinks.patch

src/tools/rust-installer/install-template.sh

index e68be8911916e947e7b22717354e3a2a414bd9f4..a19997be790f802e6e6e8cc636cf8eab77ca45ab 100644 (file)
@@ -625,7 +625,10 @@ install_components() {
 
                    maybe_backup_path "$_file_install_path"
 
-                   if echo "$_file" | grep "^bin/" > /dev/null || test -x "$_src_dir/$_component/$_file"
+                   if [ -h "$_src_dir/$_component/$_file" ]
+                   then
+                       run cp -d "$_src_dir/$_component/$_file" "$_file_install_path"
+                   elif echo "$_file" | grep "^bin/" > /dev/null || test -x "$_src_dir/$_component/$_file"
                    then
                        run cp "$_src_dir/$_component/$_file" "$_file_install_path"
                        run chmod 755 "$_file_install_path"
@@ -647,7 +650,7 @@ install_components() {
 
                    maybe_backup_path "$_file_install_path"
 
-                   run cp -R "$_src_dir/$_component/$_file" "$_file_install_path"
+                   run cp -dR "$_src_dir/$_component/$_file" "$_file_install_path"
                    critical_need_ok "failed to copy directory"
 
                     # Set permissions. 0755 for dirs, 644 for files