In terms of adding "tail-like" functionality to Koji "watch-logs" sub-command:&nbsp;<br><br><br>https://fedorahosted.org/koji/ticket/41<br>https://fedorahosted.org/koji/ticket/76<br><br><br><br>$ ./koji-1.6.0/cli/koji watch-logs 3559606 --log=build.log --tail=10<br>Watching logs (this may be safely interrupted)...<br>Wrote: /builddir/build/RPMS/calibre-0.8.29-1.fc15.i686.rpm<br>Wrote: /builddir/build/RPMS/calibre-debuginfo-0.8.29-1.fc15.i686.rpm<br>Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.RypJxm<br>+ umask 022<br>+ cd /builddir/build/BUILD<br>+ cd calibre<br>+ /bin/rm -rf /builddir/build/BUILDROOT/calibre-0.8.29-1.fc15.i386<br>+ exit 0<br>Child returncode was: 0<br>LEAVE do --&gt;&nbsp;<br><br><br><br><br>$ diff -u /usr/bin/koji ./koji-1.6.0/cli/koji<br>--- /usr/bin/koji<span class="Apple-tab-span" style="white-space:pre">        </span>2010-12-16 16:13:17.000000000 -0500<br>+++ ./koji-1.6.0/cli/koji<span class="Apple-tab-span" style="white-space:pre">        </span>2011-12-03 17:09:42.225650495 -0500<br>@@ -433,6 +433,7 @@<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;offsets[task_id] = {}<br>&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lastlog = None<br>+ &nbsp; &nbsp; &nbsp; &nbsp;logline = ""<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;while True:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for task_id in tasklist[:]:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if _isDone(session, task_id):<br>@@ -458,15 +459,28 @@<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;currlog = "%d:%s:" % (task_id, log)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if currlog != lastlog:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if lastlog:<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sys.stdout.write("\n")<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sys.stdout.write("==&gt; %s &lt;==\n" % currlog)<br>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;logline += ("\n")<br>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;logline += ("==&gt; %s &lt;==\n" % currlog)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lastlog = currlog<br>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sys.stdout.write(contents)<br>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;logline += (contents)<br>&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not tasklist:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break<br>&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;time.sleep(options.poll_interval)<br>+ &nbsp; &nbsp; &nbsp; &nbsp;<br>+ &nbsp; &nbsp; &nbsp; &nbsp;loglist = logline.strip("\n").split("\n")<br>+ &nbsp; &nbsp; &nbsp; &nbsp;endline = len(loglist)<br>+ &nbsp; &nbsp; &nbsp; &nbsp;try:<br>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;subvalue = int(opts.tail)<br>+ &nbsp; &nbsp; &nbsp; &nbsp;except:<br>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;subvalue = endline<br>+ &nbsp; &nbsp; &nbsp; &nbsp;if (subvalue &gt; endline):<br>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;subvalue = endline<br>+ &nbsp; &nbsp; &nbsp; &nbsp;begline = (endline - subvalue)<br>+ &nbsp; &nbsp; &nbsp; &nbsp;for x in range(begline, endline):<br>+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(loglist[x])<br>+ &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp;except (KeyboardInterrupt):<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pass<br>&nbsp;<br>@@ -5083,6 +5097,7 @@<br>&nbsp; &nbsp; &nbsp;usage += _("\n(Specify the --help global option for a list of other help options)")<br>&nbsp; &nbsp; &nbsp;parser = OptionParser(usage=usage)<br>&nbsp; &nbsp; &nbsp;parser.add_option("--log", help=_("Watch only a specific log"))<br>+ &nbsp; &nbsp;parser.add_option("--tail", help=_("Watch only the last N lines"))<br>&nbsp; &nbsp; &nbsp;(options, args) = parser.parse_args(args)<br>&nbsp; &nbsp; &nbsp;activate_session(session)<br>&nbsp;<br>