From: Zac Medico Date: Tue, 20 Dec 2011 07:24:38 +0000 (-0800) Subject: Force COLUMNS > 0 for bug #394091. X-Git-Tag: v2.2.0_alpha82~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5f5f54b524b22e85c14539a9bb2ce52c7a4e312b;p=portage.git Force COLUMNS > 0 for bug #394091. --- diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 37aead0f3..3c0d023d4 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -313,6 +313,10 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, columns = os.environ.get("COLUMNS") if columns is None: rows, columns = portage.output.get_term_size() + if columns < 1: + # Force a sane value for COLUMNS, so that tools + # like ls don't complain (see bug #394091). + columns = 80 columns = str(columns) os.environ["COLUMNS"] = columns mysettings["COLUMNS"] = columns