Overrides and adding scripts

976 views
Skip to first unread message

Ben Snyder

unread,
Jan 17, 2014, 3:16:44 PM1/17/14
to autopkg...@googlegroups.com
Attempting to figure out how to add a postinstall script to the Firefox pkg recipe via an override. The only examples I've found online refer to a method of adding scripts to pkginfo for use with munki, but the company I work for is an Absolute Manage shop. I see the Dropbox recipe references a folder containing a postinstall script, so is it as easy as overriding the PkgCreator processor?

Gregory Neagle

unread,
Jan 17, 2014, 3:41:44 PM1/17/14
to autopkg...@googlegroups.com
You won't be able to do this with a recipe override. You'll need to create a new recipe, most likely based on the existing Firefox pkg recipe. 

Sent from my iPhone

On Jan 17, 2014, at 12:16 PM, Ben Snyder <theaa...@gmail.com> wrote:

Attempting to figure out how to add a postinstall script to the Firefox pkg recipe via an override. The only examples I've found online refer to a method of adding scripts to pkginfo for use with munki, but the company I work for is an Absolute Manage shop. I see the Dropbox recipe references a folder containing a postinstall script, so is it as easy as overriding the PkgCreator processor?

--
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/groups/opt_out.

Timothy Sutton

unread,
Jan 17, 2014, 3:50:25 PM1/17/14
to autopkg...@googlegroups.com
Greg’s right, but just to expand:

Overrides don’t override processors, they just set initial variable values that override those of their parent recipes. (Overrides are actually just child recipes that are looked for in a special place).

You can take a look at what the Dropbox or TextWrangler recipes do with PkgCreator to point it to a scripts directory. Your override could in theory contain additional steps in the Process array, but these will only take place after all the steps happen in the parent recipe, which include finally building a package. So this is the part where you would need to fork and maintain your own recipe that uses a modified PkgCreator step that includes reference to a scripts directory.

This isn’t very much work to do once, except that when the Firefox recipe eventually changes upstream, you’ll need to manually merge in the changes rather than it being a simple “repo-update” command.

Your forked recipe would effectively be your override as well, you wouldn’t necessarily need to override your own recipe, which can contain all the customizations you want.

The other option is to consider finding a way to add your customizations to a separate package that doesn’t need to be installed alongside every new version of Firefox via Absolute Manage.


-Tim

Trouton, Rich R

unread,
Jan 17, 2014, 4:04:35 PM1/17/14
to <autopkg-discuss@googlegroups.com>
Ben,

I've got a Firefox receipe that has a postflight script, so it sounds like it's set up for you need.

It's available from here on my Github repo:

https://github.com/rtrouton/AutoPkg

Thanks,
Rich
---
Rich Trouton
trou...@janelia.hhmi.org

JFRC Help Desk
phone: x4030
email: help...@janelia.hhmi.org

The best way to get in touch with me is through email.

Trouton, Rich R

unread,
Jan 17, 2014, 4:12:28 PM1/17/14
to <autopkg-discuss@googlegroups.com>
Sorry, mine actually has a preinstall script, not postinstall. From the recipe's point of view though, that doesn't matter since the Scripts directory is what's defined. Just drop your postinstall script into the Scripts directory and then run the recipe.

The Scripts directory and the Firefox recipe should both be stored in the same directory.

Thanks,
Rich

On Jan 17, 2014, at 4:04 PM, "Trouton, Rich R" <trou...@janelia.hhmi.org>
wrote:

Ben Snyder

unread,
Jan 17, 2014, 4:50:59 PM1/17/14
to autopkg...@googlegroups.com
Thanks for the info guys. Rich your recipe will definitely be a good start.

jor...@bender.im

unread,
Dec 4, 2014, 5:15:06 PM12/4/14
to autopkg...@googlegroups.com
Reviving an old thread....

I have a few recipes that I would like to include preinstall scripts in.  I've added the key and string for Scripts and placed the Scripts folder in the same directory as my recipes.  I've created preinstall scripts modeled off of the same ones we use in our Casper packages.  When I attempt to run the package though that AutoPkgr generates the script does not run.

If I look at the payload of the package in Pacifist I can see under the Resources tab a folder called scripts with a script inside called preinstall.sh.

I've tried changing the name of the script to just preinstall to match what Pacifist shows for Casper preinstall scripts in packages and get the same result.

I've tried adding back the .sh, then running chown root:admin and chmod +x 777 and still get the same result.

Its like Installer doesn't see the script there because it doesn't even mention it in the logs if I install via terminal in verbose, or view the log for installer via the GUI when its running.

What am I missing?  Thanks in advance for the help. - Jordan

On Friday, January 17, 2014 4:12:28 PM UTC-5, Rich Trouton wrote:

Gregory Neagle

unread,
Dec 4, 2014, 6:28:43 PM12/4/14
to autopkg...@googlegroups.com
1) preinstall and postinstall scripts in flat packages must be named exactly that. No ".sh" or ".py" or ".pl" etc extensions. They must be executable. This has nothing to do with autopkg per se; it's how Apple packages work.

2) Take a look at some existing recipes that include scripts in packages they build:

3) Perhaps share a recipe that demonstrates the issue you are having.

-Greg

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

Jordan Bender

unread,
Dec 5, 2014, 9:18:35 AM12/5/14
to autopkg...@googlegroups.com
Thank Greg, I will take a look at those tomorrow morning. 

I don't have to much hands on experience making flat packages so I figured it's probably a formatting issue in my end (doubted it was related to autopkg). 

Will post an update tomorrow. 

Sent from my iPhone - Please excuse typographical errors and brevity. 
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/Mzo2vTjDLMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to autopkg-discu...@googlegroups.com.

Jordan Bender

unread,
Dec 5, 2014, 1:15:02 PM12/5/14
to autopkg...@googlegroups.com
That worked.  It was the extension plus the u+x, knew it would be something simple.  Thanks for the quick reply and help!

--
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/Mzo2vTjDLMI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to autopkg-discu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages