git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t5300-pack-object.sh: portability issue using /usr/bin/stat

From
Arjen Laarhoven <arjen@yaph.org>
Date
Apr 6, 2007, 23:49 UTC
Message-ID
<20070406234903.GJ3854@regex.yaph.org>

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.

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
---
 t/t5300-pack-object.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 35e036a..a400e7a 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -125,8 +125,8 @@ cd "$TRASH"
 
 test_expect_success \
     'compare delta flavors' \
-    'size_2=`stat -c "%s" test-2-${packname_2}.pack` &&
-     size_3=`stat -c "%s" test-3-${packname_3}.pack` &&
+    'size_2=`perl -e "print -s q[test-2-${packname_2}.pack]"` &&
+     size_3=`perl -e "print -s q[test-3-${packname_3}.pack]"` &&
      test $size_2 -gt $size_3'
 
 rm -fr .git2
-- 
1.5.1.rc3.29.gd8b6
Next: Junio C Hamano
Message 1 of 6 in “t5300-pack-object.sh: portability issue using /usr/bin/stat”
  1. t5300-pack-object.sh: portability issue using /usr/bin/statArjen Laarhoven, Apr 6, 2007
  2. Junio C HamanoApr 7, 2007
  3. Nicolas PitreApr 7, 2007
  4. Junio C HamanoApr 7, 2007
  5. Nicolas PitreApr 7, 2007
  6. Randal L. SchwartzApr 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.