munki / munki-pkg

Repo for the munkipkg tool and example projects
Other
343 stars 75 forks source link

Cannot make payload-free packages #25

Closed bradherdson closed 8 years ago

bradherdson commented 8 years ago

Cannot seem to make a payload-free package. It may very well be me misreading the documentation instructions... When I attempt to build a package with an empty payload folder I get the following error:

pkgbuild: error: Cannot write package to "/Volumes/SysDev/sysadmin/Packages/printerTest/build/printerTest-1.0.pkg". (The operation couldn’t be completed. Can't find "." in bom file)

On trying to build a payload-free package without a payload folder (i.e no receipt) I get this error:

ERROR: /Volumes/SysDev/sysadmin/Packages/printerTest does not contain a payload folder or a scripts folder.

gregneagle commented 8 years ago

I cannot replicate your issue. munki-pkg includes a payload-free demo package:

% ./munkipkg TurnOffBluetooth
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to TurnOffBluetooth/build/TurnOffBluetooth.pkg

I can turn it into a "pseudo-payload-free" package, by creating an empty payload directory:

% mkdir TurnOffBluetooth/payload
% ./munkipkg TurnOffBluetooth
pkgbuild: Inferring bundle components from contents of TurnOffBluetooth/payload
pkgbuild: Writing new component property list to /var/folders/tc/sd4_mtvj14jdy7cg21m2gmcw000495/T/tmpoWf2nt/component.plist
pkgbuild: Reading components from /var/folders/tc/sd4_mtvj14jdy7cg21m2gmcw000495/T/tmpoWf2nt/component.plist
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to TurnOffBluetooth/build/TurnOffBluetooth.pkg

Note that your last error message complains that there no no payload folder AND no scripts folder... Gotta have a least one of those.

bradherdson commented 8 years ago

Thanks for the quick response. I tried creating a payload-free package with the demo as you mentioned and it worked fine. The project I was trying to create was made with the --create parameter and contained a scripts and payload folder. Both empty. I moved this project into the same directory as the munki-pkg demo projects, attempted to build and I got the same error. Of course, when I re-created the project with munki-pkg --create and built it worked perfectly. I've tried to recreate the issue but cannot. facepalm followed by gentle sobbing

MLBZ521 commented 6 years ago

Just had the same issue occur to me. Was building packages just fine, then one template directory just started to fail with the same error:
pkgbuild: error: Cannot write package to "./build/<Software Title>-<version>.pkg". (The operation couldn’t be completed. Can't find "." in bom file) ERROR: Package creation failed.

Deleting the template folders (build, payload, and scripts) and then running: munkipkg --create . --force resolved the issue for me as well.

Not sure what happened to the folders, but ¯\(ツ)

Just posting incase anyone else run across this.

piersg commented 5 years ago

Thought I'd add to this as this page is the top Google hit for the message: "(The operation couldn’t be completed. Can't find "." in bom file)"

I wasn't using munkipkg (but pkgbuild directly), and was getting the above error. I had an invisible ".DS_Store" in my root directory, deleting it allowed my package to build

codeskipper commented 5 years ago

@piersg same here, had to do a rm payload/.DS_Store and munkipkg worked just fine once more