mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-25 09:27:45 +00:00
Expand license file search to LICENSES/*.txt
The KDE Project is starting to adopt a convention to add license files, with a .txt file extension, to a toplevel directory called "LICENSES". Make autospec learn about this convention. Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
@@ -169,6 +169,11 @@ def scan_for_licenses(srcdir, config, pkg_name):
|
||||
if name.lower() in targets or target_pat.search(name.lower()):
|
||||
license_from_copying_hash(os.path.join(dirpath, name),
|
||||
srcdir, config, pkg_name)
|
||||
# Also look for files that end with .txt and reside in a LICENSES
|
||||
# directory. This is a convention that KDE is adopting.
|
||||
if os.path.basename(dirpath) == "LICENSES" and re.search(r'\.txt$', name):
|
||||
license_from_copying_hash(os.path.join(dirpath, name),
|
||||
srcdir, config, pkg_name)
|
||||
|
||||
if not licenses:
|
||||
print_fatal(" Cannot find any license or a valid {}.license file!\n".format(pkg_name))
|
||||
|
||||
Reference in New Issue
Block a user