如何创建在相同的格式Finder的&QUOT一个zip文件;的COM preSS"菜单项? [英] How to create a zip file in the same format as the Finder's "Compress" menu item?
问题描述
在Mac OS X中,您可以通过选择一些文件,然后从上下文菜单或文件菜单中选择的COM preSS创建从Finder中的zip压缩文件。不幸的是,生成的文件是不相同的拉链
命令(默认选项)创建存档。
On Mac OS X, you can create a zip archive from the Finder by selecting some files and selecting "Compress" from the contextual menu or the File menu. Unfortunately, the resulting file is not identical to the archive created by the zip
command (with the default options).
这区别的事项由苹果运营至少一个服务,它无法接受与拉链
命令创建的档案。不必手动创建归档是$ P $从完全自动化放我的构建过程pventing我。
This distinction matters to at least one service operated by Apple, which fails to accept archives created with the zip
command. Having to create archives manually is preventing me from fully automating my release build process.
我怎么能一个shell脚本中创建正确格式的zip压缩包?
How can I create a zip archive in the correct format within a shell script?
编辑:由于前不久写了这个问题,我已经想通了,同上之间的的关键区别
和拉链
是如何处理符号链接:因为一个应用程序包内的code签名包含一个符号,它需要pserved为纽带,而不是存储为普通文件$ p $。 同上
执行此默认,但拉链
不(选项 -y
是必需的)。
Since writing this question long ago, I've figured out that the key difference between ditto
and zip
is how they handle symbolic links: because the code signature inside an app bundle contains a symlink, it needs to be preserved as a link and not stored as a regular file. ditto
does this by default, but zip
does not (option -y
is required).
推荐答案
如下使用同上命令行工具:
Use the ditto command-line tool as follows:
ditto -ck --rsrc --sequesterRsrc folder file.zip
有关更多见同上手册页。
See the ditto man page for more.
这篇关于如何创建在相同的格式Finder的&QUOT一个zip文件;的COM preSS"菜单项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!