Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: oss-review-toolkit/ort
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 51.1.0
Choose a base ref
...
head repository: oss-review-toolkit/ort
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 52.0.0
Choose a head ref

Commits on Feb 13, 2025

  1. refactor(scanner)!: Extract command line tools

    Refactor scanner plugins to not inherit from `CommandLineTool` and move
    the `CommandLineTool` implementations to separate objects. Also rename
    `CommandLinePathScannerWrapper` to `LocalPathScannerWrapper`.
    
    This provides better separation of concerns and helps with the upcoming
    migration of scanner plugins to the new plugin API, because with that
    the scanner plugins will not have empty constructors anymore which are
    required by the `RequirementsCommand` to list required command line
    tools.
    
    Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
    mnonnenmacher committed Feb 13, 2025
    Copy the full SHA
    212eb7b View commit details
  2. chore(commands): Remove obsolete code

    The code has become obsolete because since 3cfe66e the VCS plugins do
    not implement `CommandLineTool` anymore.
    
    Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
    mnonnenmacher committed Feb 13, 2025
    Copy the full SHA
    f71062c View commit details
  3. feat(scanner)!: Migrate to new plugin API

    Migrate the `ScannerWrapper` plugins to the new plugin API.
    
    One major difference is that the configuration properties for the scan
    result matcher are not automatically supported for all plugins anymore.
    Instead, plugins have to decide which of them they want to make
    configurable. The previous mechanism was difficult to translate to the
    new plugin API and also not all plugins need to support all of those
    options.
    
    The plugin API requires list options to be comma-separated, therefore
    the ScanCode command line options now have to be provided
    comma-separated instead of separated by whitespace.
    
    Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
    mnonnenmacher committed Feb 13, 2025
    Copy the full SHA
    40fa386 View commit details
  4. chore(model): Prefer entries over values() for enums

    This also avoids the need for the `toList()` conversion.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 13, 2025
    Copy the full SHA
    19da2db View commit details
  5. Copy the full SHA
    545475b View commit details
  6. feat(cli): Add a command to list installed plugins

    Add a command to list all installed plugins and their configuration
    options.
    
    The command is limited to plugins using the new plugin API, so package
    manager plugins are not yet shown. Once these are also migrated, the
    `--plugins` option of the `requirements` command will be removed.
    
    Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
    mnonnenmacher committed Feb 13, 2025
    Copy the full SHA
    4eedf22 View commit details

Commits on Feb 14, 2025

  1. chore: Avoid the use of toRelativeString()

    In all cases except for user-facing console output, string
    representations for paths should be invariant to the OS, as ORT is often
    comparing paths by string, e.g. VCS paths for repository provenances.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 14, 2025
    Copy the full SHA
    fbd08eb View commit details

Commits on Feb 16, 2025

  1. deps: update mordant to v3.0.2

    renovate[bot] authored and sschuberth committed Feb 16, 2025
    Copy the full SHA
    1563b20 View commit details
  2. fix(docker): Pre-create "$HOME/.gradle" for proper permissions

    Fixes #9756.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 16, 2025
    Copy the full SHA
    8b31459 View commit details
  3. Copy the full SHA
    cbb60a8 View commit details
  4. deps(docker): Upgrade to the latest stable Go version 1.24.0

    See [1].
    
    [1]: https://go.dev/doc/go1.24
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 16, 2025
    Copy the full SHA
    b70d31a View commit details

Commits on Feb 17, 2025

  1. Copy the full SHA
    4d6800c View commit details
  2. docs(analyzer): Fix a typo in function docs

    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 17, 2025
    Copy the full SHA
    0f92a13 View commit details
  3. chore: Avoid import of some Companion object members

    Where more readable and / or more consistent with existing code, avoid
    "deep import" of `Companion` object members in favor of using a
    qualified name.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 17, 2025
    Copy the full SHA
    4a6ef3d View commit details
  4. chore(scanner): Simplify Semver parsing with coerce()

    The `coerce()` function provides similar lenient parsing, see [1].
    
    [1]: https://github.com/semver4j/semver4j/blob/01f63c7efce49fa03258065bb7d3f737a7bc0819/src/test/java/org/semver4j/SemverTest.java#L751-L802
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 17, 2025
    Copy the full SHA
    552147d View commit details
  5. Copy the full SHA
    4ccd149 View commit details

