Bug 230114 - [NEW PORT] textproc/scancode-toolkit: Scans code for license, copyright, package and documented dependencies
Summary: [NEW PORT] textproc/scancode-toolkit: Scans code for license, copyright, pack...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Martin Wilke
URL: https://github.com/nexB/scancode-toolkit
Keywords:
Depends on: 232880 232881
Blocks:
  Show dependency treegraph
 
Reported: 2018-07-28 14:57 UTC by Kai Knoblich
Modified: 2019-01-05 21:32 UTC (History)
3 users (show)

See Also:


Attachments
scancode-toolkit.patch (11.78 KB, patch)
2018-07-28 14:57 UTC, Kai Knoblich
no flags Details | Diff
Corrected paths (11.81 KB, patch)
2018-07-28 15:11 UTC, Nathan
no flags Details | Diff
scancode-toolkit-2.9.7.patch (14.91 KB, patch)
2018-11-01 12:38 UTC, Kai Knoblich
no flags Details | Diff
scancode-toolkit-2.9.7.patch (14.76 KB, patch)
2018-11-01 13:26 UTC, Kai Knoblich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Knoblich freebsd_committer freebsd_triage 2018-07-28 14:57:58 UTC
Created attachment 195537 [details]
scancode-toolkit.patch

Hello,

this patch adds the Python application textproc/scancode-toolkit, which scans code for license, copyright, package and documented dependencies.

It can be also used to discover and inventory open source and third-party packaged used in your code.

