@@ -185,8 +185,8 @@ def clone_repo(git_repo, project_version):
185
185
for i in range (tries ):
186
186
try :
187
187
print ('cloning [{}], branch: [{}] to [{}]' .format (git_repo , project_version , build_package ))
188
- subprocess .check_output (['/usr/bin/ git' , 'clone' , git_repo , build_package ])
189
- subprocess .check_output (['git' , 'checkout' , project_version ], cwd = build_package )
188
+ subprocess .check_output (['git' , 'clone' , git_repo , build_package ], timeout = 3600 , env = { 'LC_ALL' : 'C.UTF-8' } )
189
+ subprocess .check_output (['git' , 'checkout' , project_version ], cwd = build_package , timeout = 3600 , env = { 'LC_ALL' : 'C.UTF-8' } )
190
190
except subprocess .CalledProcessError :
191
191
if i < tries - 1 :
192
192
time .sleep (5 )
@@ -196,13 +196,14 @@ def clone_repo(git_repo, project_version):
196
196
sys .exit (1 )
197
197
break
198
198
# generate commit_id
199
- git_commit = subprocess .check_output (['git' , 'rev-parse' , 'HEAD' ], cwd = build_package )
199
+ git_commit = subprocess .check_output (['git' , 'rev-parse' , 'HEAD' ], cwd = build_package , timeout = 3600 , env = { 'LC_ALL' : 'C.UTF-8' } )
200
200
print (git_commit .decode ('utf-8' ), file = open (get_home + '/commit_hash' , "a" ))
201
201
202
202
203
203
def hash_file (rpm ):
204
- """"This function returns the SHA-1 hash
205
- of the file passed into it"""
204
+ # This function returns the SHA-1 hash
205
+ # of the file passed into it
206
+
206
207
# make a hash object
207
208
h = hashlib .sha1 ()
208
209
# open file for reading in binary mode
@@ -259,7 +260,7 @@ def container_data():
259
260
full_list = []
260
261
if not os .path .basename (pkg ).endswith ("src.rpm" ):
261
262
try :
262
- dependencies = subprocess .check_output (['dnf' , 'repoquery' , '-q' , '--latest-limit=1' , '--qf' , '%{NAME}' , '--whatrequires' , name ])
263
+ dependencies = subprocess .check_output (['dnf' , 'repoquery' , '-q' , '--latest-limit=1' , '--qf' , '%{NAME}' , '--whatrequires' , name ], timeout = 3600 , env = { 'LC_ALL' : 'C.UTF-8' } )
263
264
full_list = dependencies .decode ().split ('\n ' )
264
265
except subprocess .CalledProcessError :
265
266
print ('some problem with dnf repoquery for %s' % name )
@@ -505,7 +506,7 @@ def cleanup_all():
505
506
for dirs in ["/var/lib/mock/{}-{}" .format (platform_name , platform_arch ) + s for s in umount_dirs ]:
506
507
if os .path .exists (dirs ):
507
508
try :
508
- subprocess .check_output (['sudo' , 'umount' , '-ql' , dirs ])
509
+ subprocess .check_output (['sudo' , 'umount' , '-ql' , dirs ], text = True )
509
510
except subprocess .CalledProcessError as e :
510
511
print (e .output )
511
512
continue
0 commit comments