diff --git a/pisi/build.py b/pisi/build.py index e5f48b8d..2ba5bdd4 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -105,6 +105,7 @@ class PisiBuild: """Build the package in one shot.""" ui.info("Building PISI source package: %s\n" % self.spec.source.name) + util.xtermTitle("Building PISI source package: %s\n" % self.spec.source.name) self.compileActionScript() @@ -337,3 +338,4 @@ class PisiBuild: pkg.close() os.chdir(c) self.setState("buildpackages") + util.xtermTitleReset() diff --git a/pisi/util.py b/pisi/util.py index b71639ca..350fa1e3 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -19,6 +19,7 @@ # standard python modules import os +import sys import sha import shutil import statvfs @@ -101,6 +102,22 @@ def run_batch(cmd): return (successful,lines) +def xtermTitle(message): + """sets message as a console window's title""" + if os.environ.has_key("TERM") and sys.stderr.isatty(): + terminalType = os.environ["TERM"] + for term in ["xterm", "Eterm", "aterm", "rxvt", "screen", "kterm", "rxvt-unicode"]: + if terminalType.startswith(term): + sys.stderr.write("\x1b]2;"+str(message)+"\x07") + sys.stderr.flush() + break + +def xtermTitleReset(): + """resets console window's title""" + if os.environ.has_key("TERM"): + terminalType = os.environ["TERM"] + xtermTitle(os.environ["TERM"]) + ############################# # Path Processing Functions # #############################