I saw this problem when I manually created a tar archive for use as a Magento Connect archive. Unfortunately, I have no solution, but here's what I understand about the problem.
While Magento Connect tgz packages are technically compressed gzip tar archives, the code that creates and extracts these archives in a non- standard * nix tar tool. Instead, Magento implemented its own packaging and unpacking tarcode for Magento Connect.
downloader/lib/Mage/Archive/Tar.php
Unfortunately, this packaging and unpacking code did not pass reliable verification on different operating systems or tar archives created with standard * nix tools. My problem with this code was that archives created on my Mac OS system via tar would not be correctly unpacked with Magento Connect code on a Linux system.
It is difficult to track, difficult to report, difficult to reproduce, difficult to fix.
These directories are created when Magento Connect unpacks the tgz file. I'm 99% sure your directories are created using this bit of code
#File: downloader/lib/Mage/Archive/Tar.php if (in_array($header['type'], array("0",chr(0), ''))) { if(!file_exists($dirname)) { $mkdirResult = @mkdir($dirname, 0777, true); if (false === $mkdirResult) { throw new Mage_Exception('Failed to create directory ' . $dirname); } } $this->_extractAndWriteFile($header, $currentFile); $list[] = $currentFile; } elseif ($header['type'] == '5') { if(!file_exists($dirname)) { $mkdirResult = @mkdir($currentFile, $header['mode'], true); if (false === $mkdirResult) { throw new Mage_Exception('Failed to create directory ' . $currentFile); } } $list[] = $currentFile . DS;
These are two places where Magento unpacks archives and creates a folder. For some reason, there is a certain condition for your two systems, where the data is packed or unpacked incorrectly to / from the archive file. Try not to archive the tgz file manually using the command line tool or your operating system integrated into the program without an archive. If strange things happen, then at least you know this packing code, that is the problem.
This is definitely a mistake, and while I'm reporting this, the only "solution" will not be to create your archive on your local machine (as I understand it, this is a terrible solution, but our question should not question why and all that)