autopackage: designed by monkeys?

Please note that this weblog entry concerns itself only with the autopackage file format, and not the software used to build or install autopackages. It would help to keep this distinction in mind when reading it.

From my point of view, the autopackage format is mainly notable for being an executable shell archive type format with as far as I can see, no formal design documentation. So to extract it without running it (for something like alien, or just because I didn't feel like trusting random code downloaded from the net today) will mean looking for magic values in a shell script and hoping they've not changed the shell script layout too much. Yuck. Didn't we learn anything from shar files?

The other interesting bit is that since they do full relocatability, the binary payload itself contains no path information.

joey@dragon:~/tmp/data> tail -c 98791 ~/autopackage-qt-1.0.x86.package | tar jvxf -

Where is the path info hidden? Why, in another shell script, deep in the package metadata, of course:

joey@dragon:~/tmp/meta> grep autopackage-frontend-qt * 
apkg-install-script:installExe ./autopackage-frontend-qt ./autopackage-manager-qt apkg-install-script:installDesktop ".hidden" ./autopackage-frontend-qt.desktop apkg-install-script: copyFiles --silent ./extractinfo "$PREFIX/share/apps/autopackage-frontend-qt"

Of course there is no formal design for how any of these shell functions work, and no guarantee that they'll not change the names or add new ones later. Therefore, an autopackage package cannot be reasonably extracted by anything except autopackage or a reimplementation of it. And you cannot extract a package fully without executing it. And they'll have to keep all these unspecified bits working the same way, forever, if they want to keep supporting old packages. Didn't we learn anything from shared libraries? Worst. Package. Format. Ever.

In summary, autopackage is not a real package format, it's a bunch of shell scripts that depend on other shell scripts in the autopackage program to work, and Alien will never, ever support autopackage unless at least this last bit is changed.