Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3ee22e9
feat(copyright): allow to have multiple copyright decisions
maxhbr Sep 12, 2017
b7bd5b6
feat(spdx2Import): inital commit
maxhbr Mar 22, 2016
26bff73
feat(spdx2Import): also import copyright statements
maxhbr Apr 13, 2016
9e68781
feat(spdx2Import): conclusions
maxhbr Apr 13, 2016
26c4187
feat(spdx2Import): compare only by sha1
maxhbr Apr 15, 2016
bd20cc7
feat(spdx2Import): start to make conclusions optional
maxhbr Apr 14, 2016
3d469b2
feat(spdx2Import): menu entry at "Upload::..."
maxhbr Aug 21, 2016
0bc8788
feat(spdx2Import): refactoring and splitup of files
maxhbr Jul 13, 2017
fa56a96
feat(spdx2Import): splitup to support other formats
maxhbr Aug 1, 2017
9cdf1d6
refactor(reportImport): spdx2Import -> reportImport
maxhbr Aug 3, 2017
3f95181
feat(reportImport): handle all arguments from UI
maxhbr Aug 7, 2017
0d46873
feat(reportImport): add option to create real licenses
maxhbr Aug 11, 2017
0fdba11
feat(spdx2): also export ninka and import data
maxhbr Aug 11, 2017
74f6241
feat(reportImport): parse also xml files
maxhbr Aug 14, 2017
10a2a82
feat(reportImport): minor improvements
maxhbr Aug 16, 2017
09b90a2
feat(reportImport): minor changes to satisfy older PHP versions
maxhbr Aug 18, 2017
5fdb4ce
feat(reportImport): add corresponding debain definitions
maxhbr Aug 22, 2017
f5e65fb
fix(reportImport): fix bug in reportImport, refactor file matching
maxhbr Sep 4, 2017
e268d89
chore(gitignore): add more entries to the blacklist
maxhbr Sep 26, 2017
025c4fe
feat(reportImport): add imported coyprights as decisions
maxhbr Sep 26, 2017
cb24345
feat(reportImport): handle `orLaterOperator` correctly
maxhbr Sep 27, 2017
05a3061
feat(reportImport): some cleanup and minor improvements
maxhbr Oct 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ VERSION
*~
/src/vendor
.vagrant/
*.orig
.#*

# compiled or derived files
install/db/dbcreate
Expand Down Expand Up @@ -127,9 +129,12 @@ variable.list
/src/copyright/agent/ecc
/src/copyright/VERSION-ecc
/src/copyright/VERSION-copyright
/src/spdx2/agent_tests/Functional/spdx-tools-2.0.2-jar-with-dependencies.jar
/src/spdx2/agent_tests/Functional/spdx-tools-2.0.2-jar-with-dependencies.jar*
/src/spdx2/agent/version.php
/src/spdx2/agent/spdx2
src/reportImport/agent/spdx2Import
src/reportImport/agent/version.php
src/reportImport/agent/reportImport
/src/ninka/agent_tests/Functional/ninka
/src/ninka/agent_tests/Unit/test_ninka
/src/ninka/agent/ninka
Expand Down
14 changes: 13 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Description: architecture for analyzing software, development utils
Package: fossology
Architecture: any
Depends: fossology-web, fossology-scheduler, fossology-ununpack, fossology-copyright, fossology-buckets, fossology-mimetype, fossology-delagent, fossology-wgetagent, ${misc:Depends}
Recommends: fossology-monk, fossology-monkbulk, fossology-decider, fossology-readmeoss, fossology-spdx2, fossology-reuser, fossology-ninka
Recommends: fossology-monk, fossology-monkbulk, fossology-decider, fossology-readmeoss, fossology-spdx2, fossology-reportimport, fossology-reuser, fossology-ninka
Conflicts: fossology-db (<= 1.4.1), fossology-common (<= 1.4.1)
Description: open and modular architecture for analyzing software
The FOSSology project is a web based framework that allows you to
Expand Down Expand Up @@ -295,3 +295,15 @@ Description: architecture for analyzing software, SPDX v2.0 generator
type identification.
.
This package contains the spdx2 agent programs and their resources.

