linux-firmware.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: linux-firmware@kernel.org
Cc: emil.l.velikov@gmail.com
Subject: [PATCH 10/15] copy-firmware: remove unreachable symlink workarounds
Date: Sat, 18 Feb 2023 18:46:16 +0000	[thread overview]
Message-ID: <20230218184621.2026504-11-emil.l.velikov@gmail.com> (raw)
In-Reply-To: <20230218184621.2026504-1-emil.l.velikov@gmail.com>

There are no symlinks in-tree and the earlier commit to check_whence.py
ensures new ones don't get added. Thus we can remove the consistency
checks and pruning code.

With this done we can also drop:
 - the --force argument for ln
 - the prune argument and related handling

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 copy-firmware.sh | 36 +++---------------------------------
 1 file changed, 3 insertions(+), 33 deletions(-)

diff --git a/copy-firmware.sh b/copy-firmware.sh
index e3f3176..0132244 100755
--- a/copy-firmware.sh
+++ b/copy-firmware.sh
@@ -5,7 +5,6 @@
 #
 
 verbose=:
-prune=no
 
 while test $# -gt 0; do
     case $1 in
@@ -14,11 +13,6 @@ while test $# -gt 0; do
             shift
             ;;
 
-        -P | --prune)
-            prune=yes
-            shift
-            ;;
-
         *)
             if test "x$destdir" != "x"; then
                 echo "ERROR: unknown command-line options: $@"
@@ -38,33 +32,9 @@ grep '^File:' WHENCE | sed -e's/^File: *//g' | while read f; do
 done
 
 grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do
-    if test -L "$f"; then
-        test -f "$destdir/$f" && continue
-        $verbose "copying link $f"
-        install -d $destdir/$(dirname "$f")
-        cp -d "$f" $destdir/"$f"
-
-        if test "x$d" != "x"; then
-            target=`readlink "$f"`
-
-            if test "x$target" != "x$d"; then
-                $verbose "WARNING: inconsistent symlink target: $target != $d"
-            else
-                if test "x$prune" != "xyes"; then
-                    $verbose "WARNING: unneeded symlink detected: $f"
-                else
-                    $verbose "WARNING: pruning unneeded symlink $f"
-                    rm -f "$f"
-                fi
-            fi
-        else
-            $verbose "WARNING: missing target for symlink $f"
-        fi
-    else
-        $verbose "creating link $f -> $d"
-        install -d $destdir/$(dirname "$f")
-        ln -sf "$d" "$destdir/$f"
-    fi
+    $verbose "creating link $f -> $d"
+    install -d $destdir/$(dirname "$f")
+    ln -s "$d" "$destdir/$f"
 done
 
 exit 0
-- 
2.39.2


  parent reply	other threads:[~2023-02-18 18:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18 18:46 [PATCH 00/15] Misc fixes, sanity checks and xz/zstd compression Emil Velikov
2023-02-18 18:46 ` [PATCH 01/15] WHENCE: remove trailing white space Emil Velikov
2023-02-18 18:46 ` [PATCH 02/15] WHENCE: remove unnecessary filename quotation Emil Velikov
2023-02-18 18:46 ` [PATCH 03/15] check_whence, WHENCE, copy-firmware: escape filenames with spaces Emil Velikov
2023-02-18 18:46 ` [PATCH 04/15] WHENCE: remove duplicate File entries Emil Velikov
2023-02-18 18:46 ` [PATCH 05/15] check_whence: error on duplicate file entries Emil Velikov
2023-02-18 18:46 ` [PATCH 06/15] check_whence: error on directory listed as File Emil Velikov
2023-02-18 18:46 ` [PATCH 07/15] copy-firmware: remove non-applicable file presence test Emil Velikov
2023-02-18 18:46 ` [PATCH 08/15] check_whence: error if File: is actually a link Emil Velikov
2023-02-18 18:46 ` [PATCH 09/15] check_whence: error if symlinks are in-tree Emil Velikov
2023-02-18 18:46 ` Emil Velikov [this message]
2023-02-18 18:46 ` [PATCH 11/15] copy-firmware: quote deskdir to prevent word splitting Emil Velikov
2023-02-18 18:46 ` [PATCH 12/15] copy-firmware: tweak sed invocation Emil Velikov
2023-02-18 18:46 ` [PATCH 13/15] copy-firmware: quote the output of dirname Emil Velikov
2023-02-18 18:46 ` [PATCH 14/15] copy-firmware: silence the last shellcheck warnings Emil Velikov
2023-02-18 18:46 ` [PATCH 15/15] Makefile, copy-firmware: support xz/zstd compressed firmware Emil Velikov
2023-02-28 14:18 ` [PATCH 00/15] Misc fixes, sanity checks and xz/zstd compression Emil Velikov
2023-02-28 14:36   ` David Woodhouse
2023-02-28 16:46     ` Emil Velikov
2023-02-28 16:48       ` David Woodhouse
2023-02-28 17:02         ` Emil Velikov
2023-02-28 17:03           ` David Woodhouse
2023-02-28 17:20             ` Emil Velikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230218184621.2026504-11-emil.l.velikov@gmail.com \
    --to=emil.l.velikov@gmail.com \
    --cc=linux-firmware@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).