libtool fix: Don't do fix if there was no -o option to libtool.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 26 Nov 2010 18:26:09 +0000 (18:26 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 26 Nov 2010 18:26:09 +0000 (18:26 +0000)
For example if libtool is being run as 'libtool --mode=execute ...'

This fixes commit 4cf4f2b66f850bb39c5bf29d3cd12ada9114d67e.

libtool-kill-dependency_libs.sh

index 1403fbe..9f17038 100755 (executable)
@@ -49,9 +49,12 @@ done
 # Run libtool as normal.
 #echo "${args[@]}"
 "${args[@]}"
-mv "$output" "$output.tmp"
 
-# Remove dependency_libs from output.
-sed "s/^dependency_libs=.*/dependency_libs=''/" < "$output.tmp" > "$output"
-chmod --reference="$output.tmp" "$output"
-rm "$output.tmp"
+if [ -n "$output" ]; then
+    mv "$output" "$output.tmp"
+
+    # Remove dependency_libs from output.
+    sed "s/^dependency_libs=.*/dependency_libs=''/" < "$output.tmp" > "$output"
+    chmod --reference="$output.tmp" "$output"
+    rm "$output.tmp"
+fi