17
17
18
18
set -e
19
19
20
+ function cp_external() {
21
+ local src_dir=$1
22
+ local dest_dir=$2
23
+ for f in ` find " $src_dir " -maxdepth 1 -mindepth 1 ! -name ' *local_config_cuda*' ` ; do
24
+ cp -R " $f " " $dest_dir "
25
+ done
26
+ }
27
+
20
28
function main() {
21
29
if [ $# -lt 1 ] ; then
22
30
echo " No destination dir provided"
@@ -36,23 +44,31 @@ function main() {
36
44
if [ ! -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow ]; then
37
45
# Really old (0.2.1-) runfiles, without workspace name.
38
46
cp -R \
39
- bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/{ tensorflow,external} \
47
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/tensorflow \
40
48
" ${TMPDIR} "
49
+ mkdir " ${TMPDIR} /external"
50
+ cp_external \
51
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/external \
52
+ " ${TMPDIR} /external"
41
53
RUNFILES=bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles
42
54
else
43
55
if [ -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external ]; then
44
56
# Old-style runfiles structure (--legacy_external_runfiles).
45
57
cp -R \
46
- bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/{ tensorflow,external} \
58
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
47
59
" ${TMPDIR} "
60
+ mkdir " ${TMPDIR} /external"
61
+ cp_external \
62
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
63
+ " ${TMPDIR} /external"
48
64
else
49
65
# New-style runfiles structure (--nolegacy_external_runfiles).
50
66
cp -R \
51
67
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
52
68
" ${TMPDIR} "
53
69
mkdir " ${TMPDIR} /external"
54
70
# Note: this makes an extra copy of org_tensorflow.
55
- cp -R \
71
+ cp_external \
56
72
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
57
73
" ${TMPDIR} /external"
58
74
fi
0 commit comments