munki-rebrand
munki-rebrand copied to clipboard
Adds --resource-addition option
Adds the option for --resource-addition to allow the addition of another file in the Scripts directory, typically another pkg installer such as one including middleware or additional python modules.
holy shnikes! this could be useful. i have some crazy scripts around rebrand right now to add my middleware pkg etc.
This happens to me when I try to add middleware, am I adding the option correctly?
sudo ./munki-rebrand/munki_rebrand.py -a "Managed Software Center" -i logo.png -p build/groupname/postinstall -r build/groupname/middleware-1.3.pkg -s "Developer ID Installer: redacted" -o build/groupname/ManagedSoftwareCenter-groupname
Converting .png file to .icns...
Downloading munkitools from https://github.com/munki/munki/releases/download/v5.6.2/munkitools-5.6.2.4398.pkg...
Copying postinstall script build/groupname/postinstall to /tmp/tmpalz9own_/root/munkitools_app.pkg/Scripts/postinstall...
Making /tmp/tmpalz9own_/root/munkitools_app.pkg/Scripts/postinstall executable...
Adding additional resource build/groupname/middleware-1.3.pkg to /tmp/tmpalz9own_/root/munkitools_app.pkg/Scripts/build/groupname/middleware-1.3.pkg...
Traceback (most recent call last):
File "./munki-rebrand/munki_rebrand.py", line 641, in <module>
main()
File "./munki-rebrand/munki_rebrand.py", line 501, in main
shutil.copyfile(args.resource_addition, dest)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpalz9own_/root/munkitools_app.pkg/Scripts/build/groupname/middleware-1.3.pkg'
Cleaning up...
Done.
@kginger Looks like it's grabbing the full path of build/groupname/middleware-1.3.pkg
and capturing that as the filename. I only tested with the middleware package being in the same directory as the script. I'll see if I can fix that, but in the mean time, try it with the pkg in the same directory so you can call -r middleware-1.3.pkg
@patgmac that worked, I could have thought of that. This will help a lot with goofy scripting and race conditions with middleware. Thank you!
I would love to see this added to the new 5.2 main.
I would love to see this added to a new version!!!
Have you tested what effect including a pkg in the Scripts dir has on signing and notarizing the pkg?
@fuzzylogiq I do sign the rebranded package, no problems there. I do not notarize the package (or apps).
@fuzzylogiq I've updated the PR.
@fuzzylogiq Any interest in merging this PR?