Package: fossology-reportimport
Architecture: any
Depends: fossology-common, ${misc:Depends}
Description: architecture for analyzing software, report importer
The FOSSology project is a web based framework that allows you to
upload software to be picked apart and then analyzed by software agents
which produce results that are then browsable via the web interface.
Existing agents include license analysis, metadata extraction, and MIME
type identification.
.
This package contains the reportImport agent programs and their resources.
6 changes: 5 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ install-arch:
$(MAKE) DESTDIR=$(CURDIR)/debian/fossology-readmeoss \
PREFIX=/usr SYSCONFDIR=/etc/fossology LOCALSTATEDIR=/var \
-C src/readmeoss install

$(MAKE) DESTDIR=$(CURDIR)/debian/fossology-reuser \
PREFIX=/usr SYSCONFDIR=/etc/fossology LOCALSTATEDIR=/var \
-C src/reuser install
Expand All @@ -166,6 +166,10 @@ install-arch:
PREFIX=/usr SYSCONFDIR=/etc/fossology LOCALSTATEDIR=/var \
-C src/spdx2 install

$(MAKE) DESTDIR=$(CURDIR)/debian/fossology-reportimport \
PREFIX=/usr SYSCONFDIR=/etc/fossology LOCALSTATEDIR=/var \
-C src/reportImport install

mkdir -p $(CURDIR)/debian/fossology-dev/usr/bin
cp $(shell which composer) $(CURDIR)/debian/fossology-dev/usr/bin
mkdir -p $(CURDIR)/debian/fossology-dev/usr/share/fossology/
Expand Down
2 changes: 2 additions & 0 deletions install/db/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ install: all
$(INSTALL_DATA) sanity_check.php $(DESTDIR)$(LIBEXECDIR)/sanity_check.php
$(INSTALL_DATA) fo_mapping_license.php $(DESTDIR)$(LIBEXECDIR)/fo_mapping_license.php
$(INSTALL_DATA) dbmigrate_copyright-author.php $(DESTDIR)$(LIBEXECDIR)/dbmigrate_copyright-author.php
$(INSTALL_DATA) dbmigrate_multiple_copyright_decisions.php $(DESTDIR)$(LIBEXECDIR)/dbmigrate_multiple_copyright_decisions.php

$(INSTALL_PROGRAM) export_license_ref.php $(DESTDIR)$(LIBEXECDIR)/export_license_ref.php
$(INSTALL_PROGRAM) dbcreate $(DESTDIR)$(LIBEXECDIR)/dbcreate
Expand Down Expand Up @@ -55,6 +56,7 @@ uninstall:
rm -f $(DESTDIR)$(LIBEXECDIR)/export_license_ref.php
rm -f $(DESTDIR)$(LIBEXECDIR)/fo_mapping_license.php
rm -f $(DESTDIR)$(LIBEXECDIR)/dbmigrate_copyright-author.php
rm -f $(DESTDIR)$(LIBEXECDIR)/dbmigrate_multiple_copyright_decisions.php

@if [ -d $(DESTDIR)$(LIBEXECDIR) ]; then \
if [ "`ls -A $(DESTDIR)$(LIBEXECDIR)`" ]; then \
Expand Down
51 changes: 51 additions & 0 deletions install/db/dbmigrate_multiple_copyright_decisions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/***********************************************************
Copyright (C) 2017 Siemens AG

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
***********************************************************/


/**
* \brief add a new column `is_enabled` to decisions
* this is by default false except for the most recent decision which is active
*/

