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

[PATCH] t9502: do not assume GNU tar

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2012, 05:03 UTC
Message-ID
<7vehimd46m.fsf@alter.siamese.dyndns.org>

The check_snapshot function inspects and makes sure that not cruft outside the repository hierarchy is added to the tar archive, by insisting that the output from "tar tf" on the resulting archive does not contain anything that does not begin with "$prefix/". There are two issues with this implementation:

 - Traditional tar implemenations that do not understand
   pax_global_header will write it out as if it is a plain file at
   the top-level;
 - Some implementations of tar does not add trailing slash when
   showing a directory entry (i.e. the output line for the entire
   archive will show "$prefix", not "$prefix/").

Fix them so that what we want to validate can be tested with traditional tar implementations.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t9502-gitweb-standalone-parse-output.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
index 731e64c..c662298 100755
--- a/t/t9502-gitweb-standalone-parse-output.sh
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -40,7 +40,7 @@ check_snapshot () {
 	echo "basename=$basename"
 	grep "filename=.*$basename.tar" gitweb.headers >/dev/null 2>&1 &&
 	"$TAR" tf gitweb.body >file_list &&
-	! grep -v "^$prefix/" file_list
+	! grep -v -e "^$prefix$" -e "^$prefix/" -e "^pax_global_header$" file_list
 }
 
 test_expect_success setup '
-- 
1.8.1.rc2.196.g90926c8
Message 1 of 1 in “t9502: do not assume GNU tar”
  1. t9502: do not assume GNU tarJunio C Hamano, Dec 19, 2012

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.