Quellcode durchsuchen

Use the just-built file executable only if it exists

It seems the file program is used (via some other tools) on mips64 at
configure time. Of course, the just built file program does not exist
yet, leading to a build failure.

So probe for that program first, and silently fall back to the regular
program in /usr/bin/.
Christoph Biedl vor 2 Jahren
Ursprung
Commit
2a9181daa4
1 geänderte Dateien mit 12 neuen und 5 gelöschten Zeilen
  1. 12 5
      debian/run-file/file

+ 12 - 5
debian/run-file/file

@@ -2,9 +2,16 @@
 
 set -e
 
-echo "Just-built file called, args: $@" >&2
+REGULAR_FILE=/usr/bin/file
+BUILT_FILE="$CURDIR/debian/tmp/usr/bin/file"
 
-export LD_LIBRARY_PATH="$CURDIR/debian/tmp/usr/lib/$DEB_HOST_MULTIARCH"
-exec "$CURDIR/debian/tmp/usr/bin/file" \
-    -m "$CURDIR/debian/tmp/usr/share/file/magic.mgc" \
-    "$@"
+if [ -x "$BUILT_FILE" ] ; then
+    echo "Running just-built file, args: $@" >&2
+
+    export LD_LIBRARY_PATH="$CURDIR/debian/tmp/usr/lib/$DEB_HOST_MULTIARCH"
+    exec "$BUILT_FILE" \
+        -m "$CURDIR/debian/tmp/usr/share/file/magic.mgc" \
+        "$@"
+else
+    exec "$REGULAR_FILE" "$@"
+fi