Linux-Firmware Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: linux-firmware@kernel.org
Cc: Josh Boyer <jwboyer@kernel.org>, Steffen Nurpmeso <steffen@sdaoden.eu>
Subject: Re: Question: v20231111 adds rdfind dependency: why not at ball build time?
Date: Sun, 04 Feb 2024 00:06:01 +0100	[thread overview]
Message-ID: <20240203230601.F2O6TNp0@steffen%sdaoden.eu> (raw)
In-Reply-To: <20240103194300.jKoOqQ-g@steffen%sdaoden.eu>

Hello again,

i though i ask again after a month has passed.

Steffen Nurpmeso wrote in
 <20240103194300.jKoOqQ-g@steffen%sdaoden.eu>:
 |Steffen Nurpmeso wrote in
 | <20240102221621.YaA1nlef@steffen%sdaoden.eu>:
 ||Josh Boyer wrote in
 || <CA+5PVA7fCsgSAYDcMq4NSC4u1ax0f=6WmHo76LZsBRe3gvt5og@mail.gmail.com>:
 |||On Sat, Dec 16, 2023 at 5:36 PM Steffen Nurpmeso <steffen@sdaoden.eu> \
 |||wrote:
 |||> Thank you very much for making rdfind an optional thing!
 ...
 |Anyhow.  This diff should also work on github, or wherever "make
 |dist" is run, since cksum, sort, cp, find and xargs should all be
 |available by default.

Is there anything i can do to bring this forward?
I mean, copy-firmware.sh would loose the (now soft) dependency to
rdfind, replacing it with all-POSIX and by-default programs.
I could remove the zstd(1) adjustment (which brings linux-firmware
into alignment with the linux kernel), other than that it seems to
be fine?  Really no interest in keeping the functionality but
without rdfind that is needed for no other purpose?

Ciao already here,

 |--- copy-firmware.sh.orig     2024-01-02 22:30:43.000000000 +0100
 |+++ copy-firmware.sh  2024-01-03 20:38:58.157253235 +0100
 |@@ -40,7 +40,7 @@ while test $# -gt 0; do
 |                 exit 1
 |             fi
 |             # shellcheck disable=SC2209
 |-            compress="zstd --compress --quiet --stdout"
 |+            compress="zstd -T0 --ultra -22 --compress --quiet --stdout"
 |             compext=".zst"
 |             shift
 |             ;;
 |@@ -75,13 +75,6 @@ if [ -z "$destdir" ]; then
 |  exit 1
 | fi
 | 
 |-if ! command -v rdfind >/dev/null; then
 |-     if [ "$skip_dedup" != 1 ]; then
 |-             echo "ERROR: rdfind is not installed.  Pass --ignore-dupli\
 |cates to skip deduplication"
 |-             exit 1
 |-     fi
 |-fi
 |-
 | # shellcheck disable=SC2162 # file/folder name can include escaped symbols
 | grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): \
 | */\1 /;s/"//g' | while read k f; do
 |     test -f "$f" || continue
 |@@ -89,20 +82,34 @@ grep -E '^(RawFile|File):' WHENCE | sed
 |     $verbose "copying/compressing file $f$compext"
 |     if test "$compress" != "cat" && test "$k" = "RawFile"; then
 |         $verbose "compression will be skipped for file $f"
 |-        cat "$f" > "$destdir/$f"
 |+        cp "$f" "$destdir/$f"
 |+    elif [ "$compress" = cat ]; then
 |+        cp "$f" "$destdir/$f"
 |     else
 |         $compress "$f" > "$destdir/$f$compext"
 |     fi
 | done
 | 
 |-if [ "$skip_dedup" != 1 ] ; then
 |+if [ "$skip_dedup" != 1 ]; then
 |  $verbose "Finding duplicate files"
 |-     rdfind -makesymlinks true -makeresultsfile false "$destdir" >/dev/\
 |null
 |-     find "$destdir" -type l | while read -r l; do
 |-             target="$(realpath "$l")"
 |-             $verbose "Correcting path for $l"
 |-             ln -fs "$(realpath --relative-to="$(dirname "$(realpath \
 |-s "$l")")" "$target")" "$l"
 |-     done
 |+    (
 |+    cd "$destdir" && find . -type f | xargs cksum | sort | {
 |+        ls= lf=
 |+        while read s1 s2 f; do
 |+            s="$s1 $s2"
 |+            #$verbose $s $f
 |+            if [ "$s" = "$ls" ] && cmp "$lf" "$f"; then
 |+                $verbose 'duplicate '"${lf##*/}" "${f#./*}"
 |+                rm -f "$f"
 |+                #ln -s "${lf#./*}" "${f#./*}"
 |+                ln -sf "${lf##*/}" "${f#./*}"
 |+            else
 |+                ls=$s
 |+                lf=$f
 |+            fi
 |+        done
 |+    }
 |+    )
 | fi
 | 
 | # shellcheck disable=SC2162 # file/folder name can include escaped symbols

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

      reply	other threads:[~2024-02-03 23:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 21:53 Question: v20231111 adds rdfind dependency: why not at ball build time? Steffen Nurpmeso
2023-11-16 16:57 ` Mario Limonciello
2023-11-17  1:19   ` Steffen Nurpmeso
2023-11-17  1:46     ` Steffen Nurpmeso
2023-12-16 22:36       ` Steffen Nurpmeso
2024-01-02 13:11         ` Josh Boyer
2024-01-02 22:16           ` Steffen Nurpmeso
2024-01-03 19:43             ` Steffen Nurpmeso
2024-02-03 23:06               ` Steffen Nurpmeso [this message]

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=20240203230601.F2O6TNp0@steffen%sdaoden.eu \
    --to=steffen@sdaoden.eu \
    --cc=jwboyer@kernel.org \
    --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 read-only IMAP folder(s) and NNTP newsgroup(s).