From 25e15f6ac8c9ede31aa248b9f8983b1d438f3084 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 21 Sep 2017 14:08:09 +0200 Subject: tar-inspect: es geht weiter! --- tar-inspect | 70 ++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 15 deletions(-) (limited to 'tar-inspect') diff --git a/tar-inspect b/tar-inspect index 2482a2b58..9f8aabc93 100755 --- a/tar-inspect +++ b/tar-inspect @@ -156,21 +156,24 @@ for fix_type in 'dependencies' 'variables' 'author_release' 'spellchecker' 'xvfb ' | \ sed ' s/::/-/g - s/^/perl-/ ' | \ tr '[:upper:]' '[:lower:]' | \ sort -u ) + checkdepends=$( + . "${TAR_FILENAME%%/*}/PKGBUILD" + printf '%s\n' "${checkdepends[@]}" + ) needed=$( ( for need in ${needed}; do - substituiere "${needed}" - echo "${erg}" + substituiere "${need}" + if [ -n "${erg}" ] && [ "${erg}" != 'perl-%skip' ]; then + echo "${erg}" + fi done | \ sort -u - checkdepends=() - . "${TAR_FILENAME%%/*}/PKGBUILD" - echo "${checkdepends[@]}" | \ + echo "${checkdepends}" | \ sed 'p' ) | \ sort | \ @@ -180,16 +183,53 @@ for fix_type in 'dependencies' 'variables' 'author_release' 'spellchecker' 'xvfb ( set -e cd "${TAR_FILENAME%%/*}" - cat PKGBUILD + if ! grep -q '^checkdepends=(' 'PKGBUILD'; then + for nach in 'makedepends' 'depends'; do + if grep -q "^${nach}"'=(' 'PKGBUILD'; then + break + fi + done + sed -i ' + /^'"${nach}"'=(/{ + :a + N + /)/! ba + a checkdepends=() + } + ' 'PKGBUILD' + fi + pkgrel=$( + sed -n ' + s/^pkgrel=// + T + s/'"'"'//g + p + ' 'PKGBUILD' + ) sed -i ' - /checkdepends=(/ - ' PKGBUILD - echo "${needed}" | sed 's|^|'"${TAR_FILENAME%%/*}"': |' -# echo -# echo "${content}" | \ -# grep -C1 'use ' -# echo - ) + s/^pkgrel=.*/pkgrel='"'"$((pkgrel+1))"'"'/ + /checkdepends=(/{ + i '"$( + printf 'checkdepends=(\\\n' + printf '%s\n' "${checkdepends}" "${needed}" | \ + versionsUniq | \ + sed ' + s|^| '"'"'| + s|$|'"'"'\\| + ' + printf ')\n' + )"' + :a + N + /)/!ba + d + } + ' 'PKGBUILD' + rm -rf --one-file-system 'src' 'pkg' + makepkg -fcrs --asdeps --noconfirm + git add 'PKGBUILD' + ) || \ + git checkout -- "${TAR_FILENAME%%/*}/PKGBUILD" fi ;; 'variables') -- cgit v1.2.3-70-g09d2