Python to modify a .pkg file

1.1k views Asked by At

My python code need to unpack a .pkg file, modify some file there and pack it again. Any mature python module to suggest? I saw there's pyxar (xarfile), which requires install xar on the machine first.

Any other options I could choose?

Finally decided to call xar from python directly, which actually could work. But another problem is that, the Scripts under payload.kg within the package is not unpacked. It suppose to be a directory, but remains as a file. Strange thing is that, the file Scripts shows as a gzip compressed data, from Unix. But I cannot use gzip to open it no matter on mac or linux. On mac, I can do tar -xf to open it, but on linux cannot. Any suggestion?

Thanks!

0

There are 0 answers