homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
300 stars 28 forks source link

When processing PackageInfo and Payload files, how can we best determine useful facts #27

Closed homebysix closed 5 years ago

homebysix commented 9 years ago

Here are the facts we need to gather from the PackageInfo and Payload files inside of an expanded flat package:

This is not working 100% reliably at the moment.

And what if the payload contains multiple apps? Do we go with the one with the shortest path, as would be the case below?

$ gunzip -c /Users/elliot/Library/Caches/Recipe\ Robot/expanded/ChronoSync.pkg/Payload | p
ax | egrep "\.app$"
./Applications/ChronoSync.app
./Applications/ChronoSync.app/Contents/Library/LoginItems/ChronoSync Scheduler.app
./Library/Application Support/ChronoSync/ChronoAgentLocal.app

Or should we use the one with the largest file size? (How can we determine file size without extracting first?)

Or should we use the one with a Sparkle feed?

sheagcraig commented 9 years ago

I don't think going by size is a safe way of doing it.

I think there probably needs to be several tests applied:

homebysix commented 9 years ago

I've been staring at this block of code for a while trying to determine how to make it better. https://github.com/homebysix/recipe-robot/blob/master/scripts/recipe-robot#L1389-L1447

In short, it should:

I'm OK with assuming the app will be installed to /Applications, although we do have the information we need to detect whether that's actually true (PackageInfo install-location plus the app's path within Payload).

Anybody want to take a crack at this? I've been looking at it for too long.

sheagcraig commented 9 years ago

I want to. I may not have a computer for the next week... But I'd like to.

homebysix commented 7 years ago

Three examples we can use for further education of the robot with regard to package files:

homebysix commented 6 years ago

I had some coffee and revisited this issue. I think I've got a good solution that should work most of the time.

There's still some loose wires around the generation of recipes after a lot of package-unpacking has taken place. For example, if we discover a signed app, we should switch CodeSignatureVerifier to use that. But the path may be variable depending on whether it's a pkg inside of a zip or dmg.

Latest changes on the better-pkg-handling branch.

homebysix commented 5 years ago

The changes discussed above (and others) have been incorporated into Recipe Robot 1.1.0+. Two of the three example URLs above are processed successfully by Recipe Robot now, and the other fails for an unrelated reason (404 error).