]> git.ipfire.org Git - thirdparty/linux-firmware.git/commitdiff
copy-firmware.sh: remove no longer reachable test -L
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 22 Sep 2024 16:10:01 +0000 (17:10 +0100)
committerMario Limonciello <superm1@gmail.com>
Thu, 10 Oct 2024 14:33:32 +0000 (14:33 +0000)
The check_whence.py script ensures that links defined in WHENCE are not in-tree.
Since we're calling the script, we no longer need the convoluted path and
associated --prune tag.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
copy-firmware.sh

index da3d9620c9db7c8f64f0d9a6758e4898c6210dcf..66c8d83a3020bdfe34e599cb68ca7b5a263f6648 100755 (executable)
@@ -5,7 +5,6 @@
 #
 
 verbose=:
-prune=no
 # shellcheck disable=SC2209
 compress=cat
 compext=
@@ -28,11 +27,6 @@ while test $# -gt 0; do
             shift
             ;;
 
-        -P | --prune)
-            prune=yes
-            shift
-            ;;
-
         --xz)
             if test "$compext" = ".zst"; then
                 err "cannot mix XZ and ZSTD compression"
@@ -88,39 +82,15 @@ done
 
 # shellcheck disable=SC2162 # file/folder name can include escaped symbols
 grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do
-    if test -L "$f$compext"; then
-        test -f "$destdir/$f$compext" && continue
-        $verbose "copying link $f$compext"
-        install -d "$destdir/$(dirname "$f")"
-        cp -d "$f$compext" "$destdir/$f$compext"
-
-        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$compext"
-                fi
-            fi
-        else
-            $verbose "WARNING: missing target for symlink $f"
-        fi
+    directory="$destdir/$(dirname "$f")"
+    install -d "$directory"
+    target="$(cd "$directory" && realpath -m -s "$d")"
+    if test -e "$target"; then
+        $verbose "creating link $f -> $d"
+        ln -s "$d" "$destdir/$f"
     else
-        directory="$destdir/$(dirname "$f")"
-        install -d "$directory"
-        target="$(cd "$directory" && realpath -m -s "$d")"
-        if test -e "$target"; then
-            $verbose "creating link $f -> $d"
-            ln -s "$d" "$destdir/$f"
-        else
-            $verbose "creating link $f$compext -> $d$compext"
-            ln -s "$d$compext" "$destdir/$f$compext"
-        fi
+        $verbose "creating link $f$compext -> $d$compext"
+        ln -s "$d$compext" "$destdir/$f$compext"
     fi
 done