function addBooleanColumnTo($dbManager, $tableName, $columnName = 'is_enabled')
{
echo "Migrate: Add and setup column=$columnName to table=$tableName\n";
if (! $dbManager->existsColumn($tableName, $columnName))
{
$dbManager->queryOnce("ALTER TABLE $tableName
ADD COLUMN $columnName BOOLEAN;");
}

$dbManager->queryOnce("UPDATE $tableName
SET $columnName = copyright_decision_pk IN
(SELECT MAX(copyright_decision_pk) AS enabled_pk
FROM $tableName
GROUP BY pfile_fk);");
$dbManager->queryOnce("ALTER TABLE $tableName
ALTER COLUMN $columnName
SET NOT NULL;");
$dbManager->queryOnce("ALTER TABLE $tableName
ALTER COLUMN $columnName
SET DEFAULT TRUE;");
}

foreach (array('copyright','ecc') as $name)
{
/* @var $dbManager DbManager */
addBooleanColumnTo($dbManager, $name.'_decision');
}
17 changes: 12 additions & 5 deletions install/fossinit.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function explainUsage()
}

/* initialize the license_ref table */
if ($UpdateLiceneseRef)
if ($UpdateLiceneseRef)
{
$row = $dbManager->getSingleRow("SELECT count(*) FROM license_ref",array(),'license_ref.count');
if ($row['count'] > 0) {
Expand Down Expand Up @@ -337,6 +337,13 @@ function explainUsage()
$sysconfig['Release'] = "3.0.2";
}

if($isUpdating && (empty($sysconfig['Release']) || $sysconfig['Release'] == '3.0.2'))
{
require_once("$LIBEXECDIR/dbmigrate_multiple_copyright_decisions.php");

$sysconfig['Release'] = "3.1.0";
}

$dbManager->begin();
$dbManager->getSingleRow("DELETE FROM sysconfig WHERE variablename=$1",array('Release'),$sqlLog='drop.sysconfig.release');
$dbManager->insertTableRow('sysconfig',
Expand Down Expand Up @@ -378,20 +385,20 @@ function initLicenseRefTable($Verbose)
print "FATAL: Unable to access '$LIBEXECDIR'.\n";
return (1);
}

$dbManager->queryOnce("BEGIN");
$dbManager->queryOnce("DROP TABLE IF EXISTS license_ref_2",$stmt=__METHOD__.'.dropAncientBackUp');
/* create a new temp table structure only - license_ref_2 */
$dbManager->queryOnce("CREATE TABLE license_ref_2 as select * from license_ref WHERE 1=2",$stmt=__METHOD__.'.backUpData');

/** import licenseref.sql */
/** import licenseref.sql */
$sqlstmts = file_get_contents("$LIBEXECDIR/licenseref.sql");
$sqlstmts = str_replace("license_ref","license_ref_2", $sqlstmts);
$dbManager->queryOnce($sqlstmts);

$dbManager->prepare(__METHOD__.".newLic", "select * from license_ref_2");
$result_new = $dbManager->execute(__METHOD__.".newLic");

$dbManager->prepare(__METHOD__.'.licenseRefByShortname','SELECT * from license_ref where rf_shortname=$1');
/** traverse all records in user's license_ref table, update or insert */
while ($row = pg_fetch_assoc($result_new))
Expand Down
2 changes: 1 addition & 1 deletion install/scripts/install-spdx-tools.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

wget https://github.com/spdx/tools/releases/download/V2.0.2/spdx-tools-2.0.2-jar-with-dependencies.jar -P $(dirname $0)/../../src/spdx2/agent_tests/Functional/
wget -nc https://github.com/spdx/tools/releases/download/V2.0.2/spdx-tools-2.0.2-jar-with-dependencies.jar -P $(dirname $0)/../../src/spdx2/agent_tests/Functional/
1 change: 1 addition & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ DIRS = \
reuser \
scheduler \
spdx2 \
reportImport \
ununpack \
wget_agent \
www
Expand Down
3 changes: 2 additions & 1 deletion src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"symfony/http-foundation": "2.6.*",
"symfony/dependency-injection": "2.6.*",
"twig/twig": "1.*",
"twig/extensions": "1.*"
"twig/extensions": "1.*",
"easyrdf/easyrdf": "0.9.*"
},

"require-dev": {
Expand Down
Loading