Commits on Feb 18, 2025

  1. chore(DependencyGraphBuilder): Slightly improve dependency comparison

    Map to a set to be able to compare two sets for equality. This now
    compares the sets "bidirectionally" and also returns early if
    `dependencies1` does not contain all of `dependencies2.keys`.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 18, 2025
    Copy the full SHA
    5d1803b View commit details

Commits on Feb 19, 2025

  1. chore(spdx-utils): Add checkNotNull() calls to resource lookups

    These are never supposed to fail. This gets rid of an inspection hint.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 19, 2025
    Copy the full SHA
    4ee1030 View commit details
  2. chore(spdx-utils): Say "simple mapping" instead of "custom mapping"

    Match the name of the file containing the mapping by calling variables
    after "simple mapping", which also is a bit more specific than "custom
    mapping".
    
    While at it, also distinguish between mapping to licenses or
    expressions. For consistency this is also done for the mapping of
    deprecated expressions.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 19, 2025
    Copy the full SHA
    431abea View commit details
  3. refactor(spdx-utils): Map deprecated and simple licenses separately

    The previous approach was intertwining the mapping of deprecated and
    simple licenses in an "all or nothing" manner. However, conservative
    users of the API might only want to rely on unambiguous / uncontroversial
    mappings. Allow such users to only map deprecated licenses by mapping them
    separately from simple licenses.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 19, 2025
    Copy the full SHA
    cf145cf View commit details
  4. feat(spdx-utils): Expose simple mapping of licenses to SpdxExpression

    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 19, 2025
    Copy the full SHA
    6054e0b View commit details
  5. feat(spdx-utils): Add more mappings for deprecated licenses

    Fixes #9896.
    
    Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
    sschuberth committed Feb 19, 2025
    Copy the full SHA
    70c3dd0 View commit details

Commits on Feb 20, 2025

  1. Copy the full SHA
    a25942a View commit details
