Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / power / pm-graph / install_latest_from_github.sh
blobeaa332399d36d6ea49248c59a2bfc4f2f4f7bfa7
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
4 # Script which clones and installs the latest pm-graph
5 # from http://github.com/intel/pm-graph.git
7 OUT=`mktemp -d 2>/dev/null`
8 if [ -z "$OUT" -o ! -e $OUT ]; then
9 echo "ERROR: mktemp failed to create folder"
10 exit
13 cleanup() {
14 if [ -e "$OUT" ]; then
15 cd $OUT
16 rm -rf pm-graph
17 cd /tmp
18 rmdir $OUT
22 git clone http://github.com/intel/pm-graph.git $OUT/pm-graph
23 if [ ! -e "$OUT/pm-graph/sleepgraph.py" ]; then
24 echo "ERROR: pm-graph github repo failed to clone"
25 cleanup
26 exit
29 cd $OUT/pm-graph
30 echo "INSTALLING PM-GRAPH"
31 sudo make install
32 if [ $? -eq 0 ]; then
33 echo "INSTALL SUCCESS"
34 sleepgraph -v
35 else
36 echo "INSTALL FAILED"
38 cleanup