From 5f5f54b524b22e85c14539a9bb2ce52c7a4e312b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 19 Dec 2011 23:24:38 -0800 Subject: [PATCH] Force COLUMNS > 0 for bug #394091. --- pym/portage/package/ebuild/doebuild.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.26.2