summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gentoo.org>2011-12-02 10:11:43 +0000
committerBrian Harring <ferringb@gentoo.org>2011-12-02 10:11:43 +0000
commitdbb6ca1aedcdf285ce20ea0c20f72f768e988e4e (patch)
tree260d30e6ac595b1a68600c1c3323cfbe09228fc8 /sys-apps/pkgcore
parentDrop no-herd. (diff)
downloadgentoo-2-dbb6ca1aedcdf285ce20ea0c20f72f768e988e4e.tar.gz
gentoo-2-dbb6ca1aedcdf285ce20ea0c20f72f768e988e4e.tar.bz2
gentoo-2-dbb6ca1aedcdf285ce20ea0c20f72f768e988e4e.zip
fix IFS manipulation bug reported in IRC
(Portage version: 2.1.10.37/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/pkgcore')
-rw-r--r--sys-apps/pkgcore/ChangeLog8
-rw-r--r--sys-apps/pkgcore/files/pkgcore-0.7.7-IFS-manipulation.patch111
-rw-r--r--sys-apps/pkgcore/pkgcore-0.7.7-r1.ebuild56
3 files changed, 174 insertions, 1 deletions
diff --git a/sys-apps/pkgcore/ChangeLog b/sys-apps/pkgcore/ChangeLog
index eb2e089b3474..e6d64c4e14d4 100644
--- a/sys-apps/pkgcore/ChangeLog
+++ b/sys-apps/pkgcore/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-apps/pkgcore
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/pkgcore/ChangeLog,v 1.135 2011/12/02 08:50:07 ferringb Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pkgcore/ChangeLog,v 1.136 2011/12/02 10:11:43 ferringb Exp $
+
+*pkgcore-0.7.7-r1 (02 Dec 2011)
+
+ 02 Dec 2011; Brian Harring <ferringb@gentoo.org> +pkgcore-0.7.7-r1.ebuild,
+ +files/pkgcore-0.7.7-IFS-manipulation.patch:
+ Fix IFS manipulation bug in helpers reported in irc
*pkgcore-0.7.7 (02 Dec 2011)
diff --git a/sys-apps/pkgcore/files/pkgcore-0.7.7-IFS-manipulation.patch b/sys-apps/pkgcore/files/pkgcore-0.7.7-IFS-manipulation.patch
new file mode 100644
index 000000000000..eee2ed516ac4
--- /dev/null
+++ b/sys-apps/pkgcore/files/pkgcore-0.7.7-IFS-manipulation.patch
@@ -0,0 +1,111 @@
+From 5c362279c739ff4c6b2cd0e54e8c978462809e28 Mon Sep 17 00:00:00 2001
+From: Brian Harring <ferringb@gmail.com>
+Date: Fri, 2 Dec 2011 02:06:07 -0800
+Subject: [PATCH] shift IFS manipulation into isolated-functions, since has
+ relies on it.
+
+---
+ pkgcore/ebuild/eapi-bash/ebuild-daemon.bash | 30 ++++------------------
+ pkgcore/ebuild/eapi-bash/ebuild.lib | 1 -
+ pkgcore/ebuild/eapi-bash/isolated-functions.lib | 25 ++++++++++++++++++-
+ 3 files changed, 30 insertions(+), 26 deletions(-)
+
+diff --git a/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash b/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash
+index 2260fa0..0a1c4be 100755
+--- a/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash
++++ b/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash
+@@ -3,30 +3,6 @@
+ # Copyright 2004-2011 Brian Harring <ferringb@gmail.com>
+ # License: BSD/GPL2
+
+-declare -a PKGCORE_SAVED_IFS
+-
+-pkgcore_push_IFS()
+-{
+- PKGCORE_SAVED_IFS[${#PKGCORE_SAVED_IFS[@]}]="${IFS-unset}"
+- if [[ $1 == unset ]]; then
+- unset IFS
+- else
+- IFS="$1"
+- fi
+- :
+-}
+-
+-pkgcore_pop_IFS()
+-{
+- if [[ ${#PKGCORE_SAVED_IFS[@]} == 0 ]]; then
+- die "pkgcore_pop_IFS invoked with nothing on the stack..."
+- fi
+- IFS=${PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]}
+- [[ ${IFS} == unset ]] && unset IFS
+- unset PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]
+- :
+-}
+-
+ # use ebd_read/ebd_write for talking to the running portage instance instead of echo'ing to the fd yourself.
+ # this allows us to move the open fd's w/out issues down the line.
+ ebd_read_line()
+@@ -131,6 +107,12 @@ pkgcore_ebd_exec_main()
+ exit 2;
+ fi
+
++ # get our die functionality now.
++ if ! source "${PKGCORE_BIN_PATH}/isolated-functions.lib"; then
++ ebd_write_line "failed sourcing isolated-functions.lib"
++ exit 2;
++ fi
++
+ ebd_read_line PKGCORE_PYTHON_BINARY
+ [ -z "$PKGCORE_PYTHON_BINARY" ] && die "empty PKGCORE_PYTHON_BINARY, bailing"
+ ebd_read_line PKGCORE_PYTHONPATH
+diff --git a/pkgcore/ebuild/eapi-bash/ebuild.lib b/pkgcore/ebuild/eapi-bash/ebuild.lib
+index 0ae3ed5..ff13300 100644
+--- a/pkgcore/ebuild/eapi-bash/ebuild.lib
++++ b/pkgcore/ebuild/eapi-bash/ebuild.lib
+@@ -234,7 +234,6 @@ load_ebuild()
+ # note that exit-handling loads the die functions, thus the custom failure there.
+ source "${PKGCORE_BIN_PATH}/exit-handling.lib" >&2 || { echo "ERROR: failed sourcing exit-handling.lib"; exit -1; }
+ source "${PKGCORE_BIN_PATH}/ebuild-default-functions.lib" >&2 || die "failed sourcing ebuild-default-functions.lib"
+-source "${PKGCORE_BIN_PATH}/isolated-functions.lib" >&2 || die "failed sourcing stripped down functions.lib"
+ source "${PKGCORE_BIN_PATH}/ebuild-env-utils.lib" >&2 || die "failed sourcing ebuild-env-utils.lib"
+
+ pkgcore_run_ebuild_phase()
+diff --git a/pkgcore/ebuild/eapi-bash/isolated-functions.lib b/pkgcore/ebuild/eapi-bash/isolated-functions.lib
+index faee73d..b589dfb 100644
+--- a/pkgcore/ebuild/eapi-bash/isolated-functions.lib
++++ b/pkgcore/ebuild/eapi-bash/isolated-functions.lib
+@@ -126,7 +126,30 @@ pkgcore_shopt_pop()
+ :
+ } &> /dev/null
+
++declare -a PKGCORE_SAVED_IFS
++
++pkgcore_push_IFS()
++{
++ PKGCORE_SAVED_IFS[${#PKGCORE_SAVED_IFS[@]}]="${IFS-unset}"
++ if [[ $1 == unset ]]; then
++ unset IFS
++ else
++ IFS="$1"
++ fi
++ :
++}
++
++pkgcore_pop_IFS()
++{
++ if [[ ${#PKGCORE_SAVED_IFS[@]} == 0 ]]; then
++ die "pkgcore_pop_IFS invoked with nothing on the stack..."
++ fi
++ IFS=${PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]}
++ [[ ${IFS} == unset ]] && unset IFS
++ unset PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]
++ :
++}
++
+ unset_colors
+-DONT_EXPORT_VARS="${DONT_EXPORT_VARS} PKGCORE_RC_.* PKGCORE_ESHOPT_STATE"
+
+ :
+--
+1.7.8.rc3
+
diff --git a/sys-apps/pkgcore/pkgcore-0.7.7-r1.ebuild b/sys-apps/pkgcore/pkgcore-0.7.7-r1.ebuild
new file mode 100644
index 000000000000..4ca8d0a32197
--- /dev/null
+++ b/sys-apps/pkgcore/pkgcore-0.7.7-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pkgcore/pkgcore-0.7.7-r1.ebuild,v 1.1 2011/12/02 10:11:43 ferringb Exp $
+
+EAPI="3"
+DISTUTILS_SRC_TEST="setup.py"
+
+inherit distutils eutils
+
+DESCRIPTION="pkgcore package manager"
+HOMEPAGE="http://pkgcore.googlecode.com/"
+SRC_URI="http://pkgcore.googlecode.com/files/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="-doc build"
+
+RDEPEND=">=dev-lang/python-2.4
+ >=dev-python/snakeoil-0.4.4
+ || ( >=dev-lang/python-2.5 dev-python/pycrypto )"
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx dev-python/pyparsing )"
+
+DOCS="AUTHORS NEWS"
+
+pkg_setup() {
+ # disable snakeoil 2to3 caching...
+ unset PY2TO3_CACHEDIR
+ python_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-${PV}-IFS-manipulation.patch"
+}
+
+src_compile() {
+ distutils_src_compile
+
+ if use doc; then
+ python setup.py build_docs || die "doc building failed"
+ fi
+}
+
+src_install() {
+ distutils_src_install
+
+ if use doc; then
+ dohtml -r build/sphinx/html/*
+ fi
+}
+
+pkg_postinst() {
+ distutils_pkg_postinst
+ pplugincache
+}