From 6e11d1e65c85c8fab9f37a8d377e3de87ee234da Mon Sep 17 00:00:00 2001 From: Le Philousophe Date: Sat, 9 Jan 2021 23:00:57 +0000 Subject: [PATCH] AMIGAOS4: Fix shim scripts ScummVM now uses some features and must be implemented --- toolchains/amigaos4/packages/amiga-shims/copy | 75 ++++++++++++++++++- .../amigaos4/packages/amiga-shims/delete | 34 ++++++++- .../amigaos4/packages/amiga-shims/makedir | 18 ++++- 3 files changed, 121 insertions(+), 6 deletions(-) diff --git a/toolchains/amigaos4/packages/amiga-shims/copy b/toolchains/amigaos4/packages/amiga-shims/copy index 5523fed..48f5073 100755 --- a/toolchains/amigaos4/packages/amiga-shims/copy +++ b/toolchains/amigaos4/packages/amiga-shims/copy @@ -1,5 +1,76 @@ #! /bin/sh -# TODO: Parse arguments +src= +dst= +quiet= +flags= +while [ $# -gt 0 ]; do + arg=$1 + shift + if [ "$arg" = "FROM" ]; then + if [ -n "$src" ]; then + echo "$0: Two much paths" >&2 + exit 1 + fi + src=$1 + shift + elif [ "$arg" = "TO" ]; then + if [ -n "$dst" ]; then + echo "$0: Two much paths" >&2 + exit 1 + fi + dst=$1 + shift + elif [ "$arg" = "ALL" ]; then + flags="${flags}r" + elif [ "$arg" = "QUIET" ]; then + quiet=1 + elif [ "$arg" = "CLONE" ]; then + flags="${flags}a" + elif [ "$arg" = "DATES" ]; then + echo "$0: Warning $arg not supported" + elif [ "$arg" = "NOPRO" ]; then + echo "$0: Warning $arg not supported" + elif [ "$arg" = "COM" ]; then + echo "$0: Warning $arg not supported" + elif [ "$arg" = "NOREQ" ]; then + flags="${flags}n" + elif [ "$arg" = "NOREPLACE" ]; then + echo "$0: Warning $arg not supported" + elif [ "$arg" = "INTERACTIVE" ]; then + flags="${flags}i" + elif [ "$arg" = "FORCE" ]; then + flags="${flags}f" + elif [ "$arg" = "ARCHIVE" ]; then + echo "$0: Warning $arg not supported" + elif [ "$arg" = "NEWER" ]; then + flags="${flags}u" + elif [ "$arg" = "COPYLINKS" ]; then + flags="${flags}L" + elif [ "$arg" = "FOLLOWLINKS" ]; then + echo "$0: Warning $arg not supported" + else + case "$arg" in + BUFFER*|BUF*) + echo "$0: Warning $arg not supported" + ;; + esac + if [ -z "$src" ]; then + src=$arg + elif [ -z "$dst" ]; then + dst=$arg + else + echo "$0: Two much paths" >&2 + exit 1 + fi + fi +done -exec cp "$@" +if [ -z "$quiet" ]; then + flags="${flags}v" +fi +if [ -n "$flags" ]; then + flags="-$flags" +fi + +exec cp $flags "$src" "$dst" diff --git a/toolchains/amigaos4/packages/amiga-shims/delete b/toolchains/amigaos4/packages/amiga-shims/delete index f705d50..3dca4b1 100755 --- a/toolchains/amigaos4/packages/amiga-shims/delete +++ b/toolchains/amigaos4/packages/amiga-shims/delete @@ -1,5 +1,35 @@ #! /bin/sh -# TODO: Parse arguments +path= +quiet= +flags= +for arg in "$@"; do + if [ "$arg" = "ALL" ]; then + flags="${flags}r" + elif [ "$arg" = "QUIET" ]; then + quiet=1 + elif [ "$arg" = "INTER" ]; then + flags="${flags}i" + elif [ "$arg" = "INTERACTIVE" ]; then + flags="${flags}i" + elif [ "$arg" = "FORCE" ]; then + flags="${flags}f" + elif [ "$arg" = "WIPE" ]; then + echo "$0: Warning $arg not supported" + elif [ -z "$path" ]; then + path=$arg + else + echo "$0: Two paths specified" + exit 1 + fi +done -exec rm "$@" +if [ -z "$quiet" ]; then + flags="${flags}v" +fi +if [ -n "$flags" ]; then + flags="-$flags" +fi + +# AmigaOS can delete empty directories too, we don't +exec rm $flags "$path" diff --git a/toolchains/amigaos4/packages/amiga-shims/makedir b/toolchains/amigaos4/packages/amiga-shims/makedir index 1191170..ba62aff 100755 --- a/toolchains/amigaos4/packages/amiga-shims/makedir +++ b/toolchains/amigaos4/packages/amiga-shims/makedir @@ -1,5 +1,19 @@ #! /bin/sh -# TODO: Parse arguments +path= +flags= +for arg in "$@"; do + if [ "$arg" = "ALL" ]; then + flags=-p + elif [ "$arg" = "FORCE" ]; then + # Not really a force + flags=-p + elif [ -z "$path" ]; then + path=$arg + else + echo "$0: Two paths specified" + exit 1 + fi +done -exec mkdir "$@" +exec mkdir $flags "$path"