summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-04-30 05:36:19 +0000
committerMichał Górny <mgorny@gentoo.org>2013-04-30 05:36:19 +0000
commitb3f66563d4e37e2d4eb8653b6f5cbf78af181a57 (patch)
treed82eeafca6cc800a06718ccfe063057fe0ddeb16 /eclass
parentSupport declaring python_check_deps() in ebuilds, to check Python impl for pr... (diff)
downloadgentoo-2-b3f66563d4e37e2d4eb8653b6f5cbf78af181a57.tar.gz
gentoo-2-b3f66563d4e37e2d4eb8653b6f5cbf78af181a57.tar.bz2
gentoo-2-b3f66563d4e37e2d4eb8653b6f5cbf78af181a57.zip
Use bash built-ins rather than external tools.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/distutils-r1.eclass8
-rw-r--r--eclass/python-utils-r1.eclass7
3 files changed, 14 insertions, 7 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 314fdde94f1b..dd11df0e7549 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.807 2013/04/30 05:34:33 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.808 2013/04/30 05:36:19 mgorny Exp $
+
+ 30 Apr 2013; Michal Gorny <mgorny@gentoo.org> distutils-r1.eclass,
+ python-utils-r1.eclass:
+ Use bash built-ins rather than external tools.
30 Apr 2013; Michal Gorny <mgorny@gentoo.org> python-any-r1.eclass:
Support declaring python_check_deps() in ebuilds, to check Python impl for
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 991d0a1f083f..47b5b97a3fed 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.69 2013/04/18 15:47:28 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.70 2013/04/30 05:36:19 mgorny Exp $
# @ECLASS: distutils-r1
# @MAINTAINER:
@@ -394,9 +394,11 @@ _distutils-r1_rename_scripts() {
while IFS= read -r -d '' f; do
debug-print "${FUNCNAME}: found executable at ${f#${D}/}"
- if [[ "$(head -n 1 "${f}")" == '#!'*${EPYTHON}* ]]
+ local shebang
+ read -r shebang < "${f}"
+ if [[ ${shebang} == '#!'*${EPYTHON}* ]]
then
- debug-print "${FUNCNAME}: matching shebang: $(head -n 1 "${f}")"
+ debug-print "${FUNCNAME}: matching shebang: ${shebang}"
local newf=${f}-${EPYTHON}
debug-print "${FUNCNAME}: renaming to ${newf#${D}/}"
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 81e6d59085de..9807d7fbc6a0 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.22 2013/04/14 00:10:00 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.23 2013/04/30 05:36:19 mgorny Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -493,8 +493,9 @@ _python_rewrite_shebang() {
local f
for f; do
- local shebang=$(head -n 1 "${f}" | sed 's/\r$//')
- local from
+ local from shebang
+ read -r shebang < "${f}"
+ shebang=${shebang%$'\r'}
debug-print "${FUNCNAME}: path = ${f}"
debug-print "${FUNCNAME}: shebang = ${shebang}"