Menu

Problems with OS X .pkg tar file

Help
Choldra
2015-08-01
2015-08-04
  • Choldra

    Choldra - 2015-08-01

    I have an OS X 10.9 installer package (.pkg) file, which is 924.087.081 bytes in size.

    When I try and extract files from it with 7-Zip 15.05 beta (64-bit) on Windows 8.1, I get a message saying "Warnings: There are some data after the payload data", and 7-Zip only extracts a file named Payload~, which is 188.893.696 bytes in size.

    On the other hand, the command tar -x on OS X 10.9.5 will extract 18 folders and 2 files, which total 929.175.396 bytes in size.

    17 of those folders also have the extension .pkg and contain files named Payload.

    If I copy those folders and files to Windows and extract files from the Payload file in the first folder with 7-Zip, I get the same file named Payload~ that was the only file that 7-Zip could extract in the first place.

    It would seem that 7-Zip assumes that a .pkg file would have only one file named Payload, and ignores all data inside the others.

     

    Last edit: Choldra 2015-08-01
  • Choldra

    Choldra - 2015-08-01

    By the way, AnyToISO 3.7.0 for Windows was able to extract the same files as tar -x on OS X 10.9.5, without errors.

     

    Last edit: Choldra 2015-08-01
  • Igor Pavlov

    Igor Pavlov - 2015-08-01

    Most pkg files are "XAR" archives.
    Try the command:

    7z l arcname.pkg -slt -t* >list.txt
    

    What exact command did you use with TAR?

     
  • Choldra

    Choldra - 2015-08-01

    Dear Igor,

    First of all, thank you for your excellent work and prompt reply.

    I misspelt the name of the command I used on OS X, it was actually xar -x ("xar -xf arcname.pkg").

    The command "7z l arcname.pkg -slt -t*" does list the whole contents of the archive, but issues a warning:

    1 file, 924087081 bytes (882 MiB)
    Type = Xar
    WARNINGS:
    There are data after the end of archive
    Physical Size = 924084877
    Tail Size = 2204
    SubType = pkg
    Headers Size = 11797

    The command "7z x arcname.pkg -t" will extract the same files as "xar -xf arcname.pkg" plus a file named [TOC].xml, similar to the one created by "xar -xf arcname.pkg --dump-toc=[TOC].xml" (the contents of both seem to be the same, but shown in a different order).

    The command "7z x arcname.pkg" will only extract the same file named Payload~ that 7-Zip File Manager does.

    Well, I just noticed that in Windows Explorer's context menu there is an option "7-Zip > Open archive > *" that will list the whole contents of the archive in 7-Zip File Manager.

    This option does not seem to be available if I open the archive from within 7-Zip File Manager, though.

    7-Zip Command Line Version User's Guide states that "If -t{archivetype} switch is not specified, 7-Zip uses extension of archive filename to detect the type of archive", and I assume that this also applies to 7-Zip File Manager.

    So, I would make these suggestions, if I may:

    Improvements in the way 7-Zip detects the type of archives with the extension .pkg, especially when they have more than one file named Payload within;

    A way to open archives with the switch -t* from within 7-Zip File Manager;

    A way to extract archives with the switch -t* from Windows Explorer's context menu;

    More detailed information about warnings in the 7-Zip File Manager extraction dialog box, at least the same shown in 7-Zip Console (in this case, Type, Physical Size, Tail Size, etc.).

    Thanks again.

     

    Last edit: Choldra 2015-08-03
  • Igor Pavlov

    Igor Pavlov - 2015-08-02

    I'll fix the problem with multiple Payload files. Thanks for report!
    By default if 7-Zip thinks that there is only one main file in archive, it tries to open it to simplify things for user.

    If you open archive in 7-Zip File Manager, you can press "Info" button to see archive properties.

    Also note that there are some extra data (tail) at the end of your pkg file (after Physical Size = 924084877).
    Also probably there some extra data in Payload file. call:
    7z l Payload
    Do you know why there are such extra blocks?

     
  • Choldra

    Choldra - 2015-08-04

    Dear Igor,

    I thank you again for your attention.

    At least in this case, I believe it is safe to assume that the "tail" is meaningless data, for the following reasons:

    • it is not listed in the "table of contents" XML document of the XAR archive;
    • it is located after the end of the last file in the heap;
    • I found the same block of 2.204 bytes elsewhere in the heap (it was a small fragment of one of the files named Payload);
    • I removed the "tail" from the package file, and was still able to perform a full installation, and to extract all data with xar, on OS X without errors.

    I also believe that it would help if there were more options to enable the switch -t* in 7-Zip File Manager, such as:

    A way to open and extract archives with the switch -t* from within 7-Zip File Manager;

    A way to extract archives with the switch -t* from Windows Explorer's context menu.

    When I extracted files with 7-Zip File Manager from this 881-megabyte archive using Windows Explorer's context menu, and it extracted only a 180-megabyte file and issued a warning about data after the payload, I wrongly assumed that 700 megabytes of data were after the payload, not just 2 kilobytes.

    That it why I also suggested that the 7-Zip File Manager extraction dialog box showed the same detailed information about warnings that 7-Zip Console does.

    Best regards,

    Choldra

     

Log in to post a comment.