Closed homebysix closed 5 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:
.app
in the path to the item in question? In the example above, I would think that ChronoSync Scheduler.app is clearly not the "main app" since it's, due to the multiple apps in its path, nested within another app (and further, nested inside the app that IS at a desirable location, and probably the one we've already flagged from the first test).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:
gunzip -c Payload | pax
blocking_applications
(#39).gunzip -c Payload | pax -r -s \",./,/path/to/extract_dest/,\"
inspect_app()
on the app. This will grab Sparkle feed, developer name, etc.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.
I want to. I may not have a computer for the next week... But I'd like to.
Three examples we can use for further education of the robot with regard to package files:
I had some coffee and revisited this issue. I think I've got a good solution that should work most of the time.
ditto -x
for unpacking payloads instead of pax
. Why didn't I learn about that sooner!?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.
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).
Here are the facts we need to gather from the PackageInfo and Payload files inside of an expanded flat package:
inspect_app()
.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?
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?