File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 2
2
from tempfile import mkstemp
3
3
import tarfile
4
4
import yaml
5
+ import glob
6
+
5
7
try :
6
8
from bioblend import toolshed
7
9
except ImportError :
@@ -119,14 +121,19 @@ def build_tarball(tool_path):
119
121
responsible for deleting this file.
120
122
"""
121
123
fd , temp_path = mkstemp ()
124
+ repo_config = shed_repo_config (tool_path )
125
+ ignore_list = []
126
+ for shed_ignore in repo_config .get ('ignore' , []):
127
+ ignore_list .extend (glob .glob (os .path .join (tool_path , shed_ignore )))
122
128
try :
123
129
with tarfile .open (temp_path , "w:gz" ) as tar :
124
130
for name in os .listdir (tool_path ):
125
- if os .path .islink (name ):
126
- path = os .path .realpath (name )
127
- else :
128
- path = os .path .join (tool_path , name )
129
- tar .add (path , name , recursive = True , exclude = _tar_excludes )
131
+ if not os .path .join (tool_path , name ) in ignore_list :
132
+ if os .path .islink (name ):
133
+ path = os .path .realpath (name )
134
+ else :
135
+ path = os .path .join (tool_path , name )
136
+ tar .add (path , name , recursive = True , exclude = _tar_excludes )
130
137
finally :
131
138
os .close (fd )
132
139
return temp_path
You can’t perform that action at this time.
0 commit comments