Giter VIP home page Giter VIP logo

Comments (8)

homebysix avatar homebysix commented on September 2, 2024

That's because the Telegraf app does not contain any usable version information:

image

You can still write AutoPkg recipes for this app manually, but AutoPkg may have similar problems due to the lack of versioning.

I would recommend reaching out to the developer and suggesting they add a CFBundleShortVersionString and/or CFBundleVersion key/value to their Info.plist.

from recipe-robot.

tetesh avatar tetesh commented on September 2, 2024

Thank you very much. You are the best! Can you please tell me what is the application on the screen? very interesting. Is it possible to add these keys through it?))
And I also wanted to remember, suddenly you will be interested.
There is such an application, it collects a package from a MacOs brew. https://github.com/timsutton/brew-pkg
Perhaps a recipe could be made based on it))

I can write a ci-cd for brew-pkg and then make a recipe based on the created package. But it would be cool if it could be automated.

from recipe-robot.

homebysix avatar homebysix commented on September 2, 2024

The app is Apparency, which allows you to inspect applications. Useful for detecting code signature issues and missing Info.plist keys.

Apparency only shows you the app info. In order to change it, whoever built the app would need to modify the Info.plist they're using (likely in Xcode).

I don't think you need to use brew-pkg as part of your AutoPkg workflow. Instead, you can use the AutoPkg processor URLTextSearcher to get the version from the download page, construct a download URL from it, and then use the same version in subsequent steps like packaging. An example of a recipe that does that is AirParrot 3.download. Perhaps you could use that for inspiration?

from recipe-robot.

tetesh avatar tetesh commented on September 2, 2024

Many thanks! I'll figure it out and make the recipe by hand. Probably, such problems as I do not happen often, but it might be worth adding the ability to add the missing keys immediately to the robot recipe if they are not specified in the application. If you do not have time, I will try to figure it out and add this feature

from recipe-robot.

tetesh avatar tetesh commented on September 2, 2024

I solved it like this, but it certainly doesn't work in the gui:

        if version_key not in ("", None):
            robo_print(
                "Version key is: {} ({})".format(version_key, info_plist[version_key$
                LogLevel.VERBOSE,
                4,
            )
            facts["version_key"] = version_key
        else:
-            raise RoboError(
-                "Sorry, I can't determine which version key to use for this {}.".fo$
-                    bundle_type
-                )
-            )
+            print("Sorry, I can't determine which version key, please enter CFBundle$
+            while True:
+                try:
+                    version_manual = input("Enter version string (x.x or x.x.x): ")
+                    pattern1 = '^\d+\.\d+\.\d+(\r)?$'
+                    pattern2 = '^\d+\.\d+(\r)?$'
+                    match1 = re.fullmatch(pattern1, version_manual)
+                    match2 = re.fullmatch(pattern2, version_manual)
+                    if match1 or match2:
+                        facts["version_key"] = version_manual
+                        break
+                    else:
+                        print("Invalid version")
+                except:
+                    print("Invalid version")

    # Determine path to the app's icon.
    if "icon_path" not in facts and not args.skip_icon:
        icon_path = ""
        robo_print("Looking for icon...", LogLevel.VERBOSE)
        if "CFBundleIconFile" in info_plist:
            icon_path = os.path.join(
                input_path, "Contents", "Resources", info_plist["CFBundleIconFile"]

from recipe-robot.

homebysix avatar homebysix commented on September 2, 2024

Version formats are varied and complicated to validate. And because missing versions are very rare and often temporary (due to a new developer misunderstanding app conventions, for example) I don't think this is an accommodation I'd build into Recipe Robot.

from recipe-robot.

tetesh avatar tetesh commented on September 2, 2024

I found a better option, the PlistEditor function, it would be cool to pass arguments through the robot to this function if they are not present initially
Example: https://github.com/autopkg/recipes/blob/master/AdobeAIR/AdobeAIR.pkg.recipe

from recipe-robot.

tetesh avatar tetesh commented on September 2, 2024

As for the versions - I agree, it turned out badly. But can exclude checking the value with regular expressions

from recipe-robot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.