diff --git a/hook-functions b/hook-functions index f673292..3c9a243 100644 --- a/hook-functions +++ b/hook-functions @@ -158,7 +158,8 @@ add_builtin_firmware() # * If the target is not specified, it defaults to the source file # name. # * If the target is specified and exists as a directory under -# $DESTDIR, the basename of the source is appended to it. +# $DESTDIR or ends in a slash, the basename of the source is +# appended to it. # # The target file's containing directories are created if necessary. # @@ -180,7 +181,7 @@ copy_file() { [ -f "${src}" ] || return 2 - if [ -d "${DESTDIR}/${target}" ]; then + if [ -d "${DESTDIR}/${target}" ] || [ "${target%/}" != "$target" ]; then target="${target}/${src##*/}" fi