Remove convert_0.3-0.4.sh.
authorAndre Noll <maan@systemlinux.org>
Sun, 29 Dec 2013 01:41:07 +0000 (01:41 +0000)
committerAndre Noll <maan@systemlinux.org>
Sat, 22 Feb 2014 15:49:29 +0000 (16:49 +0100)
The database layout hasn't changed since 0.4.0, and nobody should
run paraslash-3.x.x anymore.

convert_0.3-0.4.sh [deleted file]

diff --git a/convert_0.3-0.4.sh b/convert_0.3-0.4.sh
deleted file mode 100755 (executable)
index aa0b239..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-#!/usr/bin/env bash
-
-#-------------------------------------------------------------------------------
-## Script to convert the database of paraslash 0.3.5 to version 0.4.x.
-##
-## Assumptions:
-##     - para_server 0.3.5 is running
-##     - "para_client check" reports no errors
-##     - para_server 0.4.x is running, listens on another port and uses a
-##       different afs database and a different afs socket
-##     - The database of paraslash 0.4.x has been initialized (i.e.
-##       para_client init has successfully been executed)
-##     - All audio files in the 0.3.x database have already been added to
-##       the 0.4.x database (execute para_client add /my/audio/file/dir to
-##       do that)
-##
-#-------------------------------------------------------------------------------
-
-# Call this script without arguments to see usage info
-
-# How to connect to para_server 0.3.x.
-client03=/usr/local/bin/para_client
-port03=2991
-host03=localhost
-database03=$HOME/.paraslash/afs_database
-
-# How to connect to para_server 0.4.x.
-client04=$(pwd)/para_client
-port04=2990
-host04=localhost
-database04=$HOME/.paraslash/afs_database-0.4
-
-# Any character that does not occur in any filename of an audio file
-sep='|'
-
-
-client03_cmd="$client03 -p $port03 -i $host03"
-client04_cmd="$client04 -p $port04 -i $host04"
-
-exec_client03_cmd()
-{
-       result="$($client03_cmd -- "$@")"
-}
-
-exec_client04_cmd()
-{
-       result="$($client04_cmd -- "$@")"
-}
-
-convert_attribute_table()
-{
-       local atts
-
-       echo "converting attribute table"
-       exec_client03_cmd lsatt
-       atts="$result"
-       exec_client04_cmd addatt $atts
-}
-
-convert_attributes()
-{
-       local OIFS="$IFS" a p att atts
-
-       printf "converting attributes: "
-       $client03_cmd -- ls -p -lv \
-               | grep '^path:\|^attributes_txt:' \
-               | sed -e "/^path:/N;s/\n/$sep/1" \
-               | {
-                       IFS="$sep"
-                       while read p a; do
-                               p=${p#path: }
-                               a=${a#attributes_txt:}
-                               IFS=" "
-                               atts=
-                               for att in $a; do
-                                       atts="$atts $att+"
-                               done
-                               IFS="$OIFS"
-                               [[ -n "$atts" ]] && $client04_cmd -- setatt $atts "$p"
-                               IFS="$sep"
-                               printf "."
-                       done
-                       echo done
-               }
-               IFS="$OIFS"
-}
-
-convert_lna()
-{
-       local OIFS="$IFS" p l n a
-
-       printf "converting last_played, num_played, amplification values: "
-       $client03_cmd -- ls -p -d -lv \
-               | grep '^path:\|^last_played: \|^num_played: \|^amplification: ' \
-               | sed -e "/^path:/N;N;N;s/\n/$sep/g" \
-               | {
-                       IFS="$sep"
-                       while read p l n a; do
-                               #echo "p: $p, l:$l, n:$n a:$a"
-                               p=${p#path: }
-                               l=${l#last_played: }
-                               n=${n#num_played: }
-                               a=${a#amplification: }
-                               IFS="$OIFS"
-                               $client04_cmd -- touch "-l$l" "-n$n" "-a$a" "$p"
-                               IFS="$sep"
-                               printf "."
-                       done
-                       echo done
-               }
-               IFS="$OIFS"
-}
-
-convert_blobs()
-{
-       local blob name
-
-       for blob in img lyr mood pl; do
-               printf "converting $blob table: "
-               exec_client03_cmd ls$blob
-               echo "$result" | while read name; do
-                       $client03_cmd -- cat$blob "$name" | $client04_cmd -- add$blob "$name"
-                       printf "."
-               done
-               echo done
-       done
-}
-
-convert_ids()
-{
-       local OIFS="$IFS" p i y iopts yopts
-
-       printf "converting image and lyrics ids: "
-       $client03_cmd -- ls -p -lv \
-               | grep '^path:\|^image_name: \|^lyrics_name: ' \
-               | sed -e "/^path:/N;N;s/\n/$sep/g" \
-               | {
-                       IFS="$sep"
-                       while read p i l; do
-                               IFS="$OIFS"
-                               iopts=
-                               yopts=
-                               p=${p#path: }
-                               i=${i#image_name: }
-                               l=${l#lyrics_name: }
-                               if [[ "$i" != '(none)' ]]; then
-                                       exec_client04_cmd lsimg -l "$i"
-                                       iopts="-i${result%%     *}"
-                               fi
-                               if [[ "$l" != '(none)' ]]; then
-                                       exec_client04_cmd lslyr -l "$l"
-                                       yopts="-y${result%%     *}"
-                               fi
-                               if [[ -n "$iopts" && -n "$yopts" ]]; then
-                                       $client04_cmd -- touch "$iopts" "$yopts" "$p"
-                               elif [[ -n "$iopts" ]]; then
-                                       $client04_cmd -- touch "$iopts" "$p"
-                               elif [[ -n "$yopts" ]]; then
-                                       $client04_cmd -- touch "$yopts" "$p"
-                               fi
-                               printf "."
-                               IFS="$sep"
-                       done
-                       echo done
-               }
-               IFS="$OIFS"
-}
-
-
-usage()
-{
-       grep '^##' $0 | sed -e 's/^## *//'
-       echo '
-Usage: $0 command
-
-command is one of the following:
-
-       attribute_table: create attributes
-       attributes: convert attributes for each audio file
-       lna: convert the last_played/num_played/amplification values
-       blobs: convert the image/lyrics/moods/playlists tables
-       ids: convert image and the lyrics id of each audio file.
-       all: Do all of the above.
-
-Edit the top of the script to customize some options.
-'
-}
-
-if test $# -ne 1; then
-       usage
-       exit 1
-fi
-
-case "$1" in
-attribute_table)
-       convert_attribute_table
-       ;;
-attributes)
-       convert_attributes
-       ;;
-lna)
-       convert_lna
-       ;;
-blobs)
-       convert_blobs
-       ;;
-ids)
-       convert_ids
-       ;;
-all)
-       convert_attribute_table
-       convert_attributes
-       convert_lna
-       convert_blobs
-       convert_ids
-       ;;
-*)
-       usage
-       exit 1
-       ;;
-esac