AutoPkg and Munki

450 views
Skip to first unread message

John Lockwood

unread,
Mar 17, 2015, 6:53:00 AM3/17/15
to autopkg...@googlegroups.com
I recently started using AutoPkg (via AutoPkgr) and I now have several recipes working successfully, for example Google Chrome, Firefox, Flash, even Java8. What I am noticing however is that all of the recipes fail to extract and use an icon for the application or package that is they end up in the munki repo with generic icons.

It is my understanding that munkiimport is supposed to automatically look for icons when importing a package and that AutoPkg uses munkiimport to add updates to a munki repo. Therefore I would have expected a package added by AutoPkg to also include an icon.

Now I know from before using AutoPkg that some packages are structured in such a way as to make it impossible for munkiimport to automatically determine which icon to use but this clearly does not apply to applications in disk images, and yet AutoPkg still does not add an icon for these e.g. Google Chrome and Firefox.

So, what is going wrong?

On a related topic and I suspect this is a behaviour due to using MunkiAdmin rather than the command line munki tools, I find that MunkiAdmin when it is used to add a new update to a package already in the repo is able to automatically 'reuse' settings from previously added updates including the product category, product maker, icon, and any other settings, e.g. pre/post/uninstall scripts. Is it possible for AutoPkg to adopt similar behaviour? (After all MunkiAdmin is merely a front-end to munki tools.)

I am currently running AutoPkgr 1.2.1, Git 2.2.1, AutoPkg 0.4.2, and munki 2.2.0.2399 on an OS X 10.9.5 system.

Vaughn Miller

unread,
Mar 17, 2015, 8:25:39 AM3/17/15
to autopkg...@googlegroups.com
Hi John,

For icons in Munki, there is no reason to import an icon every time you import a new version of the software.  Lets take Google Chrome as an example.  In my icons directory I have a GoogleChrome.png file.  "GoogleChrome" matches the "name" key in the Google Chrome pkgsinfo files.  I have something like 20 versions of Chrome in my repository, and just the one icon file.  Do the work to import the icon once either manually or with the help of munkiimport, and then forget about it...

For the "reusing settings," for Munki recipes you will almost always want to create a recipe override to customize some of the Munki related settings.  The recipe author cannot know how you have your software categorized and organized in your repository.

Hope this helps...

Vaughn Miller
Desktop Engineer
Lafayette College

Timothy Sutton

unread,
Mar 17, 2015, 9:14:13 AM3/17/15
to autopkg...@googlegroups.com

> On Mar 17, 2015, at 6:53 AM, John Lockwood <jeloc...@gmail.com> wrote:
>
> I recently started using AutoPkg (via AutoPkgr) and I now have several recipes working successfully, for example Google Chrome, Firefox, Flash, even Java8. What I am noticing however is that all of the recipes fail to extract and use an icon for the application or package that is they end up in the munki repo with generic icons.
>
> It is my understanding that munkiimport is supposed to automatically look for icons when importing a package and that AutoPkg uses munkiimport to add updates to a munki repo. Therefore I would have expected a package added by AutoPkg to also include an icon.

Nope - with the MunkiImporter processor, AutoPkg uses makepkginfo to generate a pkginfo and then uses its own logic to determine whether and how to copy the pkg and pkginfo to the repo.


> Now I know from before using AutoPkg that some packages are structured in such a way as to make it impossible for munkiimport to automatically determine which icon to use but this clearly does not apply to applications in disk images, and yet AutoPkg still does not add an icon for these e.g. Google Chrome and Firefox.
>
> So, what is going wrong?
>
> On a related topic and I suspect this is a behaviour due to using MunkiAdmin rather than the command line munki tools, I find that MunkiAdmin when it is used to add a new update to a package already in the repo is able to automatically 'reuse' settings from previously added updates including the product category, product maker, icon, and any other settings, e.g. pre/post/uninstall scripts. Is it possible for AutoPkg to adopt similar behaviour? (After all MunkiAdmin is merely a front-end to munki tools.)

The simplest way to re-use icons is to name your icon files the same as the 'name' key in the pkginfo. As for re-using other keys like scripts, developer and category, this is what overrides are for. You define what you want in your override's pkginfo and the recipe should honour it.

While it could be possible to add the icon-importing behaviour to AutoPkg, it is a fair amount of code to support for something that only saves time for an initial import.

Tim


>
> I am currently running AutoPkgr 1.2.1, Git 2.2.1, AutoPkg 0.4.2, and munki 2.2.0.2399 on an OS X 10.9.5 system.
>
> --
> You received this message because you are subscribed to the Google Groups "autopkg-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to autopkg-discu...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

