aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'portage_with_autodep/bin/ebuild-helpers/unprivileged')
l---------portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp1
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/unprivileged/chown41
2 files changed, 42 insertions, 0 deletions
diff --git a/portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp
new file mode 120000
index 0000000..6fb0fcd
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp
@@ -0,0 +1 @@
+chown \ No newline at end of file
diff --git a/portage_with_autodep/bin/ebuild-helpers/unprivileged/chown b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chown
new file mode 100755
index 0000000..08fa650
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chown
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Copyright 2012-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+scriptpath=${BASH_SOURCE[0]}
+scriptname=${scriptpath##*/}
+
+IFS=':'
+
+for path in ${PATH}; do
+ [[ -x ${path}/${scriptname} ]] || continue
+ [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue
+ 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
+ EPREFIX=
+ fi
+ msg="${scriptname} failure ignored with unprivileged user:\n ${scriptname} $*\n ${output}"
+ # Reverse expansion of ${D} and ${EPREFIX}, for readability.
+ msg=${msg//${D}/'${D}'}
+ if [[ -n ${EPREFIX} ]] ; then
+ msg=${msg//${EPREFIX}/'${EPREFIX}'}
+ msg=${msg//${EPREFIX#/}/'${EPREFIX}'}
+ fi
+ ewarn "${msg}"
+ fi
+ exit 0
+done
+
+exit 1