From 51409977a26d9ce57df066207d7840ca8c976db4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 26 Mar 2012 19:09:30 -0400 Subject: [PATCH] dev_image_util: make `file` work by default File is compiled with a path to the default magic database, but since we install it into /usr/local rather than the normal /usr, that default path does not work. Add a smaller wrapper script around `file` to specify the new database location so people don't have to manually do so. BUG=chromium-os:27725 TEST=`./build_image --board=x86-alex dev` produced an image where `file /bin/bash` worked Change-Id: I3862cb368437a14bf1e4b6ccf4e2df3e4f774817 Reviewed-on: https://gerrit.chromium.org/gerrit/19137 Tested-by: Mike Frysinger Reviewed-by: Chris Sosa Reviewed-by: Richard Barnette Commit-Ready: Mike Frysinger --- build_library/dev_image_util.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build_library/dev_image_util.sh b/build_library/dev_image_util.sh index 5fcf087f22..01ca1735d7 100755 --- a/build_library/dev_image_util.sh +++ b/build_library/dev_image_util.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. +# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -73,6 +73,18 @@ install_dev_packages() { ${ROOT_FS_DIR}/usr/local/lib/python2.6/site-packages/pygtk.pth" fi + # File searches /usr/share by default, so add a wrapper script so it + # can find the right path in /usr/local. + local path="${ROOT_FS_DIR}/usr/local/bin/file" + if [[ -x ${path} ]]; then + sudo mv "${path}" "${path}.bin" + sudo_clobber "${path}" <