John Lockwood

unread,
Mar 17, 2015, 9:19:46 AM3/17/15
to autopkg...@googlegroups.com
I agree having multiple copies of the icon is a waste but the pkginfo for AutoPkg added items is not referencing any existing or new icon, not even as I mentioned for applications in disk images.

--
You received this message because you are subscribed to a topic in the Google Groups "autopkg-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/autopkg-discuss/CwzbfbGx4cU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to autopkg-discu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Timothy Sutton

unread,
Mar 17, 2015, 9:22:44 AM3/17/15
to autopkg...@googlegroups.com
I'm not talking about multiple copies, just the fact that _you_ only import the icon once.

Munki doesn't require additional pkginfo keys to make use of icons. From the wiki:

https://github.com/munki/munki/wiki/Product-Icons#details

"When looking for product artwork, managedsoftwareupdate checks for an 'icon_name" key in the item's pkginfo. If this exists and has a file extension, the filename is requested. Otherwise, ".png" is appended to the name to be requested. If the pkginfo does not have an 'icon_name" key, the pkginfo "name" key plus ".png" will be requested."


And even if you are using a custom icon_name for certain updates, you simply add this to your override's 'pkginfo' dictionary and don't worry about it until (or if ever) you need to revise the icon.


Tim
> View John Lockwood's profile
>
>
> --
> You received this message because you are subscribed to the Google Groups "autopkg-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to autopkg-discu...@googlegroups.com.

Gregory Neagle

unread,
Mar 17, 2015, 9:39:52 AM3/17/15
to autopkg...@googlegroups.com
On Mar 17, 2015, at 3:53 AM, John Lockwood <jeloc...@gmail.com> wrote:

What I am noticing however is that all of the recipes fail to extract and use an icon for the application or package that is they end up in the munki repo with generic icons.

Did you miss my response the last time you asked this question?

On Mar 12, 2015, at 7:53 AM, John Lockwood <jeloc...@gmail.com> wrote:


On a different topic, I am finding that AutoPkgr and/or AutoPkg are not adding icons for items they add to my repo, so the just added OracleJava8 has a generic installer package icon.

No AutoPkg recipe (that I know of) adds icons to a Munki repo.

There currently is no AutoPkg processor that extracts and imports icons into a Munki repo. Since icons don't change that often from release to release, it has not been a priority. When I import a new version of Chrome, it just uses a previously imported icon.

Could such a processor be written and incorporated into Munki recipes? Sure.

-Greg

John Lockwood

unread,
Mar 17, 2015, 9:54:36 AM3/17/15
to autopkg...@googlegroups.com
It still is not working and I feel it should.

According to the munkiimport documentation it is supposed to automatically find an icon and extract it or at least try to, this works via MunkiAdmin, but as I keep saying, it does not work via AutoPkg.

I can understand that if an existing icon exists with a file name that matches the name in the pkginfo it will then munkiimport does not have to do an icon extraction and Managed Software Center will utilise that existing file, e.g. if the pkginfo name is GoogleChrome then an already existing icon file called GoogleChrome or GoogleChrome.png should work, however as I read the documentation, munkiimport should be examining the package or disk image and automatically if possible extracting an icon to produce said icon file.  This is not happening when using AutoPkg. As AutoPkg runs munkiimport and munkiimport is supposed to do this something seems wrong.

As a real world example the recipe for Google Chrome uses a pkginfo name of GoogleChrome, however after AutoPkg has run that recipe and added a new Google Chrome to the repo there is no icon file with that name i.e. GoogleChrome or GoogleChrome.png, as this relates to a simple disk image containing an application it should be the easiest possible scenario for munkiimport to handle. This happened when I had no existing GoogleChrome entry in my repo.

As a workaround I have just manually added icon files that do match the pkginfo name e.g. GoogleChrome, based on this I would expect that next time GoogleChrome is updated via AutoPkg it should show an icon because the file already exists. This does not address the issue however that when AutoPkg runs munkiimport it is not doing it! That is munkiimport is not extracting an icon for a new entry where an icon file does not yet exist in the repo.

Clearly the Google Chrome application does contain an icon so one is available to extract.

Gregory Neagle

unread,
Mar 17, 2015, 9:56:51 AM3/17/15
to autopkg...@googlegroups.com
On Mar 17, 2015, at 6:54 AM, John Lockwood <jeloc...@gmail.com> wrote:

It still is not working and I feel it should.

John: 

I wrote both pieces of code: munkiimport, and the MunkiImporter processor in AutoPkg.

