megastep / makeself

A self-extracting archiving tool for Unix systems, in 100% shell script.
https://makeself.io
GNU General Public License v2.0
2.29k stars 368 forks source link

archive size computed incorrectly on net-mounted filesystem #52

Open gbkti opened 9 years ago

gbkti commented 9 years ago

I've been testing makeself version 2.2.0. I noticed that --info always shows "Uncompressed size: 1 KB", no matter how much stuff is in the source directory. I added set -x and set -v to makeself.sh and saw that "du -sk " was returning 1. Running by hand does the same. The problem appears to be that I am building on a net-mounted filesystem, and du doesn't seem to get accurate block count for directories in that case. Moving off the net seems to fix it.

In the first example below note that "ls -l --blocksize=K" gives accurate block sizes for files on the net mount, but incorrectly gives 0 as the total size. "ls -ld --blocksize=K" gives "1" as the directory size, which matches the "du -sk" value, but disagrees with "ls -ld" on a non-net mount.

In the second (non-net) example the "du -sk" value is - correctly - the sum of the "ls -l" and "ls -ld" values. So, on my net mount both "du" and "ls -ld" return bogus total sizes, but "ls -l" can be relied on to return valid file sizes that can be added up. I don't know how to get a good directory sizing on the net mount.

Full disclosure: the filesystem is shared between VMWare VMs on a MacBook Pro, over localhost. Since the underlying medium is SSD, and the blocksize is virtualized, this may affect behavior.


Here's what I get on the net mount:

me@ubuntu:~/devshare/someplace/install/SXI-Linux$ du -sk source-files 1 source-files me@ubuntu:~/devshare/someplace/install/SXI-Linux$ ls -l --block-size=K source-files total 0K -rwxr-xr-x 1 501 dialout 6K Aug 6 14:57 config.sh -rwxr-xr-x 1 501 dialout 7K Aug 3 19:20 isysvd -rwxr-xr-x 1 501 dialout 142K Aug 3 14:53 pqos.exe -rwxr-xr-x 1 501 dialout 1K Aug 3 12:09 pqosSvc.env -rw-r--r-- 1 501 dialout 7K Aug 3 12:09 README me@ubuntu:~/devshare/someplacel/SXI-Linux$ ls -ld --block-size=K source-files drwxr-xr-x 1 501 dialout 1K Aug 6 14:57 source-files


Here's what I get on a non-net-mount:

me@ubuntu:/tmp$ du -sk source-files 176 source-files me@ubuntu:/tmp$ ls -l --block-size=K source-files total 172K -rwxr-xr-x 1 me me 6K Aug 6 16:33 config.sh -rwxr-xr-x 1 me me 7K Aug 6 16:33 isysvd -rwxr-xr-x 1 me me 142K Aug 6 16:33 pqos.exe -rwxr-xr-x 1 me me 1K Aug 6 16:33 pqosSvc.env -rw-r--r-- 1 me me 7K Aug 6 16:33 README me@ubuntu:/tmp$ ls -ld --block-size=K source-files drwxr-xr-x 2 me garybjerke 4K Aug 6 16:33 source-files

megastep commented 9 years ago

That's interesting, but aren't you basically just admitting that this is a problem with your system returning incorrect sizes, instead of with makeself itself? I'm pretty sure that --block-size option is not available outside of GNU ls. Actually, even the BSD version that comes with OS X doesn't support it so I would be reluctant to use that as an alternative.

gbkti commented 9 years ago

Of course you're right about the portability issue.

I have no other network mount to test on, therefore no way to know if this is just a problem with my network share on OSX (a VMWARE share, actually, so VMWare hypervisor could be part of it). I probably just should have dropped you a note instead of opening a bug report. In any case, consider it something you might want to test independently.

If it's reproduceable on other network mounts, then it probably should be considered a bug.

Thanks for your time.

From: Stéphane Peter notifications@github.com<mailto:notifications@github.com> Reply-To: megastep/makeself reply@reply.github.com<mailto:reply@reply.github.com> Date: Thursday, August 6, 2015 at 5:16 PM To: megastep/makeself makeself@noreply.github.com<mailto:makeself@noreply.github.com> Cc: Gary Bjerke gary.bjerke@krystallizetechnologies.com<mailto:gary.bjerke@krystallizetechnologies.com> Subject: Re: [makeself] archive size computed incorrectly on net-mounted filesystem (#52)

That's interesting, but aren't you basically just admitting that this is a problem with your system returning incorrect sizes, instead of with makeself itself? I'm pretty sure that --block-size option is not available outside of GNU ls. Actually, even the BSD version that comes with OS X doesn't support it so I would be reluctant to use that as an alternatively.

Reply to this email directly or view it on GitHubhttps://github.com/megastep/makeself/issues/52#issuecomment-128524621.