++ basename /home/pi/hascheevos/bin/hascheevos.sh + readonly 'USAGE= USAGE: hascheevos.sh [OPTIONS] romfile1 [romfile2 ...]' + USAGE=' USAGE: hascheevos.sh [OPTIONS] romfile1 [romfile2 ...]' + readonly GIT_REPO=https://github.com/meleu/hascheevos.git + GIT_REPO=https://github.com/meleu/hascheevos.git + readonly SCRIPT_URL=https://raw.githubusercontent.com/meleu/hascheevos/master/bin/hascheevos.sh + SCRIPT_URL=https://raw.githubusercontent.com/meleu/hascheevos/master/bin/hascheevos.sh +++ dirname /home/pi/hascheevos/bin/hascheevos.sh ++ cd /home/pi/hascheevos/bin ++ pwd + readonly SCRIPT_DIR=/home/pi/hascheevos/bin + SCRIPT_DIR=/home/pi/hascheevos/bin + readonly DATA_DIR=/home/pi/hascheevos/bin/../data + DATA_DIR=/home/pi/hascheevos/bin/../data + readonly 'GAMEID_REGEX=^[1-9][0-9]{0,9}$' + GAMEID_REGEX='^[1-9][0-9]{0,9}$' + readonly 'EXTENSIONS=zip|7z|nes|fds|gb|gba|gbc|sms|bin|smd|gen|md|sg|smc|sfc|fig|swc|mgd|iso|cue|z64|n64|v64|pce|ccd|cue' + EXTENSIONS='zip|7z|nes|fds|gb|gba|gbc|sms|bin|smd|gen|md|sg|smc|sfc|fig|swc|mgd|iso|cue|z64|n64|v64|pce|ccd|cue' + CHECK_FALSE_FLAG=0 + COPY_ROMS_FLAG=0 + CHECK_RA_SERVER_FLAG=0 + RA_USER= + RA_PASSWORD= + RA_TOKEN= + FILES_TO_CHECK=() + COPY_ROMS_DIR= + TMP_DIR=/tmp/hascheevos-1037 + mkdir -p /tmp/hascheevos-1037 ++ mktemp -p /tmp/hascheevos-1037 + GAME_CONSOLE_NAME=/tmp/hascheevos-1037/tmp.PgGRtEGYzh + CONSOLE_NAME=() + CONSOLE_NAME[1]=megadrive + CONSOLE_NAME[2]=n64 + CONSOLE_NAME[3]=snes + CONSOLE_NAME[4]=gb + CONSOLE_NAME[5]=gba + CONSOLE_NAME[6]=gbc + CONSOLE_NAME[7]=nes + CONSOLE_NAME[8]=pcengine + CONSOLE_NAME[9]=segacd + CONSOLE_NAME[10]=sega32x + CONSOLE_NAME[11]=mastersystem + CONSOLE_NAME[12]=xbox360 + CONSOLE_NAME[13]=atari + readonly RP_ROMS_DIR=/home/pi/RetroPie/roms + RP_ROMS_DIR=/home/pi/RetroPie/roms + GAMELIST= + GAMELIST_BAK= + ROMS_DIR=() + SCRAPE_FLAG=0 + COLLECTIONS_FLAG=0 + SINGLE_COLLECTION_FLAG=0 + main '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' + trap safe_exit SIGHUP SIGINT SIGQUIT SIGKILL SIGTERM + check_dependencies + local cmd + local answer + deps=(jq curl unzip 7z) + local deps + for cmd in '"${deps[@]}"' + which jq + for cmd in '"${deps[@]}"' + which curl + for cmd in '"${deps[@]}"' + which unzip + for cmd in '"${deps[@]}"' + which 7z + [[ -z /home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc ]] + update_hashlib + local line + local system= + local file + local i + echo 'Checking JSON hash libraries...' Checking JSON hash libraries... + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/megadrive_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/n64_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/snes_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/gb_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/gba_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/gbc_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/nes_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/pcengine_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/segacd_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/sega32x_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/mastersystem_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/xbox360_hashlibrary.json ]] + for i in '"${!CONSOLE_NAME[@]}"' + [[ -f /home/pi/hascheevos/bin/../data/atari_hashlibrary.json ]] + echo 'Done!' Done! + [[ -n '' ]] + read -r line ++ find /home/pi/hascheevos/bin/../data -type f -name '*_hashlibrary.json' -mtime +1 + parse_args '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' + local i + local ret + local oldIFS + [[ -n /home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc ]] + case "$1" in + break + FILES_TO_CHECK=("$@") + is_retropie + [[ -d /home/pi/RetroPie/roms ]] + mkdir -p /home/pi/.emulationstation/collections + return 0 + [[ -n '' ]] + process_files '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' + local f + readonly local max=10 + max=10 + [[ 0 == 1 ]] + for f in '"$@"' + rom_has_cheevos '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' + local 'rom=/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' + validate_rom_file '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' + local 'rom=/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' + [[ -z /home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc ]] + [[ ! -f /home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc ]] + [[ ! sfc =~ ^(zip|7z|nes|fds|gb|gba|gbc|sms|bin|smd|gen|md|sg|smc|sfc|fig|swc|mgd|iso|cue|z64|n64|v64|pce|ccd|cue)$ ]] + return 0 + echo 'Checking "/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc"...' Checking "/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc"... + local gameid ++ get_game_id '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' ++ local 'rom=/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' ++ local line ++ local hash ++ local hash_i ++ local gameid ++ local console_id=0 ++ echo -n +++ get_rom_hash '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' +++ local 'rom=/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' +++ local hash +++ local uncompressed_rom +++ local ret=0 +++ case "$rom" in +++ [[ 0 -ne 0 ]] +++ [[ -n '' ]] ++++ /home/pi/hascheevos/bin/cheevoshash '/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc' cheevos_eval_md5(): Value too large for defined data type +++ hash= +++ [[ '' =~ : [^ ]{32} ]] +++ return 1 ++ hash= ++ return 1 + gameid= + return 1 + echo -e '"/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc" has no cheevos. :(\n' "/home/pi/RetroPie/roms/snes/Super Mario World (USA).sfc" has no cheevos. :( + safe_exit 0 + rm -rf /tmp/hascheevos-1037 + [[ -f '' ]] + exit 0