THE MUNKIMPORTER PROCESSOR DOES NOT CURRENTLY ATTEMPT TO EXTRACT OR IMPORT ICONS.

I'm not sure if I can make that any clearer.

-Greg

Timothy Sutton

unread,
Mar 17, 2015, 9:59:03 AM3/17/15
to autopkg...@googlegroups.com

> On Mar 17, 2015, at 9:54 AM, John Lockwood <jeloc...@gmail.com> wrote:
>
> It still is not working and I feel it should.
>
> According to the munkiimport documentation it is supposed to automatically find an icon and extract it or at least try to, this works via MunkiAdmin, but as I keep saying, it does not work via AutoPkg.
>
> I can understand that if an existing icon exists with a file name that matches the name in the pkginfo it will then munkiimport does not have to do an icon extraction and Managed Software Center will utilise that existing file, e.g. if the pkginfo name is GoogleChrome then an already existing icon file called GoogleChrome or GoogleChrome.png should work, however as I read the documentation, munkiimport should be examining the package or disk image and automatically if possible extracting an icon to produce said icon file. This is not happening when using AutoPkg. As AutoPkg runs munkiimport and munkiimport is supposed to do this something seems wrong.

AutoPkg does not run munkiimport. AutoPkg runs makepkginfo and then runs its own code to import the item into the repo.

>
> As a real world example the recipe for Google Chrome uses a pkginfo name of GoogleChrome, however after AutoPkg has run that recipe and added a new Google Chrome to the repo there is no icon file with that name i.e. GoogleChrome or GoogleChrome.png, as this relates to a simple disk image containing an application it should be the easiest possible scenario for munkiimport to handle. This happened when I had no existing GoogleChrome entry in my repo.
>
> As a workaround I have just manually added icon files that do match the pkginfo name e.g. GoogleChrome, based on this I would expect that next time GoogleChrome is updated via AutoPkg it should show an icon because the file already exists.

And this is what most people do. They manually add the icon file once, and forget about it, because subsequent updates use this icon file without any additional work if the icon filename + .png matches the 'name' of the pkginfo.

> This does not address the issue however that when AutoPkg runs munkiimport it is not doing it! That is munkiimport is not extracting an icon for a new entry where an icon file does not yet exist in the repo.

AutoPkg does not call munkiimport. This is easily verifiable on http://github.com/autopkg/autopkg...


Tim

> Clearly the Google Chrome application does contain an icon so one is available to extract.
>
> On Tuesday, 17 March 2015 13:39:52 UTC, Greg Neagle wrote:
> On Mar 17, 2015, at 3:53 AM, John Lockwood <jeloc...@gmail.com> wrote:
>
>> What I am noticing however is that all of the recipes fail to extract and use an icon for the application or package that is they end up in the munki repo with generic icons.
>
> Did you miss my response the last time you asked this question?
>
>> On Mar 12, 2015, at 7:53 AM, John Lockwood <jeloc...@gmail.com> wrote:
>>
>>
>>> On a different topic, I am finding that AutoPkgr and/or AutoPkg are not adding icons for items they add to my repo, so the just added OracleJava8 has a generic installer package icon.
>>
>> No AutoPkg recipe (that I know of) adds icons to a Munki repo.
>
> There currently is no AutoPkg processor that extracts and imports icons into a Munki repo. Since icons don't change that often from release to release, it has not been a priority. When I import a new version of Chrome, it just uses a previously imported icon.
>
> Could such a processor be written and incorporated into Munki recipes? Sure.
>
> -Greg
>

John Lockwood

unread,
Mar 17, 2015, 10:53:46 AM3/17/15
to autopkg...@googlegroups.com
My apologies, you wrote the software so you definitely would know.

I merely would quote the following from the Munki wiki/documentation and now raise this as a documentation error. See https://code.google.com/p/munki/wiki/ProductIcons

munkiimport

munkiimport will now offer to attempt to extract an icon for items that don't already have an icon in the repo:

It was this documentation plus the fact that MunkiAdmin does appear to somehow get munkiimport to extract icons - unless that author has in effect duplicated what the munki documentation says munkiimport should already be doing, that led me to believe it should work.


On Tuesday, 17 March 2015 13:56:51 UTC, Greg Neagle wrote:

On Mar 17, 2015, at 6:54 AM, John Lockwood wrote:

It still is not working and I feel it should.

John: 

I wrote both pieces of code: munkiimport, and the MunkiImporter processor in AutoPkg.

THE MUNKIMPORTER PROCESSOR DOES NOT CURRENTLY ATTEMPT TO EXTRACT OR IMPORT ICONS.

I'm not sure if I can make that any clearer.

-Greg

