repo.or.cz
/
llvm-testsuite.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix file mode.
[llvm-testsuite.git]
/
HashProgramOutput.sh
blob
c5ac2682b320e0ceefb25a2cfa5eeb1a848e3a31
1
#!/bin/sh
2
3
if
[
$#
!=
1
];
then
4
echo
"
$0
<output path>"
5
exit
1
6
fi
7
8
md5cmd
=
$
(
which md5sum
)
9
is_md5sum
=
1
10
if
[ !
-x
"
$md5cmd
"
];
then
11
md5cmd
=
$
(
which
md5
)
12
is_md5sum
=
0
13
if
[ !
-x
"
$md5cmd
"
];
then
14
echo
"error: unable to find either 'md5sum' or 'md5'"
15
exit
1
16
fi
17
fi
18
19
mv
$1 $1
.bak
20
if
[
$is_md5sum
=
"0"
];
then
21
$md5cmd
<
$1
.bak
>
$1
22
else
23
$md5cmd
<
$1
.bak | cut
-d
' '
-f
1
>
$1
24
fi
25
rm
-f
$1
.bak