From 79f31d0476bd3f88616ee7598f4109a7d5d046a5 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Wed, 15 Jan 2014 14:54:46 -0500 Subject: [PATCH] dib-run-parts should dereference symlinks dib-run-parts should dereference symlinks, and if they point to an executable file, execute that file as a script. This can be accomplished by using the xtype predicate in the find command instead of the type predicate. This change is needed so that we can dynamically symlink hook scripts into hook directories such as install.d at runtime to support different install types. Change-Id: I933e7f4b4dcf16956841d8c14aa63b0f9a18fc5d --- elements/dib-run-parts/bin/dib-run-parts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/dib-run-parts/bin/dib-run-parts b/elements/dib-run-parts/bin/dib-run-parts index f3cec1e2..8549c177 100755 --- a/elements/dib-run-parts/bin/dib-run-parts +++ b/elements/dib-run-parts/bin/dib-run-parts @@ -59,7 +59,7 @@ fi # parallelized later # Note: -maxdepth 1 ensures only files in the target directory (but not # subdirectories) are run, which is the way run-parts behaves. -targets=$(find $target_dir -maxdepth 1 -type f -executable -printf '%f\n' | grep -E "$allowed_regex" | LANG=C sort -n) +targets=$(find $target_dir -maxdepth 1 -xtype f -executable -printf '%f\n' | grep -E "$allowed_regex" | LANG=C sort -n) if [ "$show_list" == "1" ] ; then for target in $targets ; do