summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-09-21 14:08:09 +0200
committerErich Eckner <git@eckner.net>2017-09-21 14:08:09 +0200
commit25e15f6ac8c9ede31aa248b9f8983b1d438f3084 (patch)
treea6b41a5e41f8e9b8f8312af91b9318bd31bd6642
parent81cd0d570a9deea9ad133674fe44396cdb2ea14b (diff)
downloadarchlinuxewe-25e15f6ac8c9ede31aa248b9f8983b1d438f3084.tar.xz
tar-inspect: es geht weiter!
-rwxr-xr-xtar-inspect70
1 files changed, 55 insertions, 15 deletions
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')