Just spent a costly 30 minutes finding out how to create a tgz tarball on OSX Lion without all the hidden ._ files. These files are the result of using the HFS or HFS+ filesystem.
What I got when issuing a tar -zcvf my-package.tar.gz dir1/ was a structure like this:
1
2
3
4
5
6
7
8
9
10
11
| .
._dir1
dir1
._file1
file1
._file2
file2
._subdir
subdir
._file3
file3 |
When extracting this tarball on Linux, you’ll get all the unnecessary ._ files.
To prevent them from being packaged in the first place, issue the following command from your Terminal: export COPYFILE_DISABLE=true
PS: You could make this setting ‘stick’ by adding them to your ~/.bash_profile
The result now will be a nice and clean tarball:
1
2
3
4
5
6
| .
dir1
file1
file2
subdir
file3 |