The PKG_NAME is the installable name of a package while PKG_SOURCE is
the folder containig both `Makefile` and possibliy `test.sh`
This approach previously worked for packages where both NAME and SOURCE
are the same, e.g. `vim`, however fore more complex packages like
`mariadb` (SOURCE) the NAMES are partly
*mariadb-server-plugin-handlersocket*, which is no existing folder.
With this commit the `PKG_SOURCE` is used to find the `test.sh` script.
Signed-off-by: Paul Spooren <mail@aparcar.org>
PKG_NAME=$(sed -ne 's#^Package: \(.*\)$#\1#p' ./control)
# package version without release
PKG_VERSION=$(sed -ne 's#^Version: \(.*\)-[0-9]*$#\1#p' ./control)
+ # package source contianing test.sh script
+ PKG_SOURCE=$(sed -ne 's#^Source: .*/\(.*\)$#\1#p' ./control)
- echo "Testing package $PKG_NAME ($PKG_VERSION)"
+ echo "Testing package $PKG_NAME in version $PKG_VERSION from $PKG_SOURCE"
opkg install "$PKG"
- TEST_SCRIPT=$(find /ci/ -name "$PKG_NAME" -type d)/test.sh
+ TEST_SCRIPT=$(find /ci/ -name "$PKG_SOURCE" -type d)/test.sh
+
if [ -f "$TEST_SCRIPT" ]; then
echo "Use package specific test.sh"
if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then