Skip to content

Commit ffd62b6

Browse files
committed
MBS-12977: Correctly specify the licenses of the JSON dumps
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.
1 parent ceefb6c commit ffd62b6

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

lib/MusicBrainz/Script/JSONDump.pm

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ sub create_json_dump {
9191
local $MusicBrainz::Script::MBDump::readme_text = <<'EOF';
9292
The file under mbdump/ contains one document (entity) per line, in JSON
9393
format, and is named according to the type of entity in the dump.
94+
EOF
95+
96+
my $copying_text = <<'EOF';
97+
The content of this dump is licensed under the CC0 license
98+
(see COPYING-PublicDomain), except for any data under keys "annotation",
99+
"genres", "ratings" and "tags", which is licensed under a Creative Commons
100+
Attribution-NonCommercial-ShareAlike 3.0 license (see COPYING-CCShareAlike).
94101
EOF
95102

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

110+
$mbdump->write_file('COPYING', $copying_text);
111+
103112
$mbdump->copy_file(
104113
catfile(DBDefs->MB_SERVER_ROOT, 'admin', 'COPYING-PublicDomain'),
105-
'COPYING'
114+
'COPYING-PublicDomain'
115+
) or die $OS_ERROR;
116+
117+
$mbdump->copy_file(
118+
catfile(DBDefs->MB_SERVER_ROOT, 'admin', 'COPYING-CCShareAlike'),
119+
'COPYING-CCShareAlike'
106120
) or die $OS_ERROR;
107121

108122
$mbdump->write_file('JSON_DUMPS_SCHEMA_NUMBER', "1\n");
@@ -114,7 +128,11 @@ EOF
114128
if ($self->compression_enabled) {
115129
$mbdump->make_tar(
116130
"$dump_fname.tar.xz",
117-
"mbdump/$dump_fname",
131+
(
132+
"mbdump/$dump_fname",
133+
'COPYING-PublicDomain',
134+
'COPYING-CCShareAlike',
135+
),
118136
'JSON_DUMPS_SCHEMA_NUMBER',
119137
);
120138
} else {

t/script/DumpJSON.t

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ test all => sub {
127127
File::Spec->catfile($dir, $entity, 'JSON_DUMPS_SCHEMA_NUMBER'));
128128
chomp $got;
129129
is($got, '1');
130+
131+
$got = read_file(
132+
File::Spec->catfile($dir, $entity, 'COPYING'));
133+
chomp $got;
134+
ok(
135+
$got =~ 'see COPYING-CCShareAlike',
136+
'The COPYING file refers users to the per-license COPYING files',
137+
);
138+
139+
ok(
140+
-f File::Spec->catfile($dir, $entity, 'COPYING-PublicDomain'),
141+
'The COPYING-PublicDomain file is included in the bundle',
142+
);
143+
144+
ok(
145+
-f File::Spec->catfile($dir, $entity, 'COPYING-CCShareAlike'),
146+
'The COPYING-CCShareAlike file is included in the bundle',
147+
);
130148
};
131149

132150
my $test_dumps_empty_except = sub {

0 commit comments

Comments
 (0)