QA:
~~~
- poudriere (10.4-, 11.1-, 11.2-RELEASE, 12.0-CURRENT @r336739) for each amd64 + i386 archs -> OK
- portlint -> OK
Comment 1 Nathan 2018-07-28 15:03:18 UTC
The patch put scancode in /usr/ports/scancode instead of cat/portname
Comment 2 Nathan 2018-07-28 15:11:16 UTC
Created attachment 195538 [details]
Corrected paths
Comment 3 Nathan 2018-07-28 15:16:41 UTC
Also fails to build as it depends on nonexistent origins
Comment 4 Kai Knoblich freebsd_committer freebsd_triage 2018-07-28 19:33:50 UTC
(In reply to Nathan from comment #1)
(In reply to Nathan from comment #3)

It depends in which context you do apply the patch. If you do e.g.

> $ cd /path/to/your/ports/tree
> $ svn patch --dry-run ~/scancode-toolkit.patch textproc/

from the root of your svn tree, you should get a similar output like below:

> A         textproc/scancode-toolkit
> A         textproc/scancode-toolkit/Makefile
> A         textproc/scancode-toolkit/distinfo
> A         textproc/scancode-toolkit/files
> A         textproc/scancode-toolkit/files/patch-setup.py
> A         textproc/scancode-toolkit/files/patch-src_commoncode_system.py
> A         textproc/scancode-toolkit/pkg-descr

The same result you would get with:

> $ cd /path/to/your/ports/tree
> $ cd textproc
> $ svn patch --dry-run ~/scancode-toolkit.patch

The output would be:

> A         scancode-toolkit
> A         scancode-toolkit/Makefile
> A         scancode-toolkit/distinfo
> A         scancode-toolkit/files
> A         scancode-toolkit/files/patch-setup.py
> A         scancode-toolkit/files/patch-src_commoncode_system.py
> A         scancode-toolkit/pkg-descr

When applying your patch with the "corrected" paths the output will show some differences which yields into a non functional port that cannot be built:

> $ cd /path/to/your/ports/tree
> $ svn patch --dry-run ~/corrected_paths.patch textproc/
> A         textproc/textproc
> A         textproc/textproc/scancode-toolkit
> A         textproc/textproc/scancode-toolkit/Makefile
> A         textproc/scancode-toolkit
> A         textproc/scancode-toolkit/distinfo
> A         textproc/scancode-toolkit/files
> A         textproc/scancode-toolkit/files/patch-setup.py
> A         textproc/scancode-toolkit/files/patch-src_commoncode_system.py
> A         textproc/scancode-toolkit/pkg-descr

As for the info about the non-existent origins - have you updated your ports tree? Your ports tree needs to be at least at r475546 to have all the ports that are required to build textproc/scancode-toolkit successfully.
Comment 5 Nathan 2018-07-28 19:51:26 UTC
(In reply to Kai from comment #4)
> (In reply to Nathan from comment #1)
> (In reply to Nathan from comment #3)
> 
> It depends in which context you do apply the patch. If you do e.g.
> 
> > $ cd /path/to/your/ports/tree
> > $ svn patch --dry-run ~/scancode-toolkit.patch textproc/
> 
> from the root of your svn tree, you should get a similar output like below:
> 
> > A         textproc/scancode-toolkit
> > A         textproc/scancode-toolkit/Makefile
> > A         textproc/scancode-toolkit/distinfo
> > A         textproc/scancode-toolkit/files
> > A         textproc/scancode-toolkit/files/patch-setup.py
> > A         textproc/scancode-toolkit/files/patch-src_commoncode_system.py
> > A         textproc/scancode-toolkit/pkg-descr
> 
> The same result you would get with:
> 
> > $ cd /path/to/your/ports/tree
> > $ cd textproc
> > $ svn patch --dry-run ~/scancode-toolkit.patch
> 
> The output would be:
> 
> > A         scancode-toolkit
> > A         scancode-toolkit/Makefile
> > A         scancode-toolkit/distinfo
> > A         scancode-toolkit/files
> > A         scancode-toolkit/files/patch-setup.py
> > A         scancode-toolkit/files/patch-src_commoncode_system.py
> > A         scancode-toolkit/pkg-descr
> 
> When applying your patch with the "corrected" paths the output will show
> some differences which yields into a non functional port that cannot be
> built:
> 
> > $ cd /path/to/your/ports/tree
> > $ svn patch --dry-run ~/corrected_paths.patch textproc/
> > A         textproc/textproc
> > A         textproc/textproc/scancode-toolkit
> > A         textproc/textproc/scancode-toolkit/Makefile
> > A         textproc/scancode-toolkit
> > A         textproc/scancode-toolkit/distinfo
> > A         textproc/scancode-toolkit/files
> > A         textproc/scancode-toolkit/files/patch-setup.py
> > A         textproc/scancode-toolkit/files/patch-src_commoncode_system.py
> > A         textproc/scancode-toolkit/pkg-descr
> 
> As for the info about the non-existent origins - have you updated your ports
> tree? Your ports tree needs to be at least at r475546 to have all the ports
> that are required to build textproc/scancode-toolkit successfully.

https://www.freebsd.org/doc/en/books/porters-handbook/book.html#porting-submitting
Example 3.1. Creating a .diff for a New Port

Add all the files with svn add. cd to the base of the ports tree so full paths to the changed files are included in the diff, then generate the diff with svn diff. For example:

% svn add .
% cd ../..
% svn diff games/oneko > oneko.diff

Important:

To make it easier for committers to apply the patch on their working copy of the ports tree, please generate the .diff from the base of your ports tree.


Updated ports tree and finally seems it found deps needed
Comment 6 Kai Knoblich freebsd_committer freebsd_triage 2018-11-01 12:38:56 UTC
Created attachment 198850 [details]
scancode-toolkit-2.9.7.patch

Meanwhile scancode-toolkit was updated to 2.9.7 . The related review on phabricator will be also updated.

QA:
~~~
poudriere (11.2-RELEASE, 12.0-BETA2, 13.0-CURRENT@r339730 amd64 + i386) -> OK
portlint -> OK
Comment 7 Kai Knoblich freebsd_committer freebsd_triage 2018-11-01 13:26:36 UTC
Created attachment 198854 [details]
scancode-toolkit-2.9.7.patch
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-01-05 21:31:09 UTC
A commit references this bug:

Author: swills
Date: Sat Jan  5 21:30:55 UTC 2019
New revision: 489386
URL: https://svnweb.freebsd.org/changeset/ports/489386

Log:
  textproc/scancode-toolkit: create port

  ScanCode scans code and detects licenses, copyrights, package manifests,
  dependencies and more. It can be also used to discover and inventory open source
  and third-party packages used in your code.

  WWW: https://github.com/nexB/scancode-toolkit

  PR:		230114
  Submitted by:	Kai <freebsd_ports@k-worx.org>

Changes:
  head/textproc/Makefile
  head/textproc/scancode-toolkit/
  head/textproc/scancode-toolkit/Makefile
  head/textproc/scancode-toolkit/distinfo
  head/textproc/scancode-toolkit/files/
  head/textproc/scancode-toolkit/files/patch-setup.py
  head/textproc/scancode-toolkit/files/patch-src_commoncode_system.py
  head/textproc/scancode-toolkit/files/patch-src_extractcode_libarchive2.py
  head/textproc/scancode-toolkit/pkg-descr
Comment 9 Steve Wills freebsd_committer freebsd_triage 2019-01-05 21:32:27 UTC
Committed, thanks!