response = urllib2.urlopen(url)
filename = urllib2.unquote(os.path.basename(response.geturl()))
+ if filename == "":
+ sys.stderr.write("Debug (%s): filename: %s url: %s\n" %(entry['package'], filename, response.geturl()))
+ return
+
destfile = os.path.join(OUTPUT_DIR, filename)
if os.path.exists(destfile):
- sys.stderr.write("Warning: %s exists!\n" % destfile)
+ sys.stderr.write("Warning (%s): %s exists!\n" % (entry['package'], destfile))
return
+
outfile = open(destfile, mode='w')
total_size = response.info().getheader('Content-Length').strip()