Mercurial > hg
diff tests/test-archive @ 4805:beb774707c52
test-archive: stop checking md5 absolute values
Different tar/zlib versions can generate different binaries.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 05 Jul 2007 20:39:03 +0200 |
parents | ca023b63ba1f |
children | 0e2d0a78f81a 6dc0094c0827 |
line wrap: on
line diff
--- a/tests/test-archive Thu Jul 05 19:13:08 2007 +0200 +++ b/tests/test-archive Thu Jul 05 20:39:03 2007 +0200 @@ -39,16 +39,22 @@ hg archive -t tgz -p %b-%h test-%h.tar.gz gzip -dc test-$QTIP.tar.gz | tar tf - | sed "s/$QTIP/TIP/" -cat > md5check.py <<EOF +cat > md5comp.py <<EOF import md5, sys -print md5.md5(file(sys.argv[1], 'rb').read()).hexdigest() +f1, f2 = sys.argv[1:3] +h1 = md5.md5(file(f1, 'rb').read()).hexdigest() +h2 = md5.md5(file(f2, 'rb').read()).hexdigest() +print h1 == h2 or "md5 differ: " + repr((h1, h2)) EOF +# archive name is stored in the archive, so create similar +# archives and rename them afterwards. hg archive -t tgz tip.tar.gz -python md5check.py tip.tar.gz +mv tip.tar.gz tip1.tar.gz sleep 1 hg archive -t tgz tip.tar.gz -python md5check.py tip.tar.gz +mv tip.tar.gz tip2.tar.gz +python md5comp.py tip1.tar.gz tip2.tar.gz hg archive -t zip -p /illegal test.zip hg archive -t zip -p very/../bad test.zip