Brock Pytlik wrote: > Is it possible to catch the exception more specifically? I'd feel better > catching the ReadError specifically rather than any and all exceptions. > > Also, one nit, please make the comment "are no files" or "is no file". > > On a larger scale, I'm not intimately familiar with this code, but I > can't figure out why we're retrieving a file by hash when the only > action is a depend action. From what I can tell from the action code, > dependency actions shouldn't have a hash attribute at all. So I'm > confused why we're even touching this code with the examples given. > > I'm probably just having a brain freeze, but can you help me understand > what's going on here? > > Ok, after poking around the code more, wouldn't the easiest thing to do be to just check whether hashes (in fetch_files_byhash) or content_hashes (in main_func) have a length of at least 1 before trying to open the tarfile? Really, can't the entire call to fetch_files_byhash be skipped if content_hashes is empty, and wouldn't that fix this problem without needing the try catch block at all?
Brock > Thanks, > Brock > > Brad Hall wrote: > >> Here is a proposed fix for bug #2104: >> >> CR: http://cr.opensolaris.org/~bgh/bug-2104/ >> BUG: http://defect.opensolaris.org/bz/show_bug.cgi?id=2104 >> >> Summary: >> - Gets rid of the stack trace printed when downloading a package that >> doesn't contain any files. (And allows it to continue instead of exiting) >> >> Thanks, >> Brad >> _______________________________________________ >> pkg-discuss mailing list >> [email protected] >> http://mail.opensolaris.org/mailman/listinfo/pkg-discuss >> >> > > _______________________________________________ > pkg-discuss mailing list > [email protected] > http://mail.opensolaris.org/mailman/listinfo/pkg-discuss > _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
