Re: a patch to replace zipinfo with bsdunzip

"Zhang Wen" ([email protected] via alfs-discuss Mailing List) <[email protected]> Tue, 18 Feb 2025 16:46:06 +0800
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
在 2025/2/18 14:40, Xi Ruoyao ([email protected] via alfs-discuss 
Mailing List) 写道:
>> 在 2025/2/18 7:30, Ken Moffat ([email protected] via alfs-discuss
>> Mailing List) 写道:
>>>
>>> Should that not be -l (lowercase L) rather than -1 ?
>>>
>>> I'm on an older version on this machine, apologies if -1 is now an
>>> option.
>>>
>>>    ĸen
>>>
>>>
> 
> Your patch is broken up by your mail client.
> 
> And it's better to use "bsdtar --list -f" so we don't need awk and tail.
> Using awk would be also problematic if the zip file contains a file name
> with a whitespace (and I don't know if it can be fixed at all).
> 

Thanks for your help, i tested the bsdtar method and it works for me.

diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl
index 0bf4348..fadeac9 100644
--- a/BLFS/xsl/scripts.xsl
+++ b/BLFS/xsl/scripts.xsl
@@ -349,7 +349,7 @@ case $PACKAGE in
        JH_UNPACKDIR=`head -n1 unpacked | cut  -d" " -f2 | sed 
's@^\./@@;s@/.*@@'`
        ;;
     *.zip)
-     zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
+     bsdtar --list -f $SRC_DIR/$PACKAGE &gt; unpacked
        JH_UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
        if test $(wc -w &lt;&lt;&lt; $JH_UNPACKDIR) -eq 1; then
          unzip $SRC_DIR/$PACKAGE

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
0001-replace-zipinfo-with-bsdunzip.patch (text/plain, 820 B)
From 379488a5a3300dfbd9fe2b1899f17b3226a841f6 Mon Sep 17 00:00:00 2001
From: Zhang Wen <[email protected]>
Date: Sun, 16 Feb 2025 00:56:35 +0800
Subject: [PATCH] replace zipinfo with bsdunzip

---
 BLFS/xsl/scripts.xsl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl
index 0bf4348..fadeac9 100644
--- a/BLFS/xsl/scripts.xsl
+++ b/BLFS/xsl/scripts.xsl
@@ -349,7 +349,7 @@ case $PACKAGE in
      JH_UNPACKDIR=`head -n1 unpacked | cut  -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
      ;;
   *.zip)
-     zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
+     bsdtar --list -f $SRC_DIR/$PACKAGE &gt; unpacked
      JH_UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
      if test $(wc -w &lt;&lt;&lt; $JH_UNPACKDIR) -eq 1; then
        unzip $SRC_DIR/$PACKAGE
-- 
2.48.1