[jhalfs] branch trunk updated: BLFS tools: fix test for .zip files
| Newsgroups | gmane.linux.lfs.automated |
|---|---|
| Message-ID | <178690021937.2825066.10243566813366008427@rivendell.linuxfromscratch.org> |
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch trunk
in repository jhalfs.
The following commit(s) were added to refs/heads/trunk by this push:
new 84b2664 BLFS tools: fix test for .zip files
84b2664 is described below
commit 84b2664632e3e3655a7c681ea3b7375db095c218
Author: Pierre Labastie <[email protected]>
AuthorDate: Sun Aug 16 19:01:36 2026 +0200
BLFS tools: fix test for .zip files
There is a test to determine whether the zip file contains
only one top directory (plus subdirs) or more. The test uses
python -m zipfile -l, then sed '@/.*@@' |uniq on the result.
If there
is only one directory with subdirs, then this should produce a
one line output. But unfortunately python -m zipfile -l produces
a header
line, which adds to other lines containing top directory(ies) and
the test fails to report a unique top dir.
But this line does not contain `/', so it is not printed by
sed -n '@/.*@@p'. Using this sed expression thus fixes the issue.
---
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 1f18792..4741f0b 100644
--- a/BLFS/xsl/scripts.xsl
+++ b/BLFS/xsl/scripts.xsl
@@ -1189,7 +1189,7 @@ case $PACKAGE in
;;
*.zip)
python3 -m zipfile -l $SRC_DIR/$PACKAGE > unpacked
- JH_UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
+ JH_UNPACKDIR="$(sed -n 's@/.*@@p' unpacked | uniq )"
if test $(wc -w <<< $JH_UNPACKDIR) -eq 1; then
python3 -m zipfile -e $SRC_DIR/$PACKAGE .
else
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
--
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page