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 Grünbichler <debian@fabian.gruenbichler.email>
Sat, 30 Dec 2023 13:52:00 +0000 (14:52 +0100)
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 92a3f1f2c983a7e5a0638e30b27a0792c8dee162..d59fc235789196daf1c0a256ba670ca878848515 100644 (file)
@@ -616,7 +616,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"
@@ -638,7 +641,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