Commit 044f1c3f authored by Leo's avatar Leo

gotta go fast

parent 59606971
......@@ -5,7 +5,7 @@
# https://github.com/leahneukirchen/xtools/
#
# Required packages (names are Alpine Linux pkgs):
# busybox - for sed, tr, sort, head and other simple utiltiies
# busybox - for sed, tr, sort and other simple utiltiies
# grep - for grep with -P
export LC_ALL=C
......@@ -78,10 +78,6 @@ scan() {
sed "s/^\([^:]*:[^:]*:\)\(.*\)/\1 $msg/"
}
once() {
head -n 1
}
variables=$(echo -n "#.*
_.*
startdir
......@@ -252,9 +248,7 @@ duplicate_package() {
superfluous_cd_builddir() {
[ "$SKIP_SUPERFLUOUS_CD_BUILDDIR" ] && return 0
sed -n "/^$1() {/,/^}/{p;=}" "$apkbuild" | grep -m 1 -B 1 'cd "$builddir"$' | head -1 | while read -r l; do
if [ -z "$l" ]; then
continue
fi
[ -z "$l" ] && continue
printf "$apkbuild:$l: cd \"\$builddir\" can be removed in phase '$1'\n"
done
}
......@@ -265,57 +259,64 @@ for apkbuild; do
# Try to guess the repo, first see if our working directory is where
# the repo is located
_repo="$(basename "$(dirname "$(dirname $PWD)")")"
_repo="${PWD%/*}"
_repo="${repo%/*}"
_repo="${repo##*/}"
case "$repo" in
main|community|testing|unmaintained) ;;
# Then have the path given to use be used
*) _repo="$(basename "$(dirname "$(dirname $apkbuild)")")" ;;
*)
_repo="${apkbuild%/*}"
_repo="${repo%/*}"
_repo="${repo##*/}"
;;
esac
# Source apkbuild, we need some nice values
srcdir="" . "$apkbuild" 2>/dev/null
default_builddir_value
default_builddir_value &
if [ ! -z "$depends" ]; then
upper_repo_depends
duplicate_depends
upper_repo_depends &
duplicate_depends &
fi
if [ ! -z "$makedepends" ]; then
upper_repo_makedepends
duplicate_makedepends
upper_repo_makedepends &
duplicate_makedepends &
fi
if [ ! -z "$checkdepends" ]; then
if [ ! -z "${options##*!check*}" ]; then
upper_repo_checkdepends
upper_repo_checkdepends &
fi
duplicate_checkdepends
duplicate_checkdepends &
fi
unnecessary_return_1
pkgname_quoted
pkgver_quoted
empty_variable
custom_variable
indent_tabs
trailing_whitespace
backticks_usage
function_keyword
space_before_function_parenthesis
space_after_function_parenthesis
newline_opening_brace
unnecessary_return_1 &
pkgname_quoted &
pkgver_quoted &
empty_variable &
custom_variable &
indent_tabs &
trailing_whitespace &
backticks_usage &
function_keyword &
space_before_function_parenthesis &
space_after_function_parenthesis &
newline_opening_brace &
if [ -z "$SKIP_DUPLICATE_PACKAGE" ]; then
duplicate_package
duplicate_package &
fi
# Don't perform these checks on packages from main
if ! [ -z "${apkbuild##*main/*}" ]; then
for phase in prepare build check package; do
superfluous_cd_builddir "$phase"
superfluous_cd_builddir "$phase" &
done
fi
wait
else
echo no such apkbuild "$apkbuild" 1>&2
fi | sort -t: -n -k2 | grep . && ret=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment