From f31312257094b3336c38cc8bdce1ded9188d37c3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 15 Oct 2018 21:02:50 -0400 Subject: [PATCH 1/6] populate-initrd: drop unused local variable the inst_library function declares a variable `_lib` that's completely unused. This commit removes the declaration. --- scripts/plymouth-populate-initrd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in index e3326e9..5f3bb85 100755 --- a/scripts/plymouth-populate-initrd.in +++ b/scripts/plymouth-populate-initrd.in @@ -141,61 +141,61 @@ inst_simple() { # find symlinks linked to given library file # $1 = library file # Function searches for symlinks by stripping version numbers appended to # library filename, checks if it points to the same target and finally # prints the list of symlinks to stdout. # # Example: # rev_lib_symlinks libfoo.so.8.1 # output: libfoo.so.8 libfoo.so # (Only if libfoo.so.8 and libfoo.so exists on host system.) rev_lib_symlinks() { [[ ! $1 ]] && return 0 local fn="$1" orig="$(readlink -f "$1")" links='' [[ ${fn} =~ .*\.so\..* ]] || return 1 until [[ ${fn##*.} == so ]]; do fn="${fn%.*}" [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" done echo "${links}" } # Same as above, but specialized to handle dynamic libraries. # It handles making symlinks according to how the original library # is referenced. inst_library() { - local _src="$1" _dest=${2:-$1} _lib _reallib _symlink + local _src="$1" _dest=${2:-$1} _reallib _symlink strstr "$1" "/" || return 1 [[ -e $initdir/$_dest ]] && return 0 if [[ -L $_src ]]; then # install checksum files also if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then inst "${_src%/*}/.${_src##*/}.hmac" "${_dest%/*}/.${_dest##*/}.hmac" fi _reallib=$(readlink -f "$_src") inst_simple "$_reallib" "$_reallib" inst_dir "${_dest%/*}" [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} ln -sfn $(convert_abs_rel "${_dest}" "${_reallib}") "${initdir}/${_dest}" else inst_simple "$_src" "$_dest" fi # Create additional symlinks. See rev_symlinks description. for _symlink in $(rev_lib_symlinks $_src) $(rev_lib_symlinks $_reallib); do [[ ! -e $initdir/$_symlink ]] && { ddebug "Creating extra symlink: $_symlink" inst_symlink $_symlink } done } # find a binary. If we were not passed the full path directly, # search in the usual places to find the binary. find_binary() { if [[ -z ${1##/*} ]]; then if [[ -x $1 ]] || { strstr "$1" ".so" && ldd $1 &>/dev/null; }; then -- 2.17.1