don-alvarez / munki

Automatically exported from code.google.com/p/munki
Other
0 stars 0 forks source link

"Installs" array seems to use CFBundleVersion value for CFBundleShortVersionString (at least for Java 7 u 55) #322

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
1. download Java 7 U 55 from Oracle and import into Munki
2. edit the pkginfo to add an installs array saying it's a bundle; the path to 
the plugin; and the CFBundleShortVersionString of "Java 7 Update 55"
3. After necessary catalog rebuilds, etc, run Managed Software Update. Java 
will (re)install every time
4. Modify the installs array CFBundleShortVersionString to "1.7.55.13" (which 
is actually the CFBundleVersion), rebuild cats, etc. (I've attached mine)
5. Java does not try to install more than once

What is the expected output? What do you see instead?

In the case of Java, the CFBundleVersion is actually the preferable version 
info as it's wholly numeric, but one would expect the 
CFBundleShortVersionString to get compared

What version of the Munki tools/InstallOSpkg tools are you using? On what
version of OS X?

Munki 1.0.0 OSX 10.9.1 (and possibly some 10.9.2)

Please provide any additional information below.

Traced this using -vvvvv. As I said, the CFBundleVersion is the preferable one 
to use in this case, it would be nice if you could explicitly use it as an 
option (or even have Munki pick what it thinks is the best (most numeric and 
whitespace free) and have something like a MunkiPreferredVersionNumber key or 
something).

But that said, if it did use the actual CFBundleShortVersionString as 
documented, things would work as it does end on a number

Additionally,  munkiimport doesn't automagically extract version info out of 
the Oracle pkg (just says 1.0), even though version info is certainly all there 
after the install. As Java is one of the things I want to handle with Munki, 
that was a pity!

Original issue reported on code.google.com by pi...@u-h-p.com on 14 May 2014 at 4:00

Attachments:

GoogleCodeExporter commented 8 years ago
I do realise that last request may be entirely outside the control of Munki 
developers

Original comment by pi...@u-h-p.com on 14 May 2014 at 4:12

GoogleCodeExporter commented 8 years ago
Java's packaging _is_ outside of the control of Munki's developers.

You can explictly use the CFBundleVersion as a comparison key; you need to set 
the "version_comparison_key" to "CFBundleVersion":

                <dict>
                        <key>version_comparison_key</key>
                        <string>CFBundleVersion</string>
                        <key>CFBundleVersion</key>
                        <string>1.7.55.13</string>
                        <key>CFBundleShortVersionString</key>
                        <string>Java 7 Update 55</string>
                        <key>path</key>
                        <string>/Library/Internet Plug-Ins/JavaAppletPlugin.plugin</string>
                        <key>type</key>
                        <string>bundle</string>
                </dict>

This feature is relatively new, and is intended for just this scenario.

Still earlier, Munki tried to be "smart" and if CFBundleShortVersionString 
started with anything other than a digit, it was ignored in favor of 
CFBundleVersion. This is almost certainly the behavior you are seeing.

So this is a long way of saying that from your description, Munki appears to be 
behaving as expected/designed.

Original comment by gregnea...@mac.com on 14 May 2014 at 4:38

GoogleCodeExporter commented 8 years ago
For future reference/present edification, the code in question is munkicommon's 
getVersionString(), currently here:

https://code.google.com/p/munki/source/browse/code/client/munkilib/munkicommon.p
y#1303

Original comment by gregnea...@mac.com on 14 May 2014 at 4:58

GoogleCodeExporter commented 8 years ago
Thanks Greg, I did have a feeling that might be what it was doing. 

It does then seem that the key "CFBundleShortVersionString" is not really right 
in an installs array by itself, it should be called something like 
"MunkiPreferredCFBundleVersion" or something, and/or that the documentation at 
https://code.google.com/p/munki/wiki/HowMunkiDecidesWhatNeedsToBeInstalled#Insta
lls could be a little clearer on that.

Loving Munki, BTW, just hoping to improve it

Original comment by pi...@u-h-p.com on 14 May 2014 at 8:47

GoogleCodeExporter commented 8 years ago
Of course there are lots of nasty edge cases whenever vendors do a poor job of 
packaging their software. This one one of the reasons I contributed so heavily 
to autopkg.

There's an autopkg recipe for OracleJava7 that takes care of all of this.

http://autopkg.github.io/autopkg/

Original comment by gregnea...@mac.com on 14 May 2014 at 9:03