def _get_pkg_license(pkg):
 licenses = set()
 cpr = '/usr/share/doc/{0}/copyright'.format(pkg)
 if os.path.exists(cpr):
  with salt.utils.fopen(cpr) as fp_:
   for line in fp_.read().split(os.linesep):
    if line.startswith('License:'):
     licenses.add(line.split(':', 1)[1].strip())
 return ', '.join(sorted(licenses))

def _get_pkg_license ( pkg ) : licenses = set ( ) cpr = '/usr/share/doc/{0}/copyright' . format ( pkg ) if os . path . exists ( cpr ) : with salt . utils . fopen ( cpr ) as fp_ : for line in fp_ . read ( ) . split ( os . linesep ) : if line . startswith ( 'License:' ) : licenses . add ( line . split ( ':' , 1 ) [ 1 ] . strip ( ) ) return ', ' . join ( sorted ( licenses ) )
try to get a license from the package .