Commit 4184c42b authored by A. Wilcox's avatar A. Wilcox

Merge branch 'bashisms' into 'master'

POSIX me harder

See merge request !3
parents efc67921 0a84eaef
......@@ -17,7 +17,7 @@ fi
do_sign() {
local f i keyname repo
local openssl=$(command -v openssl || echo libressl)
local openssl="$(command -v openssl || echo libressl)"
# we are actually only interested in the name, not the file itself
keyname=${pubkey##*/}
......
This diff is collapsed.
......@@ -49,8 +49,13 @@ do_bump() {
name=${name#*/}
[ "$pkgname" = "$name" ] \
|| die "APKBUILD has different \$pkgname for $name"
type package | grep -q function \
|| die "missing package() for $name"
(
unset -f package || true
unalias package || true
. "$a"
PATH= type package >/dev/null 2>&1
) || die "missing package() for $name"
cd "${a%/*}"
section=${PWD%/*}
......
......@@ -130,7 +130,8 @@ fi
args=$(for a; do p=$(any_buildscript "$a") || die "can't find APKBUILD for $a"; echo "$p"; done)
[ $? -eq 0 ] || exit 1
oldifs=$IFS
IFS=$'\n'
IFS="
"
set -- $args
IFS=$oldifs
......
......@@ -81,7 +81,7 @@ do_logging()
# Log the command output
eval $cmd
echo
} >&$fd
} > $fd 2>&1
i=$(($i + 1))
done
fi
......
......@@ -49,7 +49,7 @@ die() {
}
runpart() {
local part=$1
local part="$1"
msg "Running part $part"
$part || die "$part failed"
}
......
......@@ -154,7 +154,7 @@ __EOF__
# Create new aport from templates
newaport() {
local newname="${1##*/}"
local pn=${newname%-[0-9]*}
local pn="${newname%-[0-9]*}"
local pv
local source=
is_url "$1" && source="$1"
......
......@@ -141,16 +141,17 @@ newapkbuild_simple_test() {
shift
pattern=$1
shift
pushd "tests/newapkbuild" 1>/dev/null
cd "tests/newapkbuild"
[ -d $name ] && rm -r $name
newapkbuild -n $name $@
if [ $? -ne 0 ]; then
fail $name
cd "$OLDPWD"
return
fi
grep $pattern $name/APKBUILD 1>/dev/null
expect_success $name
popd 1>/dev/null
cd "$OLDPWD"
}
......@@ -163,10 +164,10 @@ newapkbuild_simple_test simplever 'pkgver=1.0' simplever-1.0
# $1 - test name (test-autoconf-pkg, etc)
# $2 - the invocation expected ("./configure", "cmake", etc)
newapkbuild_pkg_test() {
pushd "tests/newapkbuild" 1>/dev/null
cd "tests/newapkbuild"
[ -d $1 ] && rm -r $1
newapkbuild "https://distfiles.adelielinux.org/source/newapkbuild-tests/$1-1.0.tar.xz" 1>/dev/null 2>/dev/null
popd 1>/dev/null
cd "$OLDPWD"
if [ $? -ne 0 ]; then
fail "$1: newapkbuild failed"
else
......
......@@ -13,7 +13,7 @@ subpackages=""
source=""
check() {
[ $UID -ne 0 ] || return 1
[ "$(id -u)" -ne 0 ] || return 1
}
package() {
......
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