@@ -19,8 +19,8 @@ import re
19
19
from glob import glob
20
20
from subprocess import check_output , call , DEVNULL
21
21
from tempfile import TemporaryDirectory
22
- import requests
23
22
import plistlib
23
+ import requests
24
24
from requests .exceptions import ConnectionError as ConnError
25
25
26
26
DESTDIR = "dist"
@@ -71,8 +71,10 @@ def download(url, fname=None):
71
71
except ConnError :
72
72
print (f"Error while trying to download { url } " , file = sys .stderr )
73
73
print ("Skipping." , file = sys .stderr )
74
- return
75
- size = int (req .headers .get ("content-length" ))
74
+ return None
75
+ size = 0
76
+ if sizestr := req .headers .get ("content-length" ):
77
+ size = int (sizestr )
76
78
etag = req .headers .get ("etag" )
77
79
oldet = ETAGS .get (url )
78
80
if etag == oldet and os .path .exists (fname ):
@@ -215,15 +217,6 @@ def debianize(binfile, annexsa_archive):
215
217
"""
216
218
For each Linux binary make a deb package with git annex standalone.
217
219
"""
218
- def docker_cleanup ():
219
- print ("Stopping and cleaning up docker container" )
220
- cmd = ["docker" , "kill" , "gin-deb-build" ]
221
- run (cmd )
222
- cmd = ["docker" , "container" , "rm" , "gin-deb-build" ]
223
- run (cmd )
224
-
225
- docker_cleanup ()
226
-
227
220
# The default temporary root on macOS is /var/folders
228
221
# Docker currently has issues mounting directories under /var
229
222
# Forcing temporary directory to be rooted at /tmp instead
@@ -316,7 +309,6 @@ def debianize(binfile, annexsa_archive):
316
309
print ("Running debian build script" )
317
310
if run (cmd ) > 0 :
318
311
print ("Deb build failed" , file = sys .stderr )
319
- docker_cleanup ()
320
312
return
321
313
322
314
debfilename = f"{ pkgname } .deb"
@@ -326,7 +318,6 @@ def debianize(binfile, annexsa_archive):
326
318
os .remove (debfiledest )
327
319
shutil .copy (debfilepath , debfiledest )
328
320
print ("Done" )
329
- docker_cleanup ()
330
321
return debfiledest
331
322
332
323
0 commit comments