@@ -23,6 +23,7 @@ def wget(filepath):
2323 if '/' in filepath :
2424 filename = filename [filename .rfind ('/' ) + 1 :]
2525 for d in DEBIAN :
26+ # TODO: handle exitcode?
2627 subprocess .call (
2728 ['nice' , 'wget' , '--tries=10' , '--timeout=300' , '-O' , filename , d + filepath ])
2829 if os .path .isfile (filename ):
@@ -40,9 +41,11 @@ def latestvername(names):
4041def getpackages ():
4142 if not wget ('ls-lR.gz' ):
4243 return []
44+ # TODO: handle exitcode?
4345 subprocess .call (['nice' , 'gunzip' , 'ls-lR.gz' ])
4446 with open ('ls-lR' , 'rt' ) as f :
4547 lines = f .readlines ()
48+ # TODO: handle exitcode?
4649 subprocess .call (['rm' , 'ls-lR' ])
4750
4851 path = None
@@ -141,10 +144,13 @@ def downloadpackage(filepath, outpath):
141144
142145 filename = filepath [filepath .rfind ('/' ) + 1 :]
143146 if filename [- 3 :] == '.gz' :
147+ # TODO: handle exitcode?
144148 subprocess .call (['tar' , 'xzvf' , filename ])
145149 elif filename [- 3 :] == '.xz' :
150+ # TODO: handle exitcode?
146151 subprocess .call (['tar' , 'xJvf' , filename ])
147152 elif filename [- 4 :] == '.bz2' :
153+ # TODO: handle exitcode?
148154 subprocess .call (['tar' , 'xjvf' , filename ])
149155 else :
150156 return
@@ -153,6 +159,7 @@ def downloadpackage(filepath, outpath):
153159
154160 for g in glob .glob ('[#_A-Za-z0-9]*' ):
155161 if os .path .isdir (g ):
162+ # TODO: handle exitcode?
156163 subprocess .call (['tar' , '-cJvf' , outpath + filename [:filename .rfind ('.' )] + '.xz' , g ])
157164 break
158165
0 commit comments