aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2013-09-09 14:43:02 -0700
committerZac Medico <zmedico@gentoo.org>2013-09-09 14:43:02 -0700
commit67979d49c7c3d99c95b99994015150c92ce2d21d (patch)
treede7948c41ef2e3cd766717f7406d0f61eaf20af0 /bin/ebuild-helpers
parentdoexe/newins: mktemp for bug #484332 (diff)
downloadportage-67979d49c7c3d99c95b99994015150c92ce2d21d.tar.gz
portage-67979d49c7c3d99c95b99994015150c92ce2d21d.tar.bz2
portage-67979d49c7c3d99c95b99994015150c92ce2d21d.zip
unprivileged/chown: fix bug #470992v2.2.2
Diffstat (limited to 'bin/ebuild-helpers')
-rwxr-xr-xbin/ebuild-helpers/unprivileged/chown10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/ebuild-helpers/unprivileged/chown b/bin/ebuild-helpers/unprivileged/chown
index cad34d947..08fa650c5 100755
--- a/bin/ebuild-helpers/unprivileged/chown
+++ b/bin/ebuild-helpers/unprivileged/chown
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
scriptpath=${BASH_SOURCE[0]}
@@ -13,6 +13,14 @@ for path in ${PATH}; do
IFS=$' \t\n'
output=$("${path}/${scriptname}" "$@" 2>&1)
if [[ $? -ne 0 ]] ; then
+
+ # Avoid an extreme performance problem when the
+ # output is very long (bug #470992).
+ if [[ $(wc -l <<< "${output}") -gt 100 ]]; then
+ output=$(head -n100 <<< "${output}")
+ output="${output}\n ... (further messages truncated)"
+ fi
+
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if ! ___eapi_has_prefix_variables; then