* [gentoo-portage-dev] [PATCHES] EAPI 6 updates
@ 2015-10-16 10:12 Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 1/3] EAPI 6: make in_iuse fatal in global scope Michał Górny
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Michał Górny @ 2015-10-16 10:12 UTC (permalink / raw
To: gentoo-portage-dev
Hi,
A quick batch of EAPI 6 updates following spec changes. Note that I
won't apply them until the current level of discussions is finished.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-portage-dev] [PATCH 1/3] EAPI 6: make in_iuse fatal in global scope
2015-10-16 10:12 [gentoo-portage-dev] [PATCHES] EAPI 6 updates Michał Górny
@ 2015-10-16 10:12 ` Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 2/3] eapply: Update parameter splitting to match the spec Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 3/3] eapply: Update default patch arguments Michał Górny
2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2015-10-16 10:12 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Michał Górny
Reference: https://archives.gentoo.org/gentoo-pms/message/4a6bb2839e47407fa71cecb19a054375
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
bin/ebuild.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 75a9d24..cc6a22f 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -32,6 +32,7 @@ else
# `use multislot` is false for the "depend" phase.
funcs="use useq usev"
___eapi_has_usex && funcs+=" usex"
+ ___eapi_has_in_iuse && funcs+=" in_iuse"
for x in ${funcs} ; do
eval "${x}() {
if ___eapi_disallows_helpers_in_global_scope; then
--
2.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-portage-dev] [PATCH 2/3] eapply: Update parameter splitting to match the spec
2015-10-16 10:12 [gentoo-portage-dev] [PATCHES] EAPI 6 updates Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 1/3] EAPI 6: make in_iuse fatal in global scope Michał Górny
@ 2015-10-16 10:12 ` Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 3/3] eapply: Update default patch arguments Michał Górny
2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2015-10-16 10:12 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Michał Górny
---
bin/phase-helpers.sh | 44 ++++++++++++++++++++++++++++++++++----------
1 file changed, 34 insertions(+), 10 deletions(-)
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 0c25ffe..5be71fa 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -997,18 +997,42 @@ if ___eapi_has_eapply; then
fi
}
- local f patch_options=() failed started_applying options_terminated
- for f; do
- if [[ ${f} == -* && -z ${options_terminated} ]]; then
- if [[ -n ${started_applying} ]]; then
- die "eapply: options need to be specified before files"
+ local patch_options=() files=()
+ local i found_doublehyphen
+ # first, try to split on --
+ for (( i = 1; i <= ${#@}; ++i )); do
+ if [[ ${@:i:1} == -- ]]; then
+ patch_options=( "${@:1:i-1}" )
+ files=( "${@:i+1}" )
+ found_doublehyphen=1
+ break
+ fi
+ done
+
+ # then, try to split on first non-option
+ if [[ -z ${found_doublehyphen} ]]; then
+ for (( i = 1; i <= ${#@}; ++i )); do
+ if [[ ${@:i:1} != -* ]]; then
+ patch_options=( "${@:1:i-1}" )
+ files=( "${@:i+1}" )
+ break
fi
- if [[ ${f} == -- ]]; then
- options_terminated=1
- else
- patch_options+=( ${f} )
+ done
+
+ # ensure that no options were interspersed with files
+ for i in "${files[@]}"; then
+ if [[ ${i} == -* ]]; then
+ die "eapply: all options must be passed before non-options"
fi
- elif [[ -d ${f} ]]; then
+ fi
+ fi
+
+ if [[ -z ${files[@]} ]]; then
+ die "eapply: no files specified"
+ fi
+
+ for i in "${files[@]}"; do
+ if [[ -d ${f} ]]; then
_eapply_get_files() {
local LC_ALL=POSIX
local prev_shopt=$(shopt -p nullglob)
--
2.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-portage-dev] [PATCH 3/3] eapply: Update default patch arguments
2015-10-16 10:12 [gentoo-portage-dev] [PATCHES] EAPI 6 updates Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 1/3] EAPI 6: make in_iuse fatal in global scope Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 2/3] eapply: Update parameter splitting to match the spec Michał Górny
@ 2015-10-16 10:12 ` Michał Górny
2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2015-10-16 10:12 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Michał Górny
---
bin/phase-helpers.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5be71fa..2fea0b2 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -990,7 +990,10 @@ if ___eapi_has_eapply; then
# -p1 as a sane default
# -f to avoid interactivity
# -s to silence progress output
- patch -p1 -f -s "${patch_options[@]}" < "${f}"
+ # -g0 to guarantee no VCS interaction
+ # --no-backup-if-mismatch not to pollute the sources
+ patch -p1 -f -s -g0 --no-backup-if-mismatch \
+ "${patch_options[@]}" < "${f}"
if ! eend ${?}; then
__helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"
failed=1
--
2.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-16 10:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 10:12 [gentoo-portage-dev] [PATCHES] EAPI 6 updates Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 1/3] EAPI 6: make in_iuse fatal in global scope Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 2/3] eapply: Update parameter splitting to match the spec Michał Górny
2015-10-16 10:12 ` [gentoo-portage-dev] [PATCH 3/3] eapply: Update default patch arguments Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox