scanoss / minr

SCANOSS Mining tool
22 stars 11 forks source link

minr local folder error #29

Closed xu1119 closed 1 year ago

xu1119 commented 1 year ago

I followed steps from README and successfully installed minr. I can minr from a url. When I try to minr from local folder, it can not run and get an error:

sh: 1: Syntax error: "(" unexpected

The command is:

minr -d scanoss,ldb,3.1.5,20221017,gpl-2.0,pkg:github/scamoss/ldb -u ./ldb-3.1.5

How to solve the problem?

mscasso-scanoss commented 1 year ago

Dear @xu1119 Thank you for report this problem. You are missing one part of the command specifying the information you want to mine from the folder. For example, if you want to mine "licenses", your command should looks like:

minr -d scanoss,ldb,3.1.5,20221017,gpl-2.0,pkg:github/scamoss/ldb -u ./ldb-3.1.5 -L./ldb-3.1.5

From minr help - Local mining:

-L TARGET Analyse file/directory (and sub directories) to detect license license declarations -C TARGET Analyse file/directory (and sub directories) to detect copyrigths -Q TARGET Analyse file/directory (and sub directories) for evaluating code quality -Y TARGET Analyse file/directory (and sub directories) to detect cryptographic algorithms usage.

xu1119 commented 1 year ago

Thanks. I want to get the result mined from local folder which is same as result mined from url. Using these command line parameters can not get wfp fingerprint.

-L TARGET Analyse file/directory (and sub directories) to detect license license declarations -C TARGET Analyse file/directory (and sub directories) to detect copyrigths -Q TARGET Analyse file/directory (and sub directories) for evaluating code quality -Y TARGET Analyse file/directory (and sub directories) to detect cryptographic algorithms usage.

Is anyway or parameters can do this?

mscasso-scanoss commented 1 year ago

HI, to generate the wfp you have to use the same command than for url mining. From minr help:


Mining snippet WFP: Minr extracts snippet fingerprint from all code in a .mz arhive (mined/sources/)
into mined/wfp/
-z DIRECTORY   Indicates the location of the mined/ directory
xu1119 commented 1 year ago

Great, it can help me.