add shebang on lib files

This commit is contained in:
Vincent Riquer 2013-04-08 02:52:56 +02:00
parent 9fe99d98dd
commit 1a9758a251
49 changed files with 49 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#!/bin/bash
getConfig() { getConfig() {
while read key value while read key value
do do

View File

@ -1,3 +1,4 @@
#!/bin/bash
getConfigDestination() { getConfigDestination() {
case "$key" in case "$key" in
'path') 'path')

View File

@ -1,3 +1,4 @@
#!/bin/bash
getConfigGeneral() { getConfigGeneral() {
case $key in case $key in
'max-load') 'max-load')

View File

@ -1,3 +1,4 @@
#!/bin/bash
getConfigSource() { getConfigSource() {
case "$key" in case "$key" in
'path') 'path')

View File

@ -1,3 +1,4 @@
#!/bin/bash
printConfig() { printConfig() {
{ {
cat <<-EOF cat <<-EOF

View File

@ -1,3 +1,4 @@
#!/bin/bash
checkCopy() { checkCopy() {
( (
[ -z "${destinationfrequency[$destination]}" ] \ [ -z "${destinationfrequency[$destination]}" ] \

View File

@ -1,3 +1,4 @@
#!/bin/bash
copyFiles_action() { copyFiles_action() {
echo ' echo '
SELECT SELECT

View File

@ -1,3 +1,4 @@
#!/bin/bash
copyFiles_matching() { copyFiles_matching() {
extension="${filename##*.}" extension="${filename##*.}"
cp -al \ cp -al \

View File

@ -1,3 +1,4 @@
#!/bin/bash
Delete() { Delete() {
#Delete table < where_key where_operator where_value #Delete table < where_key where_operator where_value
# [where_key where_operator where_value # [where_key where_operator where_value

View File

@ -1,3 +1,4 @@
#!/bin/bash
Insert() { Insert() {
#Insert table [no_id] < key value #Insert table [no_id] < key value
# [key value # [key value

View File

@ -1,3 +1,4 @@
#!/bin/bash
InsertIfUnset() { InsertIfUnset() {
#InsertIfUnset table [no_id] < key value \n key value #InsertIfUnset table [no_id] < key value \n key value
local \ local \

View File

@ -1,3 +1,4 @@
#!/bin/bash
InsertOrUpdate() { InsertOrUpdate() {
#InsertOrUpdate table set_key set_value [set_key set_value […]] < where_key where_value #InsertOrUpdate table set_key set_value [set_key set_value […]] < where_key where_value
# [where_key where_value # [where_key where_value

View File

@ -1,3 +1,4 @@
#!/bin/bash
Select() { Select() {
#Select table [col1 [col2 [..]]] < WHERE_key WHERE_operator WHERE_value #Select table [col1 [col2 [..]]] < WHERE_key WHERE_operator WHERE_value
# [WHERE_key WHERE_operator WHERE_value # [WHERE_key WHERE_operator WHERE_value

View File

@ -1,3 +1,4 @@
#!/bin/bash
Update() { Update() {
#Update table set_key set_value [set_key set_value […]] < where_key where_operator where_value #Update table set_key set_value [set_key set_value […]] < where_key where_operator where_value
# [where_key where_operator where_value # [where_key where_operator where_value

View File

@ -1,3 +1,4 @@
#!/bin/bash
closeDatabase() { closeDatabase() {
echo .quit >&3 echo .quit >&3
(( debug )) && echo -n "Waiting for SQLite to terminate... " (( debug )) && echo -n "Waiting for SQLite to terminate... "

View File

@ -1,3 +1,4 @@
#!/bin/bash
openDatabase() { openDatabase() {
if [ ! -d "$tempdir" ] if [ ! -d "$tempdir" ]
then then

View File

@ -1,3 +1,4 @@
#!/bin/bash
decodeFile() { decodeFile() {
if ! decodetaskid=$( if ! decodetaskid=$(
Select tasks id <<<"key = $tmpfile" Select tasks id <<<"key = $tmpfile"

View File

@ -1,3 +1,4 @@
#!/bin/bash
decodeMpcdec() { decodeMpcdec() {
tmpfile="${fileid}mpcdec" tmpfile="${fileid}mpcdec"
commandline=(mpcdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav") commandline=(mpcdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")

View File

@ -1,3 +1,4 @@
#!/bin/bash
decodeOpusdec() { decodeOpusdec() {
tmpfile="${fileid}opusdec" tmpfile="${fileid}opusdec"
commandline=(opusdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav") commandline=(opusdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")

View File

@ -1,3 +1,4 @@
#!/bin/bash
decodeSox() { decodeSox() {
commandline=(sox --single-threaded --temp "$tempdir") commandline=(sox --single-threaded --temp "$tempdir")
soxoptions_in='' soxoptions_in=''

View File

@ -1,3 +1,4 @@
#!/bin/bash
createDestinations() { createDestinations() {
for destination in ${!destinationpath[@]} for destination in ${!destinationpath[@]}
do do

View File

@ -1,3 +1,4 @@
#!/bin/bash
updateMimes() { updateMimes() {
Update mime_actions action 1 <<<"action != 1" Update mime_actions action 1 <<<"action != 1"
for destination in ${!destinationskipmime[@]} for destination in ${!destinationskipmime[@]}

View File

@ -1,3 +1,4 @@
#!/bin/bash
encodeFile::mp3() { encodeFile::mp3() {
lameopts=(lame --quiet -v --abr ${destinationquality[$destination]}) lameopts=(lame --quiet -v --abr ${destinationquality[$destination]})
[ -n "$album" ] && lameopts+=(--tl "$album" ) [ -n "$album" ] && lameopts+=(--tl "$album" )

View File

@ -1,3 +1,4 @@
#!/bin/bash
encodeFile::opus() { encodeFile::opus() {
opusencopts=(opusenc --music --quiet) opusencopts=(opusenc --music --quiet)
opusencopts+=(--bitrate ${destinationquality[$destination]}) opusencopts+=(--bitrate ${destinationquality[$destination]})

View File

@ -1,3 +1,4 @@
#!/bin/bash
encodeFile::vorbis() { encodeFile::vorbis() {
oggencopts=(oggenc -Q -q ${destinationquality[$destination]}) oggencopts=(oggenc -Q -q ${destinationquality[$destination]})
[ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist") [ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist")

View File

@ -1,3 +1,4 @@
#!/bin/bash
getDestDir() { getDestDir() {
destdir="${destinationpath[$destination]}/" destdir="${destinationpath[$destination]}/"
if [ -n "${destinationrenamepath[$destination]}" ] if [ -n "${destinationrenamepath[$destination]}" ]

View File

@ -1,3 +1,4 @@
#!/bin/bash
getDestFile() { getDestFile() {
if [ -n "${destinationrename[$destination]}" ] if [ -n "${destinationrename[$destination]}" ]
then then

View File

@ -1,3 +1,4 @@
#!/bin/bash
getFiles() { getFiles() {
scantime=$(date +%s) scantime=$(date +%s)
for prune_expression in "${skippeddirectories[@]}" for prune_expression in "${skippeddirectories[@]}"

View File

@ -1,3 +1,4 @@
#!/bin/bash
removeObsoleteFiles() { removeObsoleteFiles() {
Delete source_files <<-EOWhere Delete source_files <<-EOWhere
last_seen < $scantime last_seen < $scantime

View File

@ -1,3 +1,4 @@
#!/bin/bash
sanitizeFile() { sanitizeFile() {
shopt -s extglob shopt -s extglob
string="$1" string="$1"

View File

@ -1,3 +1,4 @@
#!/bin/bash
getInfosAPE_version='APE-1' getInfosAPE_version='APE-1'
tagreaders+=( "$getInfosAPE_version" ) tagreaders+=( "$getInfosAPE_version" )
getInfos::APE() { getInfos::APE() {

View File

@ -1,3 +1,4 @@
#!/bin/bash
getInfosFLAC_version='FLAC-1' getInfosFLAC_version='FLAC-1'
tagreaders+=( "$getInfosFLAC_version" ) tagreaders+=( "$getInfosFLAC_version" )
getInfos::FLAC() { getInfos::FLAC() {

View File

@ -1,3 +1,4 @@
#!/bin/bash
getInfosMP3_version='ID3-2' getInfosMP3_version='ID3-2'
tagreaders+=( "$getInfosMP3_version" ) tagreaders+=( "$getInfosMP3_version" )
getInfos::MP3() { getInfos::MP3() {

View File

@ -1,3 +1,4 @@
#!/bin/bash
getInfosOgg_version='Ogg-1' getInfosOgg_version='Ogg-1'
tagreaders+=( "$getInfosOgg_version" ) tagreaders+=( "$getInfosOgg_version" )
getInfos::Ogg() { getInfos::Ogg() {

View File

@ -1,3 +1,4 @@
#!/bin/bash
getInfosOpus_version='Opus-1' getInfosOpus_version='Opus-1'
tagreaders+=( "$getInfosOpus_version" ) tagreaders+=( "$getInfosOpus_version" )
getInfos::Opus() { getInfos::Opus() {

View File

@ -1,3 +1,4 @@
#!/bin/bash
getRateChannelMPC() { getRateChannelMPC() {
while read key value garbage while read key value garbage
do do

View File

@ -1,3 +1,4 @@
#!/bin/bash
getRateChannelSoxi() { getRateChannelSoxi() {
rate=$(soxi -r "$sourcepath/$filename" 2>/dev/null) rate=$(soxi -r "$sourcepath/$filename" 2>/dev/null)
channels=$(soxi -c "$sourcepath/$filename" 2>/dev/null) channels=$(soxi -c "$sourcepath/$filename" 2>/dev/null)

View File

@ -1,3 +1,4 @@
#!/bin/bash
getTags_version='unknown-2' getTags_version='unknown-2'
tagreaders+=( "$getTags_version" ) tagreaders+=( "$getTags_version" )
getTags() { getTags() {

View File

@ -1,3 +1,4 @@
#!/bin/bash
gettag() { gettag() {
echo -e "$infos" \ echo -e "$infos" \
| sed -n "/^${1}=/I{s/^${1}=//I;p;q}" | sed -n "/^${1}=/I{s/^${1}=//I;p;q}"

View File

@ -1,3 +1,4 @@
#!/bin/bash
tryAPE() { tryAPE() {
grep -q 'APETAGEX' \ grep -q 'APETAGEX' \
"$sourcepath/$filename" \ "$sourcepath/$filename" \

View File

@ -1,3 +1,4 @@
#!/bin/bash
gettaskinfos() { gettaskinfos() {
echo ' echo '
SELECT SELECT

View File

@ -1,3 +1,4 @@
#!/bin/bash
progressSpin() { progressSpin() {
case $(( ++count % 40 )) in case $(( ++count % 40 )) in
0) echo -ne '\b|' ;; 0) echo -ne '\b|' ;;

View File

@ -1,3 +1,4 @@
#!/bin/bash
checkworkers() { checkworkers() {
for key in ${!workers[@]} for key in ${!workers[@]}
do do

View File

@ -1,3 +1,4 @@
#!/bin/bash
cleaner() { cleaner() {
for key in ${!failedtasks[@]} for key in ${!failedtasks[@]}
do do

View File

@ -1,3 +1,4 @@
#!/bin/bash
createworker() { createworker() {
worker $1 & worker $1 &
workers[$1]=$! workers[$1]=$!

View File

@ -1,3 +1,4 @@
#!/bin/bash
destroyworker() { destroyworker() {
dyingworker=${workers[$1]} dyingworker=${workers[$1]}
unset workers[$1] unset workers[$1]

View File

@ -1,3 +1,4 @@
#!/bin/bash
getworkerid() { getworkerid() {
local i local i
for (( i=0 ; i >= 0 ; i++ )) for (( i=0 ; i >= 0 ; i++ ))

View File

@ -1,3 +1,4 @@
#!/bin/bash
master() { master() {
if (( active >= concurrency)) || [ -n "$quit" ] if (( active >= concurrency)) || [ -n "$quit" ]
then then

View File

@ -1,3 +1,4 @@
#!/bin/bash
worker() { worker() {
exec 2>>"$tempdir/worker$1.log" exec 2>>"$tempdir/worker$1.log"
(( debug >= 2 )) && echo "${cmd_arg[@]}" >&2 (( debug >= 2 )) && echo "${cmd_arg[@]}" >&2