annotate libgo/godeps.sh @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 #!/bin/sh
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 # Copyright 2011 The Go Authors. All rights reserved.
kono
parents:
diff changeset
4 # Use of this source code is governed by a BSD-style
kono
parents:
diff changeset
5 # license that can be found in the LICENSE file.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 # The godeps.sh script outputs a dependency file for a package. The
kono
parents:
diff changeset
8 # dependency file is then included in the libgo Makefile. This is
kono
parents:
diff changeset
9 # automatic dependency generation, Go style.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 # The first parameter is the name of the file being generated. The
kono
parents:
diff changeset
12 # remaining parameters are the names of Go files which are scanned for
kono
parents:
diff changeset
13 # imports.
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 set -e
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 if test $# = 0; then
kono
parents:
diff changeset
18 echo 1>&2 "Usage: godeps.sh OUTPUT INPUTS..."
kono
parents:
diff changeset
19 exit 1
kono
parents:
diff changeset
20 fi
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 output=$1
kono
parents:
diff changeset
23 shift
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 files=$*
kono
parents:
diff changeset
26 deps=`for f in $files; do cat $f; done |
kono
parents:
diff changeset
27 sed -n -e '/^import.*"/p; /^import[ ]*(/,/^)/p' |
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 sed -e 's/^import //' -e 's/^[^"]*"/"/' |
111
kono
parents:
diff changeset
29 grep '^[ ]*"' |
kono
parents:
diff changeset
30 grep -v '"unsafe"' |
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
31 grep -v '%' |
111
kono
parents:
diff changeset
32 sed -e 's/^.*"\([^"]*\)".*$/\1/' -e 's/$/.gox/' |
kono
parents:
diff changeset
33 sort -u`
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 echo $output: $files $deps