Skip to content

Commit

Permalink
MBS-12977: Correctly specify the licenses of the JSON dumps
Browse files Browse the repository at this point in the history
We were claiming this is all CC0, but that is not correct.
The JSON dumps contain annotation, rating and tag data,
all of which is supplementary / CC-BY-NC-SA data.

Talked with mayhem and mwiencek about this, we agreed
that the right thing to do is to update the dump docs to specify
the right licenses rather than dropping the supplementary data,
since it can be useful and there's no great way to provide it separately
like on the MB dumps.
  • Loading branch information
reosarevok committed Mar 13, 2023
1 parent ceefb6c commit ffd62b6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lib/MusicBrainz/Script/JSONDump.pm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ sub create_json_dump {
local $MusicBrainz::Script::MBDump::readme_text = <<'EOF';
The file under mbdump/ contains one document (entity) per line, in JSON
format, and is named according to the type of entity in the dump.
EOF

my $copying_text = <<'EOF';
The content of this dump is licensed under the CC0 license
(see COPYING-PublicDomain), except for any data under keys "annotation",
"genres", "ratings" and "tags", which is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 license (see COPYING-CCShareAlike).
EOF

my $mbdump = MusicBrainz::Script::MBDump->new(
Expand All @@ -100,9 +107,16 @@ EOF
%mbdump_options,
);

$mbdump->write_file('COPYING', $copying_text);

$mbdump->copy_file(
catfile(DBDefs->MB_SERVER_ROOT, 'admin', 'COPYING-PublicDomain'),
'COPYING'
'COPYING-PublicDomain'
) or die $OS_ERROR;

$mbdump->copy_file(
catfile(DBDefs->MB_SERVER_ROOT, 'admin', 'COPYING-CCShareAlike'),
'COPYING-CCShareAlike'
) or die $OS_ERROR;

$mbdump->write_file('JSON_DUMPS_SCHEMA_NUMBER', "1\n");
Expand All @@ -114,7 +128,11 @@ EOF
if ($self->compression_enabled) {
$mbdump->make_tar(
"$dump_fname.tar.xz",
"mbdump/$dump_fname",
(
"mbdump/$dump_fname",
'COPYING-PublicDomain',
'COPYING-CCShareAlike',
),
'JSON_DUMPS_SCHEMA_NUMBER',
);
} else {
Expand Down
18 changes: 18 additions & 0 deletions t/script/DumpJSON.t
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,24 @@ test all => sub {
File::Spec->catfile($dir, $entity, 'JSON_DUMPS_SCHEMA_NUMBER'));
chomp $got;
is($got, '1');

$got = read_file(
File::Spec->catfile($dir, $entity, 'COPYING'));
chomp $got;
ok(
$got =~ 'see COPYING-CCShareAlike',
'The COPYING file refers users to the per-license COPYING files',
);

ok(
-f File::Spec->catfile($dir, $entity, 'COPYING-PublicDomain'),
'The COPYING-PublicDomain file is included in the bundle',
);

ok(
-f File::Spec->catfile($dir, $entity, 'COPYING-CCShareAlike'),
'The COPYING-CCShareAlike file is included in the bundle',
);
};

my $test_dumps_empty_except = sub {
Expand Down

0 comments on commit ffd62b6

Please sign in to comment.