meson: skip trailing dot if any + more posix compliant

devs/lauromoura/csharp_conventions
Boris Faure 4 years ago
parent feaf0e9299
commit 7cc0e3ea05
  1. 20
      meson/evas_loader_conf.sh

@ -1,15 +1,19 @@
#!/bin/sh
original_loader=$1
filename="$(basename $original_loader)"
ext="${ext##*.}"
original_name="$(basename $original_loader .$ext)"
loader_dir="$(dirname $original_loader)"
loader="$(basename $original_loader)"
loader_name="$(echo $original_name | cut -f 1 -d '.')"
# skip trailing dot if any
case "$1" in
*.) original_loader=${1%?};;
*) original_loader=$1;;
esac
original_name="$(basename "$original_loader")"
loader_dir="$(dirname "$original_loader")"
loader="$(basename "$original_loader")"
loader_name="$(echo "$loader" | cut -f 1 -d '.')"
if test `echo -n ${original_loader} | tail -c 3` = "$ext"; then
mv "$DESTDIR"/"$original_loader" "$DESTDIR"/"$loader_dir"/"$original_name"
original_ext="$(echo "$loader" | tail -c 4)"
if test "$original_ext" = "$ext" ; then
mv "$DESTDIR"/"$original_loader" "$DESTDIR"/"$loader_dir"/"$original_name"
fi
shift

Loading…
Cancel
Save