qnap-dev / qdk2

QPKG development tool
34 stars 15 forks source link

Unable to extract some QPKGs (unexpected EOF) #7

Closed virtualdj closed 5 years ago

virtualdj commented 5 years ago

Hi, I normally build the QPKGs on a QNAP with the QDK 2.3.3 available on the QNAP site.

Unfortunately, there are some of them that I'm not able to extract with QDK2:

  1. Those with a compression different from gzip (apparently QDK2 only supports gzip?)
  2. Some others QPKGs that give tar errors at the end, so that QDK2 returns a non-zero exit code

In the second case, this is an example (QPKG can be downloaded from here):

root@debian:~/qnap/qdk2/bin#` DEBUG=1 ./qdk2 extract TVHeadend_0.9.4.2_x86_64.qpkg
... cut ...
./bin/libc/librt.so.1
./bin/libc/libresolv.so.2
./bin/libc/tvh-loader
./bin/libc/libgcc_s.so.1
./bin/tvh-rename
./bin/tvheadend

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
[18:14:17][WARNING] Error in extracting: Command '['tar', 'xvf', './data.tar.gz', '-C', './shared']' returned non-zero exit status 2

But the same file extracts correctly with QDK 2.3.3 on the QNAP and also installs correctly without any warning messages. I saw this line on the sources, is this problem related to it? Can this be fixed?

virtualdj commented 5 years ago

Any news? With the latest git version (dbaeb8ed4) and the same file linked above I still get:

./bin/libc/librt.so.1
./bin/libc/libresolv.so.2
./bin/libc/tvh-loader
./bin/libc/libgcc_s.so.1
./bin/tvh-rename
./bin/tvheadend

gzip: stdin: decompression OK, trailing garbage ignored
./.qpkg_icon_gray.gif
tar: Child returned status 2
tar: Error is not recoverable: exiting now
[13:34:20][WARNING] Error in extracting: Command '['tar', 'xvf', './data.tar.gz', '-C', './shared']' returned non-zero exit status 2
edhongcy commented 5 years ago

Hi @virtualdj The reason for gzip decompress warning is https://github.com/qnap-dev/QDK/blob/master/shared/bin/qbuild#L947 QDK add flag in data.tar.gz tail.
But it warning does not affect the content of the data.

PS:NAS gzip is busybox so omit warning message.