2008/7/12 Brad Hall <[EMAIL PROTECTED]>: > On Fri, Jul 11, 2008 at 11:36:43PM -0500, Shawn Walker wrote: >> > OK, Brock is right. The new webrev only calls fetch_files_byhash if >> > content_hashes has a length > 0. >> > >> > Here's the link again: http://cr.opensolaris.org/~bgh/bug-2104/ >> >> http://cr.opensolaris.org/~bgh/bug-2104/src/pull.py.wdiff.html >> ========== >> 297 + print "No files to retrieve." >> >> All messages printed to the client should go through msg() emsg() or >> error(). In this case, msg() is appropriate. >> >> While there are other places in this file that haven't been changed >> yet, I'd like to see it start here. >> >> You just need to "from pkg.misc import msg" >> >> -- >> Shawn Walker > > OK, updated webrev. Is there already a bug filed to track offenders in this > and other files?
No, as the point was originally to take care of them in client.py. However, it also applies to pull.py, etc. Feel free to file one. The msg(), emsg() methods basically help trap PipeErrors caused by the client using a command and piping the output to less, grep, pipe, etc. or prematurely canceling output with ctrl-c. I forgot you'll also need to do the same thing in pull.py that we do in client.py. Like this: 1456 if __name__ == "__main__":" 1457 try: 1458 ret = main_func() 1459 except SystemExit, e: 1460 raise e 1461 except (PipeError, KeyboardInterrupt): 1462 # We don't want to display any messages here to prevent possible 1463 # further broken pipe (EPIPE) errors. 1464 sys.exit(1) It's very important that no further messages are printed during exit. -- Shawn Walker _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