Showing with 1,092 additions and 935 deletions.
  1. +4 −4 Dockerfile
  2. +1 −1 analyzer/src/main/kotlin/Analyzer.kt
  3. +1 −1 docker/versions.dockerfile
  4. +1 −2 downloader/src/main/kotlin/VersionControlSystem.kt
  5. +6 −6 gradle/libs.versions.toml
  6. +60 −1 integrations/completions/ort-completion.bash
  7. +9 −1 integrations/completions/ort-completion.fish
  8. +60 −1 integrations/completions/ort-completion.zsh
  9. +1 −1 model/src/main/kotlin/licenses/LicenseInfoResolver.kt
  10. +2 −2 model/src/main/kotlin/utils/DependencyGraphBuilder.kt
  11. +2 −2 model/src/main/resources/reference.yml
  12. +2 −2 model/src/test/kotlin/config/OrtConfigurationTest.kt
  13. +3 −7 model/src/test/kotlin/licenses/ResolvedLicenseInfoTest.kt
  14. +40 −0 plugins/commands/plugins/build.gradle.kts
  15. +146 −0 plugins/commands/plugins/src/main/kotlin/PluginsCommand.kt
  16. +1 −18 plugins/commands/requirements/src/main/kotlin/RequirementsCommand.kt
  17. +9 −8 plugins/commands/scanner/src/main/kotlin/ScannerCommand.kt
  18. +3 −1 plugins/scanners/askalono/build.gradle.kts
  19. +1 −2 plugins/scanners/askalono/src/funTest/kotlin/AskalonoFunTest.kt
  20. +75 −22 plugins/scanners/askalono/src/main/kotlin/Askalono.kt
  21. +0 −1 .../askalono/src/main/resources/META-INF/services/org.ossreviewtoolkit.scanner.ScannerWrapperFactory
  22. +3 −1 plugins/scanners/boyterlc/build.gradle.kts
  23. +1 −2 plugins/scanners/boyterlc/src/funTest/kotlin/BoyterLcFunTest.kt
  24. +77 −24 plugins/scanners/boyterlc/src/main/kotlin/BoyterLc.kt
  25. +0 −1 .../boyterlc/src/main/resources/META-INF/services/org.ossreviewtoolkit.scanner.ScannerWrapperFactory
  26. +3 −1 plugins/scanners/dos/build.gradle.kts
  27. +23 −22 plugins/scanners/dos/src/main/kotlin/DosScanner.kt
  28. +12 −19 plugins/scanners/dos/src/main/kotlin/DosScannerConfig.kt
  29. +0 −1 ...nners/dos/src/main/resources/META-INF/services/org.ossreviewtoolkit.scanner.ScannerWrapperFactory
  30. +1 −4 plugins/scanners/dos/src/test/kotlin/DosScannerTest.kt
  31. +3 −1 plugins/scanners/fossid/build.gradle.kts
  32. +60 −56 plugins/scanners/fossid/src/main/kotlin/FossId.kt
  33. +61 −180 plugins/scanners/fossid/src/main/kotlin/FossIdConfig.kt
  34. +0 −1 ...rs/fossid/src/main/resources/META-INF/services/org.ossreviewtoolkit.scanner.ScannerWrapperFactory
  35. +31 −154 plugins/scanners/fossid/src/test/kotlin/FossIdConfigTest.kt
  36. +6 −5 plugins/scanners/fossid/src/test/kotlin/TestUtils.kt
  37. +3 −1 plugins/scanners/licensee/build.gradle.kts
  38. +1 −2 plugins/scanners/licensee/src/funTest/kotlin/LicenseeFunTest.kt
  39. +74 −22 plugins/scanners/licensee/src/main/kotlin/Licensee.kt
  40. +0 −1 .../licensee/src/main/resources/META-INF/services/org.ossreviewtoolkit.scanner.ScannerWrapperFactory
  41. +1 −2 plugins/scanners/licensee/src/test/kotlin/LicenseeTest.kt
  42. +3 −1 plugins/scanners/scancode/build.gradle.kts
  43. +1 −2 plugins/scanners/scancode/src/funTest/kotlin/ScanCodeScannerFunTest.kt
  44. +51 −35 plugins/scanners/scancode/src/main/kotlin/ScanCode.kt
  45. +57 −39 plugins/scanners/scancode/src/main/kotlin/ScanCodeConfig.kt
  46. +0 −1 .../scancode/src/main/resources/META-INF/services/org.ossreviewtoolkit.scanner.ScannerWrapperFactory
  47. +11 −33 plugins/scanners/scancode/src/test/kotlin/ScanCodeTest.kt
  48. +3 −1 plugins/scanners/scanoss/build.gradle.kts
  49. +26 −18 plugins/scanners/scanoss/src/main/kotlin/ScanOss.kt
  50. +33 −31 plugins/scanners/scanoss/src/main/kotlin/ScanOssConfig.kt
  51. +0 −1 ...s/scanoss/src/main/resources/META-INF/services/org.ossreviewtoolkit.scanner.ScannerWrapperFactory
  52. +0 −44 plugins/scanners/scanoss/src/test/kotlin/ScanOssConfigTest.kt
  53. +1 −3 plugins/scanners/scanoss/src/test/kotlin/ScanOssScannerDirectoryTest.kt
  54. +1 −3 plugins/scanners/scanoss/src/test/kotlin/ScanOssScannerFileTest.kt
  55. +1 −0 scanner/build.gradle.kts
  56. +3 −1 scanner/src/funTest/kotlin/scanners/ScannerIntegrationFunTest.kt
  57. +2 −5 scanner/src/main/kotlin/{CommandLinePathScannerWrapper.kt → LocalPathScannerWrapper.kt}
  58. +20 −20 scanner/src/main/kotlin/Scanner.kt
  59. +3 −17 scanner/src/main/kotlin/ScannerMatcher.kt
  60. +3 −7 scanner/src/main/kotlin/ScannerWrapper.kt
  61. +3 −26 scanner/src/main/kotlin/ScannerWrapperFactory.kt
  62. +6 −5 scanner/src/main/kotlin/storages/ClearlyDefinedStorage.kt
  63. +1 −1 scanner/src/main/kotlin/utils/Utils.kt
  64. +7 −5 scanner/src/test/kotlin/ScannerTest.kt
  65. +2 −1 utils/common/src/main/kotlin/ArchiveUtils.kt
  66. +3 −1 utils/ort/src/test/kotlin/DeclaredLicenseProcessorTest.kt
  67. +2 −2 utils/spdx/build.gradle.kts
  68. +1 −1 utils/spdx/src/main/kotlin/SpdxDeclaredLicenseMapping.kt
  69. +12 −10 utils/spdx/src/main/kotlin/SpdxExpression.kt
  70. +1 −1 utils/spdx/src/main/kotlin/SpdxLicense.kt
  71. +2 −2 utils/spdx/src/main/kotlin/SpdxLicenseException.kt
  72. +22 −20 utils/spdx/src/main/kotlin/SpdxSimpleLicenseMapping.kt
  73. +6 −0 utils/spdx/src/main/resources/deprecated-license-mapping.yml
  74. +5 −5 utils/spdx/src/test/kotlin/SpdxExpressionTest.kt
  75. +13 −10 utils/spdx/src/test/kotlin/SpdxSimpleLicenseMappingTest.kt
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -582,8 +582,8 @@ ENV PATH=$PATH:/opt/ort/bin
USER $USER
WORKDIR $HOME

