summaryrefslogtreecommitdiffstats
path: root/bin/dispatch-conf
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-05 01:59:15 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-05 01:59:15 +0000
commitf659df8f7feedf5d597fdb80b9a0000ee5691057 (patch)
treed92faca40b3c4e1634dec336a043d9bdfccdff58 /bin/dispatch-conf
parent16125ffdb9798c37a716f30f243439618b931c77 (diff)
downloadportage-f659df8f7feedf5d597fdb80b9a0000ee5691057.tar.gz
portage-f659df8f7feedf5d597fdb80b9a0000ee5691057.tar.bz2
portage-f659df8f7feedf5d597fdb80b9a0000ee5691057.zip
Bug #142508 - Clear the screen each time before calling
the "diff" command so that any remnants of the previous config are now shown with the current one. (trunk r7893) svn path=/main/branches/2.1.2/; revision=7926
Diffstat (limited to 'bin/dispatch-conf')
-rwxr-xr-xbin/dispatch-conf14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 55bf13cfd..94e2d6cac 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -215,6 +215,7 @@ class dispatch:
show_new_diff = 0
while 1:
+ clear_screen()
if show_new_diff:
os.system((self.options['diff']) % (conf['new'], mrgconf))
show_new_diff = 0
@@ -377,6 +378,19 @@ def getch ():
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch
+def clear_screen():
+ try:
+ import curses
+ try:
+ curses.setupterm()
+ sys.stdout.write(curses.tigetstr("clear"))
+ sys.stdout.flush()
+ return
+ except curses.error:
+ pass
+ except ImportError:
+ pass
+ os.system("clear 2>/dev/null")
# run
d = dispatch ()