File: d-bootstrap-install-symlinks.patch

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (38 lines) | stat: -rw-r--r-- 1,716 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Date: Thu, 14 Jul 2022 13:17:38 +0200
Subject: Install symlinks as-is, don't dereference them

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.

Forwarded: not-needed
---
 src/tools/rust-installer/install-template.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/tools/rust-installer/install-template.sh b/src/tools/rust-installer/install-template.sh
index f7f408b..a3f0ceb 100644
--- a/src/tools/rust-installer/install-template.sh
+++ b/src/tools/rust-installer/install-template.sh
@@ -617,7 +617,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"
@@ -639,7 +642,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