-
Notifications
You must be signed in to change notification settings - Fork 75
Description
I am trying to use the --export-bom-info and --sync workflow described in the munkipkg documentation in order to track pseudo-payload-free munkipkg projects using git. My version of munkipkg is 0.8 and my version of Mac OS is 12.0.1. I have a project with a postinstall script and an empty payload directory. My working directory is the project directory. I run "munkipkg --export-bom-info ." to build the current directory. Output:
pkgbuild: Inferring bundle components from contents of ./payload
pkgbuild: Writing new component property list to /var/folders/q2/9hr7dsmj6rbbgm_b3373kxghw9630x/T/tmp3e8Gml/component.plist
pkgbuild: Reading components from /var/folders/q2/9hr7dsmj6rbbgm_b3373kxghw9630x/T/tmp3e8Gml/component.plist
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to ./build/PROJECTNAME-1.0.pkg
munkipkg: Extracting bom file from ./build/PROJECTNAME-1.0.pkg
munkipkg: Exporting bom info to ./Bom.txt
Bom.txt contains one line:
.\t40755\t0/0\n
Then, I clone the git repo that contains this project. As expected, the cloned project is missing the payload directory. From within the cloned munkipkg project directory, I run "munkipkg --sync ." Output:
munkipkg: Creating ./payload/. with mode 0755
ERROR: [Errno 2] No such file or directory: './payload/.'
The payload directory is not recreated.
On line 392, payload_path is set to "./payload/." When that directory is found to not exist on line 403, line 417 attempts to create it by running "mkdir ./payload/.". This throws an error because the parent directory of payload/., payload, does not exist. It sounds stupid, but it is technically true. This can be fixed by adding the -p flag to the mkdir command, which causes it to create intermediate parent directories as needed. The end result is that ./payload is created, then nothing happens when ./payload/. is created. Success!