def fetch_necessary_packages(dest_dir, install_dir):
 names_to_check = sys.argv[1:]
 errors = []
 fetched_packages = []
 for package_class in external_packages.ExternalPackage.subclasses:
  package = package_class()
  if (names_to_check and (package.name.lower() not in names_to_check)):
   continue
  if (not package.is_needed(install_dir)):
   logging.info('A new %s is not needed on this system.', package.name)
   if INSTALL_ALL:
    logging.info('Installing anyways...')
   else:
    continue
  if (not package.fetch(dest_dir)):
   msg = ('Unable to download %s' % package.name)
   logging.error(msg)
   errors.append(msg)
  else:
   fetched_packages.append(package)
 return (fetched_packages, errors)

def fetch_necessary_packages ( dest_dir , install_dir ) : names_to_check = sys . argv [ 1 : ] errors = [ ] fetched_packages = [ ] for package_class in external_packages . ExternalPackage . subclasses : package = package_class ( ) if ( names_to_check and ( package . name . lower ( ) not in names_to_check ) ) : continue if ( not package . is_needed ( install_dir ) ) : logging . info ( 'A new %s is not needed on this system.' , package . name ) if INSTALL_ALL : logging . info ( 'Installing anyways...' ) else : continue if ( not package . fetch ( dest_dir ) ) : msg = ( 'Unable to download %s' % package . name ) logging . error ( msg ) errors . append ( msg ) else : fetched_packages . append ( package ) return ( fetched_packages , errors )
fetches all externalpackages into dest_dir .