diff --git a/functions b/functions index 941312f..2867037 100644 --- a/functions +++ b/functions @@ -707,8 +707,10 @@ run_build_hook() { # check for deprecation if [[ -L $script ]]; then realscript=$(readlink -e "$script") - warning "Hook '%s' is deprecated. Replace it with '%s' in your config" \ - "${script##*/}" "${realscript##*/}" + if [[ "${script##*/}" != "${realscript##*/}" ]]; then + warning "Hook '%s' is deprecated. Replace it with '%s' in your config" \ + "${script##*/}" "${realscript##*/}" + fi script=$realscript fi diff --git a/mkinitcpio b/mkinitcpio index ad96a4f..f1b06df 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -127,8 +127,11 @@ hook_help() { if [[ -L $script ]]; then resolved=$(readlink -e "$script") - msg "This hook is deprecated. See the '%s' hook" "${resolved##*/}" - return 0 + resolved=${resolved##*/} + if [[ "$resolved" != "${script##*/}" ]]; then + msg "This hook is deprecated. See the '%s' hook" "$resolved" + return 0 + fi fi . "$script" @@ -165,13 +168,15 @@ hook_list() { resolved=${resolved##*/} - if ! index_of "$resolved" "${depr[@]}"; then - # deprecated hook - depr+=("$resolved") - _idx=$(( ${#depr[*]} - 1 )) - fi + if [[ "$resolved" != "${hook##*/}" ]]; then + if ! index_of "$resolved" "${depr[@]}"; then + # deprecated hook + depr+=("$resolved") + _idx=$(( ${#depr[*]} - 1 )) + fi - hook+=${ss_ordinals[_idx]} + hook+=${ss_ordinals[_idx]} + fi fi hooklist+=("${hook##*/}")