Advertisement
Guest User

Untitled

a guest
Sep 26th, 2023
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | Source Code | 0 0
  1. def available_licenses(d):
  2. """
  3. Return the available licenses by searching the directories specified by
  4. COMMON_LICENSE_DIR and LICENSE_PATH.
  5. """
  6. lic_dirs = ((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' +
  7. (d.getVar('LICENSE_PATH') or '')).split()
  8.  
  9. licenses = set()
  10. for lic_dir in lic_dirs:
  11. licenses.update(os.listdir(lic_dir))
  12.  
  13. return licenses
  14.  
  15. COMPATIBLE_LICENSES ??= ""
  16.  
  17. # Mark all licenses that are not in COMPATIBLE_LICENSES as incompatible.
  18. INCOMPATIBLE_LICENSE ?= "${@' '.join(sorted(available_licenses(d) - set(d.getVar('COMPATIBLE_LICENSES').split())))}"
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement