Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Ismael Luceno (cbd21858672fde7fa02a4abbabea37e98e8022b8)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Ismael Luceno (cbd21858672fde7fa02a4abbabea37e98e8022b8)
  • Date: Tue, 24 Sep 2019 00:24:24 +0000

GIT changes to master sorcery by Ismael Luceno <ismael AT sourcemage.org>:

var/lib/sorcery/modules/libunpack | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit cbd21858672fde7fa02a4abbabea37e98e8022b8
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libunpack: Improve tarball extraction

Add support for pax and for other implementations of tar.

Also use tar's -f flag explicitly; it turns out it is required; the
default source may be something other than stdin.

Fixes: c8e014492903 ("libunpack: Use stdin only implicitly by tar")

diff --git a/var/lib/sorcery/modules/libunpack
b/var/lib/sorcery/modules/libunpack
index c80905f..1eb7338 100755
--- a/var/lib/sorcery/modules/libunpack
+++ b/var/lib/sorcery/modules/libunpack
@@ -214,17 +214,29 @@ uncompress_core() {
## Note: zip is a special case because it doesn't work with streams.
##
#---------------------------------------------------------------------
+
+# Find any viable way to extract a tarball
+for i in pax paxtar tar gtar gnutar bsdtar star busybox toybox; do
+ type "$i" || continue
+ case "$i" in
+ pax)
+ untar(){ pax -r; } ;;
+ busybox|toybox)
+ i+=' tar' ;&
+ tar|gtar|gnutar)
+ i+=' --no-same-permission' ;&
+ *)
+ eval 'untar(){' "$i" '-xof -; }' ;;
+ esac
+ break
+done >/dev/null 2>&1
+
unpack_core() {
debug "libgrimoire" "unpack_core - $*"

case "$2" in
bzip2|gzip|compress*|tar|XZ|xz|LZMA)
- if real_list_find "$3" same-permissions; then
- tar -x 2> /dev/null
- else
- tar --no-same-owner --no-same-permissions -x \
- 2> /dev/null
- fi || cat > /dev/null ;;
+ untar 2>/dev/null || cat > /dev/null ;;
Zip) cat /dev/stdin >/dev/null #get rid of unused output
unzip -q "$1" ;;
7-zip) cat /dev/stdin >/dev/null #get rid of unused output



  • [SM-Commit] GIT changes to master sorcery by Ismael Luceno (cbd21858672fde7fa02a4abbabea37e98e8022b8), Ismael Luceno, 09/23/2019

Archive powered by MHonArc 2.6.24.

Top of Page