Bug 87888 - Bashisms in intel_gpu_abrt script
Summary: Bashisms in intel_gpu_abrt script
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-31 02:20 UTC by Vincent Cheng
Modified: 2017-07-24 22:49 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vincent Cheng 2014-12-31 02:20:39 UTC
intel-gpu-tools ships a #!/bin/sh script that has bash-specific syntax (which breaks on distros such as Debian and Ubuntu where /bin/sh is a symlink to something other than bash). Here's a small patch which fixes this. Thanks for considering!

(Forwarded from 

diff -Nru a/tools/intel_gpu_abrt b/tools/intel_gpu_abrt
--- a/tools/intel_gpu_abrt	2013-02-19 18:05:47.000000000 -0800
+++ b/tools/intel_gpu_abrt	2014-12-30 17:12:56.499574747 -0800
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [[ $UID -ne 0 ]]; then
+if [ $(id -ru) -ne 0 ]; then
     echo "$0 must be run as root"
     exit 1
 fi
Comment 1 Vincent Cheng 2014-12-31 02:21:23 UTC
Err, I mean, forwarded from https://bugs.debian.org/772339
Comment 2 Chris Wilson 2014-12-31 10:43:13 UTC
Thanks,

commit cb512b6470fa848c9b351c2090cd3e3f588cfc5f
Author: Vincent Cheng <vincentc1208@gmail.com>
Date:   Wed Dec 31 10:39:51 2014 +0000

    tools/intel_gpu_abrt: Fix bashism
    
    intel-gpu-tools ships a #!/bin/sh script that has bash-specific syntax
    (which breaks on distros such as Debian and Ubuntu where /bin/sh is a
    symlink to something other than bash).
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87888


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.