deblob-check: fix tarball verification with tar 1.27
[releases.git] / deblob-check
index 9e7457d85b37ad154a7ab961735c192898dd655b..7c31cb1486e9ad3a2023b35666f81c4ea5ea8339 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# deblob-check version 2014-06-08
+# deblob-check version 2014-07-19
 # Inspired in gNewSense's find-firmware script.
 # Written by Alexandre Oliva <lxoliva@fsfla.org>
 
@@ -7591,7 +7591,19 @@ BAD regular expression:
   # Extract or otherwise munge...
   case /$input in
   *.tar*)
-    cmd="tar -xf - --to-command='echo \";/*begin \$TAR_FILENAME*/;\"; cat; echo; echo \";/*end \$TAR_FILENAME*/;\"'"
+    tarwrap=`mktemp -t deblob-check-tarwrap-XXXXXX`
+    tempfiles="$tempfiles $tarwrap"
+    
+    cat >> $tarwrap <<EOF
+#! /bin/sh
+echo='$echo' &&
+$echo ";/*begin \$1*/;" &&
+cat &&
+echo &&
+$echo ";/*end \$1*/;"
+EOF
+    chmod +x $tarwrap
+    cmd="tar -xf - --to-command='$tarwrap \"\$TAR_FILENAME\"'"
     ;;
   *.patch | *.patch.*z* | */patch-* | *.diff | *.diff.*z*)
     if $reverse_patch; then