public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/, bin/, doc/package/ebuild/eapi/
@ 2013-08-22 17:32 Zac Medico
  0 siblings, 0 replies; only message in thread
From: Zac Medico @ 2013-08-22 17:32 UTC (permalink / raw
  To: gentoo-commits

commit:     77570d9d3df177dc2cb55a83541965a32dd79c67
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 22 17:22:27 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 17:31:11 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=77570d9d

Make keepdir an external ebuild helper program.

This is required by PMS section 11.3.3.8 "Installation commands".
Fixes bug #481762.

---
 bin/ebuild-helpers/keepdir                 | 20 ++++++++++++++++++++
 bin/ebuild.sh                              |  2 +-
 bin/phase-helpers.sh                       | 24 ------------------------
 bin/save-ebuild-env.sh                     |  2 +-
 doc/package/ebuild/eapi/4-python.docbook   |  1 -
 doc/package/ebuild/eapi/5-progress.docbook |  1 -
 6 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/bin/ebuild-helpers/keepdir b/bin/ebuild-helpers/keepdir
new file mode 100755
index 0000000..bec2feb
--- /dev/null
+++ b/bin/ebuild-helpers/keepdir
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Copyright 1999-2013 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 ! ___eapi_has_prefix_variables; then
+	ED=${D}
+fi
+
+dodir "$@"
+ret=$?
+
+for x in "$@"; do
+	>> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
+		{ echo "!!! ${0##*/}: cannot write .keep in ${ED}${x}" 1>&2; ret=1; }
+done
+
+[[ ${ret} -ne 0 ]] && __helpers_die "${0##*/} failed"
+exit ${ret}

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 18703bb..35f4b91 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -21,7 +21,7 @@ else
 	# in global scope, even though they are completely useless during
 	# the "depend" phase.
 	for x in diropts docompress exeopts get_KV insopts \
-		keepdir KV_major KV_micro KV_minor KV_to_int \
+		KV_major KV_micro KV_minor KV_to_int \
 		libopts register_die_hook register_success_hook \
 		__strip_duplicate_slashes \
 		use_with use_enable ; do

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ba12f1f..91762bf 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -141,30 +141,6 @@ docompress() {
 	fi
 }
 
-# adds ".keep" files so that dirs aren't auto-cleaned
-keepdir() {
-	dodir "$@"
-	local x
-	if ! ___eapi_has_prefix_variables; then
-		local ED=${D}
-	fi
-	if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
-		shift
-		find "$@" -type d -printf "${ED}%p/.keep_${CATEGORY}_${PN}-${SLOT%/*}\n" \
-			| tr "\n" "\0" | \
-			while read -r -d $'\0' ; do
-				>> "$REPLY" || \
-					die "Failed to recursively create .keep files"
-			done
-	else
-		for x in "$@"; do
-			>> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
-				die "Failed to create .keep in ${ED}${x}"
-		done
-	fi
-}
-
-
 useq() {
 	has $EBUILD_PHASE prerm postrm || eqawarn \
 		"QA Notice: The 'useq' function is deprecated (replaced by 'use')"

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index f695245..2a3d5ea 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -56,7 +56,7 @@ __save_ebuild_env() {
 		addread addwrite adddeny addpredict __sb_append_var \
 		use usev useq has_version portageq \
 		best_version use_with use_enable register_die_hook \
-		keepdir unpack __strip_duplicate_slashes econf einstall \
+		unpack __strip_duplicate_slashes econf einstall \
 		__dyn_setup __dyn_unpack __dyn_clean \
 		into insinto exeinto docinto \
 		insopts diropts exeopts libopts docompress \

diff --git a/doc/package/ebuild/eapi/4-python.docbook b/doc/package/ebuild/eapi/4-python.docbook
index 9e8a9da..a61ac05 100644
--- a/doc/package/ebuild/eapi/4-python.docbook
+++ b/doc/package/ebuild/eapi/4-python.docbook
@@ -19,7 +19,6 @@
 					<listitem><para>docompress</para></listitem>
 					<listitem><para>exeopts</para></listitem>
 					<listitem><para>insopts</para></listitem>
-					<listitem><para>keepdir</para></listitem>
 					<listitem><para>libopts</para></listitem>
 					<listitem><para>use</para></listitem>
 					<listitem><para>use_enable</para></listitem>

diff --git a/doc/package/ebuild/eapi/5-progress.docbook b/doc/package/ebuild/eapi/5-progress.docbook
index 93ce6dc..5fd623b 100644
--- a/doc/package/ebuild/eapi/5-progress.docbook
+++ b/doc/package/ebuild/eapi/5-progress.docbook
@@ -61,7 +61,6 @@
 					<listitem><para>docompress</para></listitem>
 					<listitem><para>exeopts</para></listitem>
 					<listitem><para>insopts</para></listitem>
-					<listitem><para>keepdir</para></listitem>
 					<listitem><para>libopts</para></listitem>
 					<listitem><para>use</para></listitem>
 					<listitem><para>use_enable</para></listitem>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-22 17:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 17:32 [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/, bin/, doc/package/ebuild/eapi/ Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox