diff options
author | Erich Eckner <git@eckner.net> | 2018-07-09 14:57:53 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-07-09 15:22:51 +0200 |
commit | d09eb5c46b70494d5c55ddae947258715903cfed (patch) | |
tree | b2077390f0004f5efdea0b495055b4708096afe5 /pythonFunktionen | |
parent | 995cd7b62dc20d5175ef84aa5d1761de0c41f547 (diff) | |
download | archlinuxewe-d09eb5c46b70494d5c55ddae947258715903cfed.tar.xz |
pythonFunktionen: read setup.py instead of requirements.txt
Diffstat (limited to 'pythonFunktionen')
-rwxr-xr-x | pythonFunktionen | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/pythonFunktionen b/pythonFunktionen index e89ef90a8..ceaa2c3e6 100755 --- a/pythonFunktionen +++ b/pythonFunktionen @@ -42,21 +42,34 @@ versteheRequirements() { unset meta - echo "requirements.txt lesen ..." + echo "setup.py lesen ..." meta="$( - tar -Oxzf "${archiv}" $( - tar -tzf "${archiv}" "${_pkgname}-${pkgver}" | \ - grep 'requirements*.txt' - ) | \ - sed ' - /^#/d - /cython/ { - s/^/_makedepends:/ - b - } - s/^/_depends:python-/ - ' | \ + tar -Oxzf "${archiv}" "${_pkgname}-${pkgver}/setup.py" | \ + sed -n "$( + for wasAusgeben in "${!metaRegexe[@]}"; do + printf '/^\\s*%s = \[/{\n' \ + "${metaRegexe["${wasAusgeben}"]}" + printf ' :%s\n' \ + "${wasAusgeben}" + printf ' $! N\n' + printf ' s/^\(\\s*\\S\\+\\s*=\\s*\\[[^]#]*\\)\\(#.*\\)\\?\\n/\\1 /\n' + printf ' t %s\n' \ + "${wasAusgeben}" + printf ' s/\\s//g\n' + printf ' s/^%s=\[//\n' \ + "${metaRegexe["${wasAusgeben}"]}" + printf ' s/\]$//\n' + printf ' s/\\s*%%[^"'"'"']*["'"'"']//g\n' + printf ' s/,/ /g\n' + printf ' s/["'"'"']//g\n' + printf ' s/^/%s:/\n' \ + "${wasAusgeben}" + printf ' P\n' + printf ' D\n' + printf '}\n' + done + )" | \ sort -u )" @@ -66,7 +79,11 @@ versteheRequirements() { sed -n ' s/^'"${wasAusgeben}"':// T + y/ /\n/ p + ' | \ + sed ' + /^cython$/! s/^/python-/ ' ) done @@ -109,7 +126,7 @@ versteheRequirements() { } | \ versionsUniq -u echo "${pkgBuild["${wasAusgeben}"]}" | \ - grep '^\s*cython\($\|[<>=]\)' + grep '^\s*\(cython\|python-setuptools\)\($\|[<>=]\)' } | \ versionsUniq ) @@ -125,7 +142,9 @@ declare -A metaSubst declare -A metaYml declare -A pkgBuild -metaRegexe["_depends"]="requires" +metaRegexe["_depends"]="install_requires" metaSubst["_depends"]=true -metaRegexe["_makedepends"]="\(build\|configure\)_requires" +metaRegexe["_makedepends"]="setup_requires" metaSubst["_makedepends"]=true +metaRegexe["_checkdepends"]="test_requires" +metaSubst["_checkdepends"]=true |