Skip to content
Snippets Groups Projects
Commit 550024b8 authored by Frédéric Dalleau's avatar Frédéric Dalleau
Browse files

Add support for file globbing


Canterbury tests requires a high amount of files.
Add the possibility to glob for files to shorten the
size of external-dependencies.txt.

Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
parent 82388ccf
No related branches found
No related tags found
1 merge request!14Add support for file globbing
......@@ -83,7 +83,7 @@ download_extract_packages () {
# skip lines starting with "#"
[[ "$line" =~ ^#.*$ ]] && continue
IFS=" " read -r PACKAGE FILE AVAILABLE_OPTIONS <<< $line
IFS=" " read -r PACKAGE GLOB AVAILABLE_OPTIONS <<< $line
get_package ${PACKAGE}
dpkg --extract ${PACKAGE}_*_${ARCH}.deb ${EXTRACT}
......@@ -111,7 +111,7 @@ update_test_repository () {
# skip lines starting with "#"
[[ "$line" =~ ^#.*$ ]] && continue
IFS=" " read -r PACKAGE FILE AVAILABLE_OPTIONS <<< $line
IFS=" " read -r PACKAGE GLOB AVAILABLE_OPTIONS <<< $line
local PREFIX=$(echo "$AVAILABLE_OPTIONS" | sed -n 's/.*prefix=\([^,]*\).*/\1/p')
AVAILABLE_OPTIONS=${AVAILABLE_OPTIONS/prefix=$PREFIX/}
......@@ -122,29 +122,30 @@ update_test_repository () {
if [ ! -z "$AVAILABLE_OPTIONS" ]; then
AVAILABLE_OPTIONS=${AVAILABLE_OPTIONS//,/ } # {var//x/y} replaces all occurences of x in var
if ! [[ $AVAILABLE_OPTIONS =~ (^|[[:space:]])$ARCH($|[[:space:]]) ]]; then
echo "skipping ${FILE} for ${ARCH}"
echo "skipping ${GLOB} for ${ARCH}"
continue
fi
fi
local GIT="git -C ${TEST}"
local DIR="bin"
[ -n "$PREFIX" ] && DIR=$PREFIX
local TARGET="${ARCH}/${DIR}"
mkdir -p "${TEST}/${TARGET}"
for FILE in ${EXTRACT}/${GLOB}; do
local DIR="bin"
[ -n "$PREFIX" ] && DIR=$PREFIX
local TARGET="${ARCH}/${DIR}"
mkdir -p "${TEST}/${TARGET}"
if [ -n "$FILENAME" ]; then
TARGET="${TARGET}/${FILENAME}"
else
TARGET="${TARGET}/$(basename ${FILE})"
fi
if [ -n "$FILENAME" ]; then
TARGET="${TARGET}/${FILENAME}"
else
TARGET="${TARGET}/$(basename ${FILE})"
fi
cp ${EXTRACT}/${FILE} ${TEST}/${TARGET}
cp ${FILE} ${TEST}/${TARGET}
${GIT} add "${TARGET}"
git -C ${TEST} add "${TARGET}"
# Prepare the commit message (with a new line)
echo $(ls ${PACKAGE}_*_${ARCH}.deb)" ${TARGET}" >> ${TEST}-commit-msg.txt
# Prepare the commit message (with a new line)
echo $(ls ${PACKAGE}_*_${ARCH}.deb)" ${TARGET}" >> ${TEST}-commit-msg.txt
done
done < "${TEST}/external-binaries.cfg"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment