Merged from trunk 6466:6467
authorFabian Groffen <grobian@gentoo.org>
Wed, 2 May 2007 19:51:30 +0000 (19:51 -0000)
committerFabian Groffen <grobian@gentoo.org>
Wed, 2 May 2007 19:51:30 +0000 (19:51 -0000)
   +------------------------------------------------------------------------+
   | 6467    | Fix eend so that it works properly on a standard BSD         |
   | zmedico | console. Thanks to UberLord.                                 |
   +------------------------------------------------------------------------+

svn path=/main/branches/prefix/; revision=6470

bin/isolated-functions.sh
pym/portage/output.py

index d994333fee951c3efdc2dca71caa9d5a58e63a14..ac10d087ff01c498a0f94e92e5c5ff29f762d716 100755 (executable)
@@ -281,6 +281,8 @@ set_colors() {
        (( COLS == 0 )) && COLS=$(set -- $(stty size 2>/dev/null) ; echo $2)
        (( COLS > 0 )) || (( COLS = 80 ))
        COLS=$((${COLS} - 8))   # width of [ ok ] == 7
+       # Adjust COLS so that eend works properly on a standard BSD console.
+       [ "${TERM}" = "cons25" ] && COLS=$((${COLS} - 1))
 
        ENDCOL=$'\e[A\e['${COLS}'C'    # Now, ${ENDCOL} will move us to the end of the
                                       # column;  irregardless of character width
index d7f051f53baa181601234936f8a7b8f167511474..406f02b53075acf640166b92f4d42ca7474cc99f 100644 (file)
@@ -277,6 +277,9 @@ class EOutput:
                                pass
                if columns <= 0:
                        columns = 80
+               # Adjust columns so that eend works properly on a standard BSD console.
+               if os.environ.get("TERM") == "cons25":
+                       columns = columns - 1
                self.term_columns = columns
 
        def __eend(self, caller, errno, msg):