Denis Bilenko avatar Denis Bilenko committed be9cfbd update link to libevent tarball.

better error reporting in case of digest mismatch

Comments (0)

Files changed (1)

 """download and extract the libevent source archive
+url = ''
+hash = 'a00e037e4d3f9e4fe9893e8a2d27918c'
 import sys
 import os
 import urllib
         dirname = os.path.join(tmpdir, url.split("/")[-1][:-len(".tar.gz")])
         print "downloading libevent source from %s" % url
         tgz = urllib.urlopen(url).read()
-        if md5(tgz).hexdigest() != digest:
-            sys.exit("Error: wrong md5 sum")
+        tgz_digest = md5(tgz).hexdigest()
+        if tgz_digest != digest:
+            sys.exit("Error: wrong md5 sum: %r != %r" % (tgz_digest, digest))
         print "extracting to %s" % dst
         tf ="libevent-src.tar.gz",
+def main():
+    os.chdir(os.path.dirname(os.path.abspath(__file__)))
+    download_and_extract(url, hash)
 if __name__ == '__main__':
-    os.chdir(os.path.dirname(os.path.abspath(__file__)))
-    download_and_extract(
-        "",
-        "a00e037e4d3f9e4fe9893e8a2d27918c")
+    main()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.