-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(copyright): SPDX copyright detection added #2276
Conversation
ef01b31
to
8841b06
Compare
cb042d3
to
8ab6b97
Compare
@rohitpandey49 Indeed there are empty space at the end of line in |
Additional note @rohitpandey49 , please check if the |
724edcd
to
26b1940
Compare
@GMishx Sir please check. |
This pull request has conflicts, please rebase with master to resolve those before we can evaluate the pull request. |
@rohitpandey49 : please rebase the branch with master and resolve the conflicts. |
26b1940
to
1fbdddc
Compare
ef617a0
to
f081ce7
Compare
@rohitpandey49 , changes looks good to me. Please add following changes to the code as well.
diff --git a/src/lib/php/Dao/CopyrightDao.php b/src/lib/php/Dao/CopyrightDao.php
index 95390cf2f..c833de25f 100644
--- a/src/lib/php/Dao/CopyrightDao.php
+++ b/src/lib/php/Dao/CopyrightDao.php
@@ -61,7 +61,7 @@ class CopyrightDao
$statementName = __METHOD__.$tableName;
$params = array($pFileId);
$addAgentValue = "";
- if (!empty($agentId) || $agentId[0] != 0) {
+ if (!empty($agentId) && $agentId[0] != 0) {
$agentIds = implode(",", $agentId);
$statementName .= '.agentId';
$addAgentValue = ' AND agent_fk= ANY($2::int[])';
diff --git a/src/reso/ui/ResoAgentPlugin.php b/src/reso/ui/ResoAgentPlugin.php
index 1b44d6b21..31a12fa04 100644
--- a/src/reso/ui/ResoAgentPlugin.php
+++ b/src/reso/ui/ResoAgentPlugin.php
@@ -38,7 +38,12 @@ class ResoAgentPlugin extends AgentPlugin
*/
public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=array(), $arguments=null)
{
+ $copyrightAgentScheduled = GetParm("Check_agent_copyright",
+ PARM_INTEGER) == 1;
$dependencies[] = "ojo";
+ if ($copyrightAgentScheduled) {
+ $dependencies[] = "copyright";
+ }
if ($this->AgentHasResults($uploadId) == 1) {
return 0;
} |
388def2
to
7361b31
Compare
@GMishx Sir, updated. Please check. |
Sorry @rohitpandey49 , I messed the dependency check. Can you please modify it like following? We can merge the PR after that. diff --git a/src/reso/ui/ResoAgentPlugin.php b/src/reso/ui/ResoAgentPlugin.php
index 279d6202b..714a3b809 100644
--- a/src/reso/ui/ResoAgentPlugin.php
+++ b/src/reso/ui/ResoAgentPlugin.php
@@ -39,9 +39,9 @@ class ResoAgentPlugin extends AgentPlugin
public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=array(), $arguments=null)
{
$copyrightAgentScheduled = GetParm("Check_agent_copyright", PARM_INTEGER) == 1;
- $dependencies[] = "ojo";
+ $dependencies[] = "agent_ojo";
if ($copyrightAgentScheduled) {
- $dependencies[] = "copyright";
+ $dependencies[] = "agent_copyright";
}
if ($this->AgentHasResults($uploadId) == 1) {
return 0;
@@ -52,7 +52,7 @@ class ResoAgentPlugin extends AgentPlugin
return $jobQueueId;
}
- return $this->doAgentAdd($jobId, $uploadId, $errorMsg, array("agent_ojo"),$uploadId);
+ return $this->doAgentAdd($jobId, $uploadId, $errorMsg, $dependencies, $uploadId);
}
/** |
Signed-off-by: rohitpandey49 <rohit.pandey4900@gmail.com>
7361b31
to
88025d5
Compare
@GMishx Sir updated. Please check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good. Tested, working as expected.
Signed-off-by: Rohit Pandey rohit.pandey4900@gmail.com
Description
As discussed in issue #1592 , implements a part of the REUSE.Software specification, by detecting the
SPDX-FileCopyrightText
keyword from .license suffixed files, and applying the copyright detected by the Copyright agent to the associated file.Changes
How to test
REUSE.Software Analysis
andCopyright
option.