scanoss / engine

SCANOSS Open Source Inventory Engine
GNU General Public License v2.0
34 stars 20 forks source link

no result #5

Closed tiandiyixian closed 3 years ago

tiandiyixian commented 3 years ago

Hello, I use engine & ldb & minr master branch to build the system on different systems (Ubuntu, Centos 7) , and use the following test command: scanoss webhook-1.0/setup.py, but whether it is a file or a compressed package, the result is 0, no code snippet hits the result: { "webhook-1.0/setup.py": [ { "id": "none", "elapsed": "0.001200s" } ] }

The log result is:

Sat Apr 3 14:33:07 2021 Checking entire file 7be61208f1d61aa539390a52702ca402 selected Starting match: file File webhook-1.0/setup.py Inherited component hint from context: NULL external_component_hint_in_path returned: no hints seek_component_hint_in_path_start results in no hits Shortest path ranking: path_rank #00: 20, webhook-1.0/setup.py select_paths_matching_component_names_in_rank returned NO hints search_component_hint returned NO hints Shortest path ranking: path_rank #00: 20, webhook-1.0/setup.py select_paths_matching_component_names_in_rank returned NO hints search_component_hint returned NO hints Orphan file 1 of 1 files considered Final match: file

scanoss-cs commented 3 years ago

Hello!

This is how to create a test KB and make a scan. First of all, make sure you do make && make install these three components: minr (the mining tool), ldb (the database engine), and engine (the scanning engine). With all these three components installed, do the following:

# Creating the LDB directory (KB engine)
root@test:/root# mkdir /var/lib/ldb

# Mine SCANOSS Webhook 1.0 (data is left in mined/ directory)
root@test:/root# minr -d scanoss,webhook,1.0,2020-03-10,BSD-3-Clause -u https://github.com/scanoss/webhook/archive/refs/tags/1.0.tar.gz

# Import the mined/ directory into the KB
root@test:/root# minr -i mined

# In this very particular case, a KB will be created with a single URL that does not provide popularity information. In a real life scenario, the table would be created automatically when data is imported. Therefore, you need to do this:

root@test:/root# mkdir /var/lib/ldb/oss/popularity

# Fetch SCANOSS Webhook 1.0 for scanning test
root@test:/root# wget https://github.com/scanoss/webhook/archive/refs/tags/1.0.tar.gz

# Decompress tarball
root@test:/root# tar -zxf 1.0.tar.gz

# Scan file
root@test:/root# scanoss webhook-1.0/setup.py
{
  "webhook-1.0/setup.py": [
    {
      "id": "file",
      "lines": "all",
      "oss_lines": "all",
      "matched": "100%",
      "vendor": "scanoss",
      "component": "webhook",
      "version": "1.0",
      "latest": "1.0",
      "url": "https://github.com/scanoss/webhook/archive/refs/tags/1.0.tar.gz",
      "release_date": "2020-03-10",
      "file": "webhook-1.0/setup.py",
      "url_hash": "611e5c3a58a3c2b78385556368c5230e",
      "file_hash": "7be61208f1d61aa539390a52702ca402",
      "dependencies": [],
      "licenses": [        {
          "name": "BSD-3-Clause",
          "source": "component_declared"
        }],
      "copyrights": [],
      "vulnerabilities": [],
      "quality": [
        {
          "score": "4/5",
          "source": "best_practices"
        }
      ],
      "cryptography": [],
      "elapsed": "0.066813s"
    }
  ]
}

Please let us know if this works for you!

tiandiyixian commented 3 years ago

follow the new guide,it works well, thanks!