Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ License detection:
This is now built-in with the --license-text option and --info
and exposed with the "percentage_of_license_text" attribute.

- The license dump() has been modified to add an extra space at empty
newlines for license files which also have multiple indentation levels
as this was generating invalid YAML output files when ``--license-text``
or ``--license-references`` was enabled.

See https://github.com/nexB/scancode-toolkit/issues/3219

v31.2.4 - 2023-01-09
----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion etc/scripts/licenses/buildrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def cli(licenses_file):
rl = models.BasicRule(text=rdata.text, **rdata.data)
skinny_rules.append(rl)

models.validate_rules(skinny_rules, licenses_by_key, with_text=True)
models.validate_rules(skinny_rules, licenses_by_key, with_text=True, thorough=True)

print()
for rule in skinny_rules:
Expand Down
661 changes: 661 additions & 0 deletions license-yaml-update.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/licensedcode/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# global in-memory cache of the LicenseCache
_LICENSE_CACHE = None

LICENSE_INDEX_LOCK_TIMEOUT = 60 * 4
LICENSE_INDEX_LOCK_TIMEOUT = 60 * 6
LICENSE_INDEX_DIR = 'license_index'
LICENSE_INDEX_FILENAME = 'index_cache'
LICENSE_LOCKFILE_NAME = 'scancode_license_index_lockfile'
Expand Down Expand Up @@ -134,8 +134,6 @@ def load_or_build(
try:
# acquire lock and wait until timeout to get a lock or die
with lockfile.FileLock(lock_file).locked(timeout=timeout):
# Here, the cache is either stale or non-existing: we need to
# rebuild all cached data (e.g. mostly the index) and cache it

additional_directories = []
if only_builtin:
Expand All @@ -156,6 +154,8 @@ def load_or_build(
additional_directories=additional_license_dirs,
scancode_license_dir=licenses_data_dir
)
# Here, the cache is either stale or non-existing: we need to
# rebuild all cached data (e.g. mostly the index) and cache it
licenses_db = load_licenses_from_multiple_dirs(
additional_license_data_dirs=additional_license_dirs,
builtin_license_data_dir=licenses_data_dir,
Expand Down
Loading