According to the munkiimport documentation it is supposed to automatically find an icon and extract it or at least try to, this works via MunkiAdmin, but as I keep saying, it does not work via AutoPkg.

I can understand that if an existing icon exists with a file name that matches the name in the pkginfo it will then munkiimport does not have to do an icon extraction and Managed Software Center will utilise that existing file, e.g. if the pkginfo name is GoogleChrome then an already existing icon file called GoogleChrome or GoogleChrome.png should work, however as I read the documentation, munkiimport should be examining the package or disk image and automatically if possible extracting an icon to produce said icon file.  This is not happening when using AutoPkg. As AutoPkg runs munkiimport and munkiimport is supposed to do this something seems wrong.

As a real world example the recipe for Google Chrome uses a pkginfo name of GoogleChrome, however after AutoPkg has run that recipe and added a new Google Chrome to the repo there is no icon file with that name i.e. GoogleChrome or GoogleChrome.png, as this relates to a simple disk image containing an application it should be the easiest possible scenario for munkiimport to handle. This happened when I had no existing GoogleChrome entry in my repo.

As a workaround I have just manually added icon files that do match the pkginfo name e.g. GoogleChrome, based on this I would expect that next time GoogleChrome is updated via AutoPkg it should show an icon because the file already exists. This does not address the issue however that when AutoPkg runs munkiimport it is not doing it! That is munkiimport is not extracting an icon for a new entry where an icon file does not yet exist in the repo.

Clearly the Google Chrome application does contain an icon so one is available to extract.

On Tuesday, 17 March 2015 13:39:52 UTC, Greg Neagle wrote:
On Mar 17, 2015, at 3:53 AM, John Lockwood  wrote:

What I am noticing however is that all of the recipes fail to extract and use an icon for the application or package that is they end up in the munki repo with generic icons.

Did you miss my response the last time you asked this question?

Gregory Neagle

unread,
Mar 17, 2015, 10:57:24 AM3/17/15
to autopkg...@googlegroups.com
On Mar 17, 2015, at 7:53 AM, John Lockwood <jeloc...@gmail.com> wrote:

My apologies, you wrote the software so you definitely would know.

I merely would quote the following from the Munki wiki/documentation and now raise this as a documentation error. See https://code.google.com/p/munki/wiki/ProductIcons

munkiimport

munkiimport will now offer to attempt to extract an icon for items that don't already have an icon in the repo:

It was this documentation plus the fact that MunkiAdmin does appear to somehow get munkiimport to extract icons - unless that author has in effect duplicated what the munki documentation says munkiimport should already be doing, that led me to believe it should work.


You are talking about Munki and munkiimport. There are no documentation errors about icons there.

AUTOPKG is not Munki. It behaves differently.


On Tuesday, 17 March 2015 13:56:51 UTC, Greg Neagle wrote:

On Mar 17, 2015, at 6:54 AM, John Lockwood wrote:

It still is not working and I feel it should.

John: 

I wrote both pieces of code: munkiimport, and the MunkiImporter processor in AutoPkg.

THE MUNKIMPORTER PROCESSOR DOES NOT CURRENTLY ATTEMPT TO EXTRACT OR IMPORT ICONS.

I'm not sure if I can make that any clearer.

-Greg


According to the munkiimport documentation it is supposed to automatically find an icon and extract it or at least try to, this works via MunkiAdmin, but as I keep saying, it does not work via AutoPkg.

I can understand that if an existing icon exists with a file name that matches the name in the pkginfo it will then munkiimport does not have to do an icon extraction and Managed Software Center will utilise that existing file, e.g. if the pkginfo name is GoogleChrome then an already existing icon file called GoogleChrome or GoogleChrome.png should work, however as I read the documentation, munkiimport should be examining the package or disk image and automatically if possible extracting an icon to produce said icon file.  This is not happening when using AutoPkg. As AutoPkg runs munkiimport and munkiimport is supposed to do this something seems wrong.

As a real world example the recipe for Google Chrome uses a pkginfo name of GoogleChrome, however after AutoPkg has run that recipe and added a new Google Chrome to the repo there is no icon file with that name i.e. GoogleChrome or GoogleChrome.png, as this relates to a simple disk image containing an application it should be the easiest possible scenario for munkiimport to handle. This happened when I had no existing GoogleChrome entry in my repo.

As a workaround I have just manually added icon files that do match the pkginfo name e.g. GoogleChrome, based on this I would expect that next time GoogleChrome is updated via AutoPkg it should show an icon because the file already exists. This does not address the issue however that when AutoPkg runs munkiimport it is not doing it! That is munkiimport is not extracting an icon for a new entry where an icon file does not yet exist in the repo.

