Coder Social home page Coder Social logo

Comments (10)

jessepeterson avatar jessepeterson commented on June 6, 2024

Thinking about this one level deeper I imagine the representation of CFBundleShortVersionString needs to be in a form that the Munki process will correctly match it. So maybe it needs to stay what it is? I hope not, though. However, it is annoying that the MunkiImporter uses the two spaces in both the plist and pkg names when importing.

from recipes.

gregneagle avatar gregneagle commented on June 6, 2024

I think it needs to stay as-is because the CFBundleShortVersionString in the Infor.plist on disk for Flip4Mac will be in this format.

Generally speaking, I don't think Munki (or any recipes) should modify the value in the CFBundleShortVersionString, except possibly for display-only purposes.

from recipes.

jessepeterson avatar jessepeterson commented on June 6, 2024

Okay, I'm convinced on the CFBundleShortVersionString staying issue.

Can we add a filter for pkg and plist names to the MunkiImport process? It just feels wrong with the spaces in there.

from recipes.

timsutton avatar timsutton commented on June 6, 2024

We actually used to strip the version string, exactly when this started happening with Flip4Mac, and went back on it because the version metadata would no longer reflect what Munki is actually using to compare versions, as you suspected.

I don't personally find the spaces in the filenames to be annoying (and on some level they serve as a reminder/warning that the package's metadata is sloppy), but I don't see any reason to not strip() surrounding whitespace before staging the files in the repo.

from recipes.

jessepeterson avatar jessepeterson commented on June 6, 2024

Ok, I'll try to tinker and submit a pull. Hopefully I can find time for that soon.

from recipes.

jessepeterson avatar jessepeterson commented on June 6, 2024

It seems as simple as this change, yes?

diff --git a/Code/autopkglib/MunkiImporter.py b/Code/autopkglib/MunkiImporter.py
index 6703e74..ee4c009 100644
--- a/Code/autopkglib/MunkiImporter.py
+++ b/Code/autopkglib/MunkiImporter.py
@@ -339,7 +339,7 @@ class MunkiImporter(Processor):
                 raise ProcessorError("Could not create %s: %s"
                                       % (destination_path, err.strerror))

-        pkginfo_name = "%s-%s.plist" % (pkginfo["name"], pkginfo["version"])
+        pkginfo_name = "%s-%s.plist" % (pkginfo["name"], pkginfo["version"].strip())
         pkginfo_path = os.path.join(destination_path, pkginfo_name)
         index = 0
         while os.path.exists(pkginfo_path):

from recipes.

timsutton avatar timsutton commented on June 6, 2024

Yup!

from recipes.

jessepeterson avatar jessepeterson commented on June 6, 2024

Want a PR for that little change? ;)

from recipes.

timsutton avatar timsutton commented on June 6, 2024

No PR is too small.

🍰

from recipes.

jessepeterson avatar jessepeterson commented on June 6, 2024

Submitted as autopkg/autopkg#39.

from recipes.

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.