summaryrefslogtreecommitdiffstats
path: root/debian/run-file
diff options
context:
space:
mode:
Diffstat (limited to 'debian/run-file')
-rwxr-xr-xdebian/run-file/file17
1 files changed, 17 insertions, 0 deletions
diff --git a/debian/run-file/file b/debian/run-file/file
new file mode 100755
index 0000000..926aec5
--- /dev/null
+++ b/debian/run-file/file
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+REGULAR_FILE=/usr/bin/file
+BUILT_FILE="$CURDIR/debian/tmp/usr/bin/file"
+
+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