Use -p0 for all patches to keep things simple (sstephenson/ruby-build#484)

There is filterdiff(1) available to transform strip level of a patch if
optional level is required.

```
git diff HEAD^ | filterdiff --strip=1 | pyenv install -p 3.3.3
```
This commit is contained in:
Yamashita Yuu 2014-01-01 12:21:29 +09:00
parent 4953fa4034
commit 8892f3735d

View file

@ -1062,19 +1062,9 @@ isolated_gem_install() {
}
apply_python_patch() {
local package_name="$1"
# Support PYTHON_PATCH_OPTS, etc.
local package_var_name="$(capitalize "${package_name%%-*}")"
local PACKAGE_PATCH_OPTS="${package_var_name}_PATCH_OPTS"
if [ -z "${PATCH_OPTS+defined}" ] && [ -z "${!PACKAGE_PATCH_OPTS+defined}" ]; then
local PATCH_OPTS="-p0"
fi
case "$1" in
Python-* | jython-* | pypy-* )
${PATCH:-patch} $PATCH_OPTS ${!PACKAGE_PATCH_OPTS} -i "${2:--}"
patch -p0 -i "${2:--}"
;;
esac
}