From afcf4f0c7c162bbfdf0bf26dac85ce23dddd6df4 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Sat, 29 Nov 2014 09:11:36 +0900 Subject: [PATCH] Move `require_distro` out from PyPy build definitions --- plugins/python-build/bin/python-build | 15 +++++++++++++++ plugins/python-build/share/python-build/pypy-2.0 | 12 ------------ .../python-build/share/python-build/pypy-2.0.1 | 12 ------------ .../python-build/share/python-build/pypy-2.0.2 | 12 ------------ plugins/python-build/share/python-build/pypy-2.1 | 12 ------------ plugins/python-build/share/python-build/pypy-2.2 | 12 ------------ .../python-build/share/python-build/pypy-2.2.1 | 12 ------------ plugins/python-build/share/python-build/pypy-2.3 | 12 ------------ .../python-build/share/python-build/pypy-2.3.1 | 12 ------------ .../share/python-build/pypy-2.4-beta1 | 12 ------------ .../python-build/share/python-build/pypy-2.4.0 | 12 ------------ .../python-build/share/python-build/pypy3-2.3.1 | 12 ------------ 12 files changed, 15 insertions(+), 132 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index e48261b3..e6b94f94 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1096,6 +1096,21 @@ require_java() { export JAVA="$java" } +require_distro() { + for arg; do + if [[ "$(cat /etc/issue 2>/dev/null || true)" == "$1"* ]]; then + return 0 + fi + done + { echo + colorize 1 "WARNING" + echo ": This binary distribution is built for $1." + echo "installed binary may not run expectedly on other platforms." + echo + } >&2 + return 1 +} + needs_yaml() { [[ "$RUBY_CONFIGURE_OPTS" != *--with-libyaml-dir=* ]] && ! use_homebrew_yaml diff --git a/plugins/python-build/share/python-build/pypy-2.0 b/plugins/python-build/share/python-build/pypy-2.0 index 43d4b9b2..acbff258 100644 --- a/plugins/python-build/share/python-build/pypy-2.0 +++ b/plugins/python-build/share/python-build/pypy-2.0 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.0.1 b/plugins/python-build/share/python-build/pypy-2.0.1 index 6bd542f4..d4285d40 100644 --- a/plugins/python-build/share/python-build/pypy-2.0.1 +++ b/plugins/python-build/share/python-build/pypy-2.0.1 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.0.2 b/plugins/python-build/share/python-build/pypy-2.0.2 index 0f205800..59089582 100644 --- a/plugins/python-build/share/python-build/pypy-2.0.2 +++ b/plugins/python-build/share/python-build/pypy-2.0.2 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.1 b/plugins/python-build/share/python-build/pypy-2.1 index f1d1be22..fdaa6fe8 100644 --- a/plugins/python-build/share/python-build/pypy-2.1 +++ b/plugins/python-build/share/python-build/pypy-2.1 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.2 b/plugins/python-build/share/python-build/pypy-2.2 index 246876fe..2c68efad 100644 --- a/plugins/python-build/share/python-build/pypy-2.2 +++ b/plugins/python-build/share/python-build/pypy-2.2 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.2.1 b/plugins/python-build/share/python-build/pypy-2.2.1 index 71464797..8880aaf7 100644 --- a/plugins/python-build/share/python-build/pypy-2.2.1 +++ b/plugins/python-build/share/python-build/pypy-2.2.1 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.3 b/plugins/python-build/share/python-build/pypy-2.3 index 612079cb..a4487487 100644 --- a/plugins/python-build/share/python-build/pypy-2.3 +++ b/plugins/python-build/share/python-build/pypy-2.3 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.3.1 b/plugins/python-build/share/python-build/pypy-2.3.1 index b65af5aa..e48089b2 100644 --- a/plugins/python-build/share/python-build/pypy-2.3.1 +++ b/plugins/python-build/share/python-build/pypy-2.3.1 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.4-beta1 b/plugins/python-build/share/python-build/pypy-2.4-beta1 index fb35ea39..f7352bcd 100644 --- a/plugins/python-build/share/python-build/pypy-2.4-beta1 +++ b/plugins/python-build/share/python-build/pypy-2.4-beta1 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy-2.4.0 b/plugins/python-build/share/python-build/pypy-2.4.0 index 1098223b..9c600101 100644 --- a/plugins/python-build/share/python-build/pypy-2.4.0 +++ b/plugins/python-build/share/python-build/pypy-2.4.0 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true diff --git a/plugins/python-build/share/python-build/pypy3-2.3.1 b/plugins/python-build/share/python-build/pypy3-2.3.1 index 7ef5244b..273530a3 100644 --- a/plugins/python-build/share/python-build/pypy3-2.3.1 +++ b/plugins/python-build/share/python-build/pypy3-2.3.1 @@ -1,15 +1,3 @@ -require_distro() { - if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then - { echo - colorize 1 "WARNING" - echo ": The binary distribution of PyPy is built for $1." - echo "installed binary may not run expectedly on other platforms." - echo - } >&2 - return 1 - fi -} - case "$(pypy_architecture 2>/dev/null || true)" in "linux" ) require_distro "Ubuntu 10.04" || true