Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new SourceForgeBestReleaseURLProvider processor #114

Open
n8felton opened this issue Oct 23, 2016 · 2 comments
Open

Add support for new SourceForgeBestReleaseURLProvider processor #114

n8felton opened this issue Oct 23, 2016 · 2 comments
Assignees

Comments

@n8felton
Copy link

n8felton commented Oct 23, 2016

I've created a new SourceForgeBestReleaseURLProvider shared processor at https://github.com/autopkg/n8felton-recipes/blob/master/SharedProcessors/SourceForgeBestReleaseURLProvider.py that gives us another option for downloading files from SourceForge. This SourceForgeBestReleaseURLProvider shared processor could be used as either the primary processor or as a fallback processor for SourceForge projects.

As an example:

$ ./recipe-robot -v --app-mode https://sourceforge.net/projects/weka/

                      -----------------------------------
                     |  Welcome to Recipe Robot v1.0.4.  |
                      -----------------------------------
                                \   _[]_
                                 \  [oo]
                                   d-||-b
                                     ||
                                   _/  \_

Processing https://sourceforge.net/projects/weka/ ...
Input path looks like a SourceForge URL.
    App name is: Weka
Getting SourceForge project ID...
    SourceForge project ID is: 5091
Getting SourceForge description...
    SourceForge description is: Machine learning software to solve data mining problems
Determining download URL from SourceForge RSS feed...
[WARNING] Could not detect SourceForge latest release download_url.
Searching for existing AutoPkg recipes for Weka...
    No results
[ERROR] Recipe Robot exploded with unexpected error: is_from_app_store
Traceback (most recent call last):
  File "./recipe-robot", line 98, in main
    time, _ = recipe_robot_lib.generate_recipes(facts, prefs)  # pylint: disable=assignment-from-no-return
  File "/Applications/Recipe Robot.app/Contents/Resources/scripts/recipe_robot_lib/tools.py", line 117, in run_func
    result = func(*args, **kwargs)
  File "/Applications/Recipe Robot.app/Contents/Resources/scripts/recipe_robot_lib/recipe_generator.py", line 65, in generate_recipes
    raise_if_recipes_cannot_be_generated(facts, preferred)
  File "/Applications/Recipe Robot.app/Contents/Resources/scripts/recipe_robot_lib/recipe_generator.py", line 117, in raise_if_recipes_cannot_be_generated
    if (not facts.is_from_app_store() and
  File "/Applications/Recipe Robot.app/Contents/Resources/scripts/recipe_robot_lib/facts.py", line 90, in is_from_app_store
    return self["is_from_app_store"]
  File "/Applications/Recipe Robot.app/Contents/Resources/scripts/recipe_robot_lib/roboabc.py", line 45, in __getitem__
    return self._dict[key]
KeyError: 'is_from_app_store'

[ERROR]
                                    _[]_
                                    [xx]
                                   q-||-p
                                     ||
                                   _/  \_

This currently fails, but could instead use my shared processor (or the code from my shared processor) as a fallback (or primary, and use the current processor as the fallback) to locate the download instead.

Optionally, I have also created a new MD5Checksum shared processor that complements the SourceForgeBestReleaseURLProvider shared processor as the SourceForge Release API provides the MD5 checksum of the available project downloads. https://github.com/autopkg/n8felton-recipes/blob/master/SharedProcessors/MD5Checksum.py

An example of these processors in action can been seen at https://github.com/autopkg/n8felton-recipes/blob/master/Weka/Weka.download.recipe

@homebysix
Copy link
Owner

That's great, @n8felton!

Are there still any situations in which @jessepeterson's SourceForgeURLProvider would still be better and/or the preferred processor? Does this new processor cover all the existing use cases of SourceForgeURLProvider, and then some?

@n8felton
Copy link
Author

There is one pitfall to this processor; reliance on the SourceForge project team to update their "best release."

A good example of this is https://sourceforge.net/projects/filezilla/. https://sourceforge.net/projects/filezilla/best_release.json has 3.17.0.1 listed as their "best release" even though 3.22.1 appears to be the latest release.

@homebysix homebysix self-assigned this Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants