-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
munkipkg --sync error with empty payload directory #57
Comments
created pull request #58 |
This is interesting but I wonder why you even feel the need to run —sync when there is no payload! |
This section from README.md describes my use case:
The problem is, because I am using git, which does not track empty directories, when I clone the project it doesn't have a payload directory. No big deal, here is what README.md says to do in this situation:
I tried to go this route because it is what the readme prescribed, and because hey, it might be useful if this package ever does have a payload. Because the code as is does not do what the documentation says it does in this situation, I submitted this issue and pull request. Running "mkdir payload" after cloning my projects is also an option. Another nice solution would be if I could specify in the build-info that the project does not have a payload, but should leave a receipt anyway. |
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!
The text was updated successfully, but these errors were encountered: