Re: [PATCH] t5300-pack-object.sh: portability issue using /usr/bin/stat
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 7, 2007, 04:13 UTC
- Message-ID
- <7vabxkhleh.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <alpine.LFD.0.98.0704062227430.28181@xanadu.home>
Nicolas Pitre <nico@cam.org> writes:
Show 15 quoted lines
> On Fri, 6 Apr 2007, Junio C Hamano wrote: > >> arjen@yaph.org (Arjen Laarhoven) writes: >> >> > In the test 'compare delta flavors', /usr/bin/stat is used to get file size. >> > This isn't portable. There already is a dependency on Perl, use its '-s' >> > operator to get the file size. >> >> If you do use Perl, then you do not want to do it as two >> separate invocations with their result compared with test. >> >> How about this on top of your patch? > > Well... since this test already depends on wc then why not just use that > instead of adding a perl dependency?
Because (1) other tests already use Perl; (2) wc -c reads pack to find out the size, "-s $file" doesn't AFAIK.