From 5bb99554a4101f39f9add3cd984870e977eb7333 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Sat, 30 May 2015 08:28:18 +0000 Subject: [QA] Do not rely on executable script in files/, do not call Portage internal functions, bug 550540. (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 9433907D693FB5B8!) --- sys-freebsd/ubin-wrappers/ChangeLog | 9 +++++-- sys-freebsd/ubin-wrappers/files/dowrap | 33 ------------------------ sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild | 28 +++++++++++++------- 3 files changed, 25 insertions(+), 45 deletions(-) delete mode 100755 sys-freebsd/ubin-wrappers/files/dowrap (limited to 'sys-freebsd') diff --git a/sys-freebsd/ubin-wrappers/ChangeLog b/sys-freebsd/ubin-wrappers/ChangeLog index d1259f3e60bd..a7afaa65be97 100644 --- a/sys-freebsd/ubin-wrappers/ChangeLog +++ b/sys-freebsd/ubin-wrappers/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-freebsd/ubin-wrappers -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/ubin-wrappers/ChangeLog,v 1.2 2012/12/08 09:06:05 ulm Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/ubin-wrappers/ChangeLog,v 1.3 2015/05/30 08:28:18 ulm Exp $ + + 30 May 2015; Ulrich Müller ubin-wrappers-0.ebuild, + -files/dowrap: + [QA] Do not rely on executable script in files/, do not call Portage internal + functions, bug 550540. 08 Dec 2012; Ulrich Müller ubin-wrappers-0.ebuild: Change LICENSE to public-domain, bug 441832. diff --git a/sys-freebsd/ubin-wrappers/files/dowrap b/sys-freebsd/ubin-wrappers/files/dowrap deleted file mode 100755 index be8d016ad894..000000000000 --- a/sys-freebsd/ubin-wrappers/files/dowrap +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh - - -if [[ $# -lt 1 ]] ; then - helpers_die "${0##*/}: at least one argument needed" - exit 1 -fi - -if [[ ! -d ${ED}${DESTTREE} ]] ; then - install -d "${ED}${DESTTREE}" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}"; exit 2; } -fi - -ret=0 - -for x in "$@" ; do - if [[ -e ${x} ]] ; then - echo "#!/bin/sh" > "${ED}${DESTTREE}/$(basename ${x})" - echo "exec ${x} "'${1:+"$@"}' >> "${ED}${DESTTREE}/$(basename ${x})" - chmod 0755 "${ED}${DESTTREE}/$(basename ${x})" - chown ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${ED}${DESTTREE}/$(basename ${x})" - else - echo "!!! ${0##*/}: $x does not exist" 1>&2 - false - fi - ((ret|=$?)) -done - -[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed" -exit ${ret} diff --git a/sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild b/sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild index a5b59651a8e5..b1935147837c 100644 --- a/sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild +++ b/sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild @@ -1,8 +1,8 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild,v 1.2 2012/12/08 09:06:05 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild,v 1.3 2015/05/30 08:28:18 ulm Exp $ -EAPI=4 +EAPI=5 DESCRIPTION="/usr/bin wrapper scripts for FreeBSD script compatibility" HOMEPAGE="http://www.gentoo.org" @@ -18,12 +18,20 @@ RDEPEND="${DEPEND}" S="${WORKDIR}" -src_install() -{ - - into /usr/bin - "${FILESDIR}/dowrap" "${EPREFIX}/bin/"{bunzip2,bzcat,cpio,egrep,fgrep,grep,gunzip,gzip,zcat} - use userland_BSD && "${FILESDIR}/dowrap" "${EPREFIX}/bin/sort" - use userland_GNU && "${FILESDIR}/dowrap" "${EPREFIX}/bin/"{fuser,sed,uncompress} +dowrap() { + local x + for x do + [[ -e ${x} ]] || die "${x} does not exist" + newbin - "$(basename "${x}")" <<-EOF + #!/bin/sh + exec ${x} \${1:+"\$@"} + EOF + done +} +src_install() { + dowrap \ + "${EPREFIX}"/bin/{bunzip2,bzcat,cpio,egrep,fgrep,grep,gunzip,gzip,zcat} + use userland_BSD && dowrap "${EPREFIX}"/bin/sort + use userland_GNU && dowrap "${EPREFIX}"/bin/{fuser,sed,uncompress} } -- cgit v1.2.3-65-gdbad