复制目录除了.svn

问题描述
本地编译通过,而Jenkins编译不过,日志如下:
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/all-wcprops: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/entries: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/about.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/dictionary.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/fuzzySound.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/general.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/handwrite.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/keyboard.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/keyboard_tick.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/mohu.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/Root.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/shuangpin.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/prop-base/UserProtocol.html.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/about.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/dictionary.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/fuzzySound.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/general.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/handwrite.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/keyboard.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/keyboard_tick.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/mohu.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/Root.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/shuangpin.plist.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/.svn/text-base/UserProtocol.html.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/all-wcprops: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/entries: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/prop-base/Root.strings.svn-base: Permission denied
cp: ../SettingsKit/SettingsKit/UserDefaults.bundle/en.lproj/.svn/text-base/Root.strings.svn-base: Permission denied

问题分析
报的错是当cp命令时.svn目录没有权限。
其实.svn目录不应该copy。

问题解决
把脚本中的命令:cp -r config/ temp/
改为:rsync -rv --exclude=.svn config/ temp/