[arch-projects] [mkinitcpio] [PATCH] Rely on ldconfig to generate library symlinks
Ignore the intermediate garbage and just let ldconfig do the right thing. Because we now depend on ldconfig, subject it to the standard error handlers. Fixes FS#39560 --- functions | 9 ++++++--- mkinitcpio | 5 ++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/functions b/functions index 2d38815..78ba4c8 100644 --- a/functions +++ b/functions @@ -587,9 +587,12 @@ add_binary() { if [[ ! -L $sodep ]]; then add_file "$sodep" "$sodep" "$(stat -c %a "$sodep")" else - resolved=$(readlink -e "$sodep") - add_symlink "$sodep" "$(readlink "$sodep")" - add_file "$resolved" "$resolved" 755 + if resolved=$(readlink -e "$sodep"); then + add_file "$resolved" + else + error 'Failed to resolve the symlink target of %s' "$sodep" + (( ++builderrors )) + fi fi fi done <<< "$lddout" diff --git a/mkinitcpio b/mkinitcpio index 42abde7..cec9ffb 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -496,14 +496,13 @@ set -o errtrace install_modules "${!_modpaths[@]}" +ldconfig -r "$BUILDROOT" + # unset errtrace and trap set +o functrace set +o errtrace trap -- ERR -# this is simply a nice-to-have -- it doesn't matter if it fails. -ldconfig -r "$BUILDROOT" &>/dev/null - if [[ $_optgenimg ]]; then build_image "$_optgenimg" "$_optcompress" elif [[ $_opttargetdir ]]; then -- 1.9.1
On Sun, Mar 23, 2014 at 11:43:50AM -0400, Dave Reisner wrote:
Ignore the intermediate garbage and just let ldconfig do the right thing. Because we now depend on ldconfig, subject it to the standard error handlers.
Fixes FS#39560 ---
Nevermind. I'm not sure this works in all cases...
functions | 9 ++++++--- mkinitcpio | 5 ++--- 2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/functions b/functions index 2d38815..78ba4c8 100644 --- a/functions +++ b/functions @@ -587,9 +587,12 @@ add_binary() { if [[ ! -L $sodep ]]; then add_file "$sodep" "$sodep" "$(stat -c %a "$sodep")" else - resolved=$(readlink -e "$sodep") - add_symlink "$sodep" "$(readlink "$sodep")" - add_file "$resolved" "$resolved" 755 + if resolved=$(readlink -e "$sodep"); then + add_file "$resolved" + else + error 'Failed to resolve the symlink target of %s' "$sodep" + (( ++builderrors )) + fi fi fi done <<< "$lddout" diff --git a/mkinitcpio b/mkinitcpio index 42abde7..cec9ffb 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -496,14 +496,13 @@ set -o errtrace
install_modules "${!_modpaths[@]}"
+ldconfig -r "$BUILDROOT" + # unset errtrace and trap set +o functrace set +o errtrace trap -- ERR
-# this is simply a nice-to-have -- it doesn't matter if it fails. -ldconfig -r "$BUILDROOT" &>/dev/null - if [[ $_optgenimg ]]; then build_image "$_optgenimg" "$_optcompress" elif [[ $_opttargetdir ]]; then -- 1.9.1
participants (2)
-
Dave Reisner
-
Dave Reisner