# Ensure that the ORT data directory exists to be able to mount the config into it with correct permissions.
RUN mkdir -p "$HOME/.ort"
# Ensure that these directories exist in the container to be able to mount directories from the host into them with correct permissions.
RUN mkdir -p "$HOME/.ort" "$HOME/.gradle"

ENTRYPOINT ["/opt/ort/bin/ort"]

@@ -598,7 +598,7 @@ ENV PATH=$PATH:/opt/ort/bin
USER $USER
WORKDIR $HOME

# Ensure that the ORT data directory exists to be able to mount the config into it with correct permissions.
RUN mkdir -p "$HOME/.ort"
# Ensure that these directories exist in the container to be able to mount directories from the host into them with correct permissions.
RUN mkdir -p "$HOME/.ort" "$HOME/.gradle"

ENTRYPOINT ["/opt/ort/bin/ort"]
2 changes: 1 addition & 1 deletion analyzer/src/main/kotlin/Analyzer.kt
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ class Analyzer(private val config: AnalyzerConfiguration, private val labels: Ma

/**
* Find files recognized by any of [packageManagers] inside [absoluteProjectPath]. The [repositoryConfiguration] is
* taken into account, e.g. for path excludes and packaga manager options. Instantiate only those package managers
* taken into account, e.g. for path excludes and package manager options. Instantiate only those package managers
* that have matching files and return the latter as part of [ManagedFileInfo].
*/
@JvmOverloads
2 changes: 1 addition & 1 deletion docker/versions.dockerfile
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ ARG COMPOSER_VERSION=2.8.4
ARG CONAN_VERSION=1.66.0
ARG DART_VERSION=2.18.4
ARG DOTNET_VERSION=6.0
ARG GO_VERSION=1.23.5
ARG GO_VERSION=1.24.0
ARG HASKELL_STACK_VERSION=2.13.1
ARG JAVA_VERSION=21
ARG LICENSEE_VERSION=9.18.0
3 changes: 1 addition & 2 deletions downloader/src/main/kotlin/VersionControlSystem.kt
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ import java.io.IOException

import org.apache.logging.log4j.kotlin.logger

import org.ossreviewtoolkit.downloader.VersionControlSystemFactory.Companion.ALL
import org.ossreviewtoolkit.model.Package
import org.ossreviewtoolkit.model.VcsInfo
import org.ossreviewtoolkit.model.VcsType
@@ -43,7 +42,7 @@ import org.semver4j.Semver
abstract class VersionControlSystem : Plugin {
companion object {
private fun getAllVcsByPriority(configs: Map<String, PluginConfig>) =
ALL.map { (id, factory) ->
VersionControlSystemFactory.ALL.map { (id, factory) ->
val config = configs[id] ?: PluginConfig()
factory.create(config)
}.sortedByDescending {
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ gitSemverPlugin = "0.15.0"
graalVmNativeImagePlugin = "0.10.5"
ideaExtPlugin = "1.1.10"
kotlinPlugin = "2.1.10"
ksp = "2.1.10-1.0.29"
ksp = "2.1.10-1.0.30"
mavenPublishPlugin = "0.30.0"
reproducibleBuildsPlugin = "1.0"
versionsPlugin = "0.52.0"
@@ -37,7 +37,7 @@ jgit = "7.1.0.202411261347-r"
jiraRestClient = "6.0.1"
jruby = "9.4.12.0"
jslt = "0.1.14"
jsonSchemaValidator = "1.5.5"
jsonSchemaValidator = "1.5.6"
kaml = "0.72.0"
kotest = "5.9.1"
kotlinPoet = "2.0.0"
@@ -52,18 +52,18 @@ logback = "1.5.16"
maven = "3.9.9"
mavenResolver = "1.9.22"
mockk = "1.13.14"
mordant = "3.0.1"
mordant = "3.0.2"
okhttp = "4.12.0"
postgres = "42.7.5"
postgresEmbedded = "1.1.0"
reflections = "0.10.2"
retrofit = "2.11.0"
s3 = "2.30.16"
s3 = "2.30.21"
saxonHe = "12.5"
scanoss = "0.9.0"
scanoss = "0.10.0"
semver4j = "5.6.0"
slf4j = "2.0.16"
springCore = "6.2.2"
springCore = "6.2.3"
svnkit = "1.10.11"
sw360Client = "17.0.1-m2"
wiremock = "3.12.0"
61 changes: 60 additions & 1 deletion integrations/completions/ort-completion.bash
Original file line number Diff line number Diff line change
@@ -115,6 +115,10 @@ _ort() {
_ort_notify $(( i + 1 ))
return
;;
plugins)
_ort_plugins $(( i + 1 ))
return
;;
report)
_ort_report $(( i + 1 ))
return
@@ -176,7 +180,7 @@ _ort() {
"--help")
;;
*)
COMPREPLY=($(compgen -W 'advise analyze compare config download evaluate migrate notify report requirements scan upload-curations upload-result-to-postgres upload-result-to-sw360' -- "${word}"))
COMPREPLY=($(compgen -W 'advise analyze compare config download evaluate migrate notify plugins report requirements scan upload-curations upload-result-to-postgres upload-result-to-sw360' -- "${word}"))
;;
esac
}
@@ -1054,6 +1058,61 @@ _ort_notify() {
esac
}
_ort_plugins() {
local i=$1
local in_param=''
local fixed_arg_names=()
local vararg_name=''
local can_parse_options=1
while [[ ${i} -lt $COMP_CWORD ]]; do
if [[ ${can_parse_options} -eq 1 ]]; then
case "${COMP_WORDS[$i]}" in
--)
can_parse_options=0
(( i = i + 1 ));
continue
;;
--types)
__skip_opt_eq
(( i = i + 1 ))
[[ ${i} -gt COMP_CWORD ]] && in_param='--types' || in_param=''
continue
;;
-h|--help)
__skip_opt_eq
in_param=''
continue
;;
esac
fi
case "${COMP_WORDS[$i]}" in
*)
(( i = i + 1 ))
# drop the head of the array
fixed_arg_names=("${fixed_arg_names[@]:1}")
;;
esac
done
local word="${COMP_WORDS[$COMP_CWORD]}"
if [[ "${word}" =~ ^[-] ]]; then
COMPREPLY=($(compgen -W '--types -h --help' -- "${word}"))
return
fi
# We're either at an option's value, or the first remaining fixed size
# arg, or the vararg if there are no fixed args left
[[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
[[ -z "${in_param}" ]] && in_param=${vararg_name}
case "${in_param}" in
"--types")
;;
"--help")
;;
esac
}
_ort_report() {
local i=$1
local in_param=''
10 changes: 9 additions & 1 deletion integrations/completions/ort-completion.fish
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@


### Setup for ort
set -l ort_subcommands 'advise analyze compare config download evaluate migrate notify report requirements scan upload-curations upload-result-to-postgres upload-result-to-sw360'
set -l ort_subcommands 'advise analyze compare config download evaluate migrate notify plugins report requirements scan upload-curations upload-result-to-postgres upload-result-to-sw360'

## Options for ort
complete -c ort -n "not __fish_seen_subcommand_from $ort_subcommands" -l config -s c -r -F -d 'The path to a configuration file.'
@@ -135,6 +135,14 @@ complete -c ort -n "__fish_seen_subcommand_from notify" -l label -s l -r -d 'Set
complete -c ort -n "__fish_seen_subcommand_from notify" -s h -l help -d 'Show this message and exit'


### Setup for plugins
complete -c ort -f -n __fish_use_subcommand -a plugins -d 'Print information about the installed ORT plugins.'

## Options for plugins
complete -c ort -n "__fish_seen_subcommand_from plugins" -l types -r -d 'A comma-separated list of plugin types to show.'
complete -c ort -n "__fish_seen_subcommand_from plugins" -s h -l help -d 'Show this message and exit'


### Setup for report
complete -c ort -f -n __fish_use_subcommand -a report -d 'Present Analyzer, Scanner and Evaluator results in various formats.'

61 changes: 60 additions & 1 deletion integrations/completions/ort-completion.zsh
Original file line number Diff line number Diff line change
@@ -120,6 +120,10 @@ _ort() {
_ort_notify $(( i + 1 ))
return
;;
plugins)
_ort_plugins $(( i + 1 ))
return
;;
report)
_ort_report $(( i + 1 ))
return
@@ -181,7 +185,7 @@ _ort() {
"--help")
;;
*)
COMPREPLY=($(compgen -W 'advise analyze compare config download evaluate migrate notify report requirements scan upload-curations upload-result-to-postgres upload-result-to-sw360' -- "${word}"))
COMPREPLY=($(compgen -W 'advise analyze compare config download evaluate migrate notify plugins report requirements scan upload-curations upload-result-to-postgres upload-result-to-sw360' -- "${word}"))
;;
esac
}
@@ -1059,6 +1063,61 @@ _ort_notify() {
esac
}
_ort_plugins() {
local i=$1
local in_param=''
local fixed_arg_names=()
local vararg_name=''
local can_parse_options=1
while [[ ${i} -lt $COMP_CWORD ]]; do
if [[ ${can_parse_options} -eq 1 ]]; then
case "${COMP_WORDS[$i]}" in
--)
can_parse_options=0
(( i = i + 1 ));
continue
;;
--types)
__skip_opt_eq
(( i = i + 1 ))
[[ ${i} -gt COMP_CWORD ]] && in_param='--types' || in_param=''
continue
;;
-h|--help)
__skip_opt_eq
in_param=''
continue
;;
esac
fi
case "${COMP_WORDS[$i]}" in
*)
(( i = i + 1 ))
# drop the head of the array
fixed_arg_names=("${fixed_arg_names[@]:1}")
;;
esac
done
local word="${COMP_WORDS[$COMP_CWORD]}"
if [[ "${word}" =~ ^[-] ]]; then
COMPREPLY=($(compgen -W '--types -h --help' -- "${word}"))
return
fi
# We're either at an option's value, or the first remaining fixed size
# arg, or the vararg if there are no fixed args left
[[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
[[ -z "${in_param}" ]] && in_param=${vararg_name}
case "${in_param}" in
"--types")
;;
"--help")
;;
esac
}
_ort_report() {
local i=$1
local in_param=''
2 changes: 1 addition & 1 deletion model/src/main/kotlin/licenses/LicenseInfoResolver.kt
Original file line number Diff line number Diff line change
@@ -258,7 +258,7 @@ class LicenseInfoResolver(
val directory = (provenance as? RepositoryProvenance)?.vcsInfo?.path.orEmpty()
val rootLicenseFiles = pathLicenseMatcher.getApplicableLicenseFilesForDirectories(
relativeFilePaths = archiveDir.walk().filter { it.isFile }.mapTo(mutableSetOf()) {
it.toRelativeString(archiveDir)
it.relativeTo(archiveDir).invariantSeparatorsPath
},
directories = listOf(directory)
).getValue(directory)
4 changes: 2 additions & 2 deletions model/src/main/kotlin/utils/DependencyGraphBuilder.kt
Original file line number Diff line number Diff line change
@@ -326,9 +326,9 @@ class DependencyGraphBuilder<D>(
val dependencies = dependencyHandler.dependenciesFor(dependency)
if (ref.dependencies.size != dependencies.size) return false

val dependencies1 = ref.dependencies.map { dependencyIds[it.pkg] }
val dependencies1 = ref.dependencies.mapTo(mutableSetOf()) { dependencyIds[it.pkg] }
val dependencies2 = dependencies.associateBy { dependencyHandler.identifierFor(it) }
if (!dependencies2.keys.containsAll(dependencies1)) return false
if (dependencies1 != dependencies2.keys) return false

return ref.dependencies.all { refDep ->
dependencies2[dependencyIds[refDep.pkg]]?.let { dependencyTreeEquals(refDep, it) } == true
4 changes: 2 additions & 2 deletions model/src/main/resources/reference.yml
Original file line number Diff line number Diff line change
@@ -237,10 +237,10 @@ ort:
options:
# Command line options that affect the ScanCode output. If changed, stored scan results that were created with
# different options are not reused.
commandLine: '--copyright --license --info --strip-root --timeout 300'
commandLine: '--copyright,--license,--info,--strip-root,--timeout,300'

# Command line options that do not affect the ScanCode output.
commandLineNonConfig: '--processes 4'
commandLineNonConfig: '--processes,4'

# Use per-file license findings instead of per-line ones.
preferFileLicense: false
4 changes: 2 additions & 2 deletions model/src/test/kotlin/config/OrtConfigurationTest.kt
Original file line number Diff line number Diff line change
@@ -241,8 +241,8 @@ class OrtConfigurationTest : WordSpec({
config shouldNotBeNull {
get("ScanCode") shouldNotBeNull {
options shouldContainExactly mapOf(
"commandLine" to "--copyright --license --info --strip-root --timeout 300",
"commandLineNonConfig" to "--processes 4",
"commandLine" to "--copyright,--license,--info,--strip-root,--timeout,300",
"commandLineNonConfig" to "--processes,4",
"preferFileLicense" to "false",
"minVersion" to "3.2.1-rc2",
"maxVersion" to "32.0.0"
10 changes: 3 additions & 7 deletions model/src/test/kotlin/licenses/ResolvedLicenseInfoTest.kt
Original file line number Diff line number Diff line change
@@ -38,7 +38,6 @@ import org.ossreviewtoolkit.model.TextLocation
import org.ossreviewtoolkit.model.UnknownProvenance
import org.ossreviewtoolkit.model.config.CopyrightGarbage
import org.ossreviewtoolkit.model.config.LicenseFilePatterns
import org.ossreviewtoolkit.model.licenses.LicenseView.Companion.CONCLUDED_OR_DECLARED_AND_DETECTED
import org.ossreviewtoolkit.utils.ort.ProcessedDeclaredLicense
import org.ossreviewtoolkit.utils.spdx.SpdxExpression
import org.ossreviewtoolkit.utils.spdx.SpdxLicense
@@ -97,7 +96,7 @@ class ResolvedLicenseInfoTest : WordSpec({
)

val effectiveLicense = RESOLVED_LICENSE_INFO.effectiveLicense(
CONCLUDED_OR_DECLARED_AND_DETECTED,
LicenseView.CONCLUDED_OR_DECLARED_AND_DETECTED,
choices
)

@@ -141,7 +140,7 @@ class ResolvedLicenseInfoTest : WordSpec({
timeout = 1.seconds
) {
runCancellable {
COMPUTATION_HEAVY_RESOLVED_LICENSE_INFO.effectiveLicense(CONCLUDED_OR_DECLARED_AND_DETECTED)
COMPUTATION_HEAVY_RESOLVED_LICENSE_INFO.effectiveLicense(LicenseView.CONCLUDED_OR_DECLARED_AND_DETECTED)
}
}
}
@@ -229,10 +228,7 @@ private val RESOLVED_LICENSE_INFO: ResolvedLicenseInfo by lazy {
* effectiveLicense(), rather computation-heavy.
*/
private val COMPUTATION_HEAVY_RESOLVED_LICENSE_INFO: ResolvedLicenseInfo by lazy {
val licensesWithoutChoice = SpdxLicense.values()
.toList()
.subList(0, 200)
.map { SpdxExpression.parse(it.id) }
val licensesWithoutChoice = SpdxLicense.entries.subList(0, 200).map { SpdxExpression.parse(it.id) }

// Expressions taken from a real world scan with swapped identifiers.
val licensesWithChoice = listOf(
Loading