From: Ulrich Müller Date: Thu, 22 Aug 2013 17:22:27 +0000 (+0200) Subject: Make keepdir an external ebuild helper program. X-Git-Tag: v2.2.2~23 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=77570d9d3df177dc2cb55a83541965a32dd79c67;p=portage.git Make keepdir an external ebuild helper program. This is required by PMS section 11.3.3.8 "Installation commands". Fixes bug #481762. --- diff --git a/bin/ebuild-helpers/keepdir b/bin/ebuild-helpers/keepdir new file mode 100755 index 000000000..bec2feb77 --- /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 18703bb8a..35f4b912a 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 ba12f1fbd..91762bfc3 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 f6952450e..2a3d5eaa0 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 9e8a9daa1..a61ac0503 100644 --- a/doc/package/ebuild/eapi/4-python.docbook +++ b/doc/package/ebuild/eapi/4-python.docbook @@ -19,7 +19,6 @@ docompress exeopts insopts - keepdir libopts use use_enable diff --git a/doc/package/ebuild/eapi/5-progress.docbook b/doc/package/ebuild/eapi/5-progress.docbook index 93ce6dcde..5fd623bc0 100644 --- a/doc/package/ebuild/eapi/5-progress.docbook +++ b/doc/package/ebuild/eapi/5-progress.docbook @@ -61,7 +61,6 @@ docompress exeopts insopts - keepdir libopts use use_enable