homebysix / recipe-robot

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

Give recipe-robot app name if it doesnt know #86

Closed charliwest closed 8 years ago

charliwest commented 8 years ago

It would be good to be able to tell recipe robot what an app is called instead of just giving the error "I wasn't able to determine the name of this app, so I can't make any recipes"

I am trying to pass a github page as the url but can't get any further due to this.

Thanks

homebysix commented 8 years ago

Usually, if Recipe Robot doesn't know the name of the app it means it doesn't know other critical information.

Could you provide the GitHub repo you're trying to create a recipe from, and I'll see if I can reproduce the error?

SmithersJr commented 8 years ago

Get this same error with the [OneDrive for Business Mac Preview](https://download.microsoft.com/download/D/9/8/D98389DB-5946-412C-A0A6-44808C19F99C/OneDriveForBusinessMacPreview.dmg, https://www.microsoft.com/en-us/download/confirmation.aspx?id=45519).

SmithersJr commented 8 years ago

Here are some more examples of this:

homebysix commented 8 years ago

Hi @SmithersJr,

Frequently the "I wasn't able to determine the name" error is preceded by warnings that give a hint about the more specific reasons for the failure. For example, here's what I get when I run the OneDrive for Business Mac Preview link above through Recipe Robot:

Processing https://download.microsoft.com/download/D/9/8/D98389DB-5946-412C-A0A6-44808C19F99C/OneDriveForBusinessMacPreview.dmg ...
Input path looks like a download URL.
    Download URL is: https://download.microsoft.com/download/D/9/8/D98389DB-5946-412C-A0A6-44808C19F99C/OneDriveForBusinessMacPreview.dmg
Downloading file for further inspection...
[WARNING] Download URL not found. (HTTP Error 404: Not Found)
[ERROR] I wasn't able to determine the name of this app, so I can't make any recipes.

Loading the same URL in a browser confirms that the page doesn't exist, so Recipe Robot is doing the right thing.

Let's take a look at Vagrant, which is delivered as a pkg wrapped in a dmg. The pkg installs an assortment of binaries instead of a single app:

screen shot 2016-05-17 at 4 07 15 pm

Recipe Robot doesn't know what to do with binaries yet. It's built for Mac apps.

Finally, let's take a look at Eclipse. If I run it using the URL you provided, I get this:

Processing https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/mars/2/eclipse-jee-mars-2-macosx-cocoa-x86_64.tar.gz ...
Input path looks like a download URL.
    Download URL is: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/mars/2/eclipse-jee-mars-2-macosx-cocoa-x86_64.tar.gz
Downloading file for further inspection...
    Downloaded to ~/Library/Caches/Recipe Robot/2016-05-17_16-12-40_057345/download.php
Determining download format...
    File extension is tar.gz
Opening downloaded file...
[ERROR] I wasn't able to determine the name of this app, so I can't make any recipes.

It all happened very quickly, and I know for a fact that Eclipse is a hefty app. So let's inspect that PHP file more closely...

$ head -1 ~/Library/Caches/Recipe\ Robot/2016-05-17_16-12-40_057345/download.php
<!DOCTYPE html>

Aha, looks like we just downloaded the page linking to the actual download URL, rather than the download URL itself. Let's try again with an actual download URL:

Processing http://mirror.cc.columbia.edu/pub/software/eclipse/technology/epp/downloads/release/mars/2/eclipse-jee-mars-2-macosx-cocoa-x86_64.tar.gz ...
Input path looks like a download URL.
    Download URL is: http://mirror.cc.columbia.edu/pub/software/eclipse/technology/epp/downloads/release/mars/2/eclipse-jee-mars-2-macosx-cocoa-x86_64.tar.gz
Downloading file for further inspection...
    Downloaded to ~/Library/Caches/Recipe Robot/2016-05-17_16-17-52_806838/eclipse-jee-mars-2-macosx-cocoa-x86_64.tar.gz
Determining download format...
    File extension is tar.gz
Opening downloaded file...
    Successfully unarchived tgz
Validating app...
    App seems valid
Getting app name...
    App name is: Eclipse
Getting bundle identifier...
    Bundle identifier is: org.eclipse.platform.ide
Checking for a Sparkle feed...
    No Sparkle feed
Looking for version key...
    Version key is: CFBundleShortVersionString (4.5.2)
Looking for app icon...
    App icon is: ~/Library/Caches/Recipe Robot/2016-05-17_16-17-52_806838/unpacked/Eclipse.app/Contents/Resources/Eclipse.icns
Getting app description from MacUpdate...
    Description: Controls up to 4 USB or Firewire cameras during an eclipse.
Gathering code signature information...
    Code signature verification requirements recorded
    3 authority names recorded
    Developer: Eclipse Foundation, Inc.
Generating munki recipe...
    ~/Library/AutoPkg/Recipe Robot Output/Eclipse Foundation, Inc./Eclipse.png
    ~/Library/AutoPkg/Recipe Robot Output/Eclipse Foundation, Inc./Eclipse.munki.recipe
Generating install recipe...
    ~/Library/AutoPkg/Recipe Robot Output/Eclipse Foundation, Inc./Eclipse.install.recipe
Generating download recipe...
    ~/Library/AutoPkg/Recipe Robot Output/Eclipse Foundation, Inc./Eclipse.download.recipe
Generating pkg recipe...
    ~/Library/AutoPkg/Recipe Robot Output/Eclipse Foundation, Inc./Eclipse.pkg.recipe

You've now created 3091 recipes with Recipe Robot. Thanks!

And that looks like a successful run to me. :+1:

Hope that helps!

SmithersJr commented 8 years ago

Thanks for that detailed explanation! Maybe I should submit a feature request for a more detailed error message. ;-)

If the OneDrive attempt gave the error Download URL not found. (HTTP Error 404: Not Found) instead of I wasn't able to determine the name of this app…, that would help AutoPkg novices like me better know where to look for problems.

But, this has definitely given me more trouble-shooting techniques for recipes. Thanks!