Skip to content
Snippets Groups Projects
Commit 38f5f68c authored by Xavier Claessens's avatar Xavier Claessens Committed by Sjoerd Simons
Browse files

tumbler: inline a common sh file used only from one place

Differential Revision: https://phabricator.apertis.org/D532
parent 59cc4077
No related branches found
No related tags found
No related merge requests found
...@@ -113,20 +113,6 @@ setup_failure() { ...@@ -113,20 +113,6 @@ setup_failure() {
exit 1 exit 1
} }
########################
# Conversion Utilities #
########################
# Converts bash arrays to "as" GVariant arrays
bash_arrays_to_gvariant_as() {
local i converted="['$1'"
shift
for i in "$@"; do
converted+=", '$i'"
done
converted+="]"
echo "${converted}"
}
############# #############
# Utilities # # Utilities #
############# #############
......
# Source me!
# vim: set sts=4 sw=4 et :
_check_uris_have_thumbnail() {
local size=$1
local uris=$2
for i in "${uris[@]}"; do
local thumb="${HOME}/.cache/thumbnails/${size}/$(echo -n "${i}" | md5sum | cut -f1 -d\ ).png"
say $thumb
if [[ ! -f "${thumb}" ]]; then
whine "Couldn't find thumbnail $thumb, file $i didn't get thumbnailed!?"
ret=1
fi
done
}
...@@ -5,7 +5,6 @@ set -e ...@@ -5,7 +5,6 @@ set -e
TESTDIR=$(cd $(dirname $0); pwd; cd - &>/dev/null) TESTDIR=$(cd $(dirname $0); pwd; cd - &>/dev/null)
. "${TESTDIR}/config.sh" . "${TESTDIR}/config.sh"
. "${TESTDIR}/../../common/thumbnailer-utils.sh"
######### #########
# Setup # # Setup #
...@@ -40,6 +39,29 @@ _kill_monitor_return() { ...@@ -40,6 +39,29 @@ _kill_monitor_return() {
return $1 return $1
} }
bash_arrays_to_gvariant_as() {
local i converted="['$1'"
shift
for i in "$@"; do
converted+=", '$i'"
done
converted+="]"
echo "${converted}"
}
_check_uris_have_thumbnail() {
local size=$1
local uris=$2
for i in "${uris[@]}"; do
local thumb="${HOME}/.cache/thumbnails/${size}/$(echo -n "${i}" | md5sum | cut -f1 -d\ ).png"
say $thumb
if [[ ! -f "${thumb}" ]]; then
whine "Couldn't find thumbnail $thumb, file $i didn't get thumbnailed!?"
ret=1
fi
done
}
_generate_thumbnails() { _generate_thumbnails() {
set -x set -x
local i ret size files logfile addr obj_path method uris filetypes local i ret size files logfile addr obj_path method uris filetypes
......
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