Requires receipt

22 views
Skip to first unread message

Paul Bloch

unread,
Mar 1, 2012, 6:27:04 PM3/1/12
to munki-dev
I created a Munki package that I only want installed if there is an
older version of a specific receipt. My new Munki package is a fixed
launchd plist for a package that was installed in the original
InstaDMG install. I'll update the install image for newer clean
installs, but I'd like to be able to update existing computers. It
doesn't need to be and shouldn't be installed on systems that don't
have this receipt.

I believe the "requires" key is only to require that a Munki package
was already installed. Actually, "update_for" is probably more like
what I want since it is an update that I am installing, but it is an
update for a specific receipt not Munki package.

Greg Neagle

unread,
Mar 1, 2012, 6:31:05 PM3/1/12
to munk...@googlegroups.com
I'd make sure the fixed package has a higher version number than the "broken" one, then add the item to managed_updates.

This scenario is almost exactly what managed_updates was designed for.

managed_installs _installs_ an item if it's missing.
managed_updates updates items that are already installed, but does not install an item if it isn't already installed.

-Greg

Paul Bloch

unread,
Mar 1, 2012, 6:49:01 PM3/1/12
to munki-dev
I may be confused, but it seems like managed_updates needs to refer to
a Munki package that it is updating. The package it is updating is not
a Munki package. It is a package that was installed by InstaDMG.

Here is how I know whether to install my update. I install it if the
version of edu.uoregon.cs.pkg.CIS_ConfigFiles is 1.0.

root@pragma: ~ 72# pkgutil --pkg-info
edu.uoregon.cs.pkg.CIS_ConfigFiles
package-id: edu.uoregon.cs.pkg.CIS_ConfigFiles
version: 1.0
volume: /
location:
install-time: 1317336258

Paul

Greg Neagle

unread,
Mar 1, 2012, 6:57:01 PM3/1/12
to munk...@googlegroups.com
On Mar 1, 2012, at 3:49 PM, Paul Bloch wrote:

> I may be confused, but it seems like managed_updates needs to refer to
> a Munki package that it is updating. The package it is updating is not
> a Munki package. It is a package that was installed by InstaDMG.

Doesn't matter. Munki doesn't care how a package was originally installed. That the whole point of managed_updates -- if you used Munki to install the package, it would be in managed_installs.

> Here is how I know whether to install my update. I install it if the
> version of edu.uoregon.cs.pkg.CIS_ConfigFiles is 1.0.
>
> root@pragma: ~ 72# pkgutil --pkg-info
> edu.uoregon.cs.pkg.CIS_ConfigFiles
> package-id: edu.uoregon.cs.pkg.CIS_ConfigFiles
> version: 1.0
> volume: /
> location:
> install-time: 1317336258

Great. Create a new package with package-id "edu.uoregon.cs.pkg.CIS_ConfigFiles" and bump the version to 1.1 or 2.0 or whatever. Import it into your Munki repo and add it to managed_updates.

When managedsoftwareupdate runs, it will look for a "edu.uoregon.cs.pkg.CIS_ConfigFiles" receipt.
If it finds no "edu.uoregon.cs.pkg.CIS_ConfigFiles" receipt, it will do nothing.
If it finds a "edu.uoregon.cs.pkg.CIS_ConfigFiles" receipt with a version less than the version in your new package, it will install your new package.
If it finds a "edu.uoregon.cs.pkg.CIS_ConfigFiles" receipt with a version equal to or greater than your new package, it will do nothing.

Paul Bloch

unread,
Mar 1, 2012, 7:02:23 PM3/1/12
to munki-dev
This is great. Thanks.

Paul
Reply all
Reply to author
Forward
0 new messages