Clearly the Google Chrome application does contain an icon so one is available to extract.

On Tuesday, 17 March 2015 13:39:52 UTC, Greg Neagle wrote:
On Mar 17, 2015, at 3:53 AM, John Lockwood  wrote:

What I am noticing however is that all of the recipes fail to extract and use an icon for the application or package that is they end up in the munki repo with generic icons.

Did you miss my response the last time you asked this question?

On Mar 12, 2015, at 7:53 AM, John Lockwood  wrote:


On a different topic, I am finding that AutoPkgr and/or AutoPkg are not adding icons for items they add to my repo, so the just added OracleJava8 has a generic installer package icon.

No AutoPkg recipe (that I know of) adds icons to a Munki repo.

There currently is no AutoPkg processor that extracts and imports icons into a Munki repo. Since icons don't change that often from release to release, it has not been a priority. When I import a new version of Chrome, it just uses a previously imported icon.

Could such a processor be written and incorporated into Munki recipes? Sure.

-Greg



John Lockwood

unread,
Mar 17, 2015, 10:58:03 AM3/17/15
to autopkg...@googlegroups.com
Thinking further, you seem to be implying that the (AutoPkg) munkiimport processor and the (Munki) munkiimport are different pieces of code. The fact that AutoPkg requires the installation of the munki tools including munkiimport implied that AutoPkg was directly or indirectly calling the (Munki) version of munkiimport which according the documentation should be able to extract icons.

If there is an intermediary between AutoPkg and munki's munkiimport i.e. the 'munkiimport processor' then I would request that it be 'enhanced' to import icons if possible.

Gregory Neagle

unread,
Mar 17, 2015, 11:00:19 AM3/17/15
to autopkg...@googlegroups.com
On Mar 17, 2015, at 7:58 AM, John Lockwood <jeloc...@gmail.com> wrote:

Thinking further, you seem to be implying that the (AutoPkg) munkiimport processor and the (Munki) munkiimport are different pieces of code. The fact that AutoPkg requires the installation of the munki tools including munkiimport implied that AutoPkg was directly or indirectly calling the (Munki) version of munkiimport which according the documentation should be able to extract icons.

If there is an intermediary between AutoPkg and munki's munkiimport i.e. the 'munkiimport processor' then I would request that it be 'enhanced' to import icons if possible.

Thank you for the request.

As I indicated earlier, it's not very high on my list of things to work on.

Pull Requests welcomed.

-Greg

John Lockwood

unread,
Mar 17, 2015, 11:03:53 AM3/17/15
to autopkg...@googlegroups.com
Having practically identical names for two different munkiimport pieces of code clearly has led to confusion. Perhaps renaming the AutoPkg one 'munkiimportprocessor' all one word, would help.

I was aware you wrote both AutoPkg and Munki and this made the expectation that they were one and the same thing even more logical.

Timothy Sutton

unread,
Mar 17, 2015, 11:08:20 AM3/17/15
to autopkg...@googlegroups.com
AutoPkg follows a naming convention for processor names. "Unarchiver", "DmgMounter", etc.

I don't really see how changing "MunkiImporter" to "munkiimportprocessor" makes things any clearer, but maybe that's just me.


Tim

Gregory Neagle

unread,
Mar 17, 2015, 11:14:31 AM3/17/15
to autopkg...@googlegroups.com
On Mar 17, 2015, at 8:03 AM, John Lockwood <jeloc...@gmail.com> wrote:

Having practically identical names for two different munkiimport pieces of code clearly has led to confusion. Perhaps renaming the AutoPkg one 'munkiimportprocessor' all one word, would help.

Except for the part where it would break every existing .munki recipe.

I was aware you wrote both AutoPkg and Munki and this made the expectation that they were one and the same thing even more logical.

I get why someone might be confused. But Tim and I explained over and over they were separate pieces of code and that they didn't behave exactly the same. You did not appear to actually read our responses.

munkiimport was designed as an interactive command-line tool. It was not suitable to use with AutoPkg without a significant rewrite. I did not want to tie the two projects together like that. So I wrote a MunkiImporter processor for AutoPkg.

I am pretty sure that Hannes' MunkiAdmin does _not_ call munkimport either. Again, munkiimport was designed for interactive use at the command-line. Might it make sense in the future to refactor the code so more of what munkiimport does could be called/utilized by other tools? Sure. But that's not where we are today.

But all of this is just background. The facts are the same as in the beginning, and as explained to you many times:

AuoPkg munki recipes do not extract and import icons.

-Greg

Reply all
Reply to author
Forward
0 new messages