def CHECK_FETCH_CMD(state, fetch_dists):
 if (not fetch_dists):
  return
 prefix = state['prefix']
 index = state['index']
 assert isdir(prefix)
 size = reduce(add, (index[dist].get('size', 0) for dist in fetch_dists), 0)
 check_size(prefix, size)

def CHECK_FETCH_CMD ( state , fetch_dists ) : if ( not fetch_dists ) : return prefix = state [ 'prefix' ] index = state [ 'index' ] assert isdir ( prefix ) size = reduce ( add , ( index [ dist ] . get ( 'size' , 0 ) for dist in fetch_dists ) , 0 ) check_size ( prefix , size )
check whether there is enough space for download packages .