protected against distributing file with non-LGPL3 content

This commit is contained in:
FeralChild64 committed 2020-09-27 16:57:39 +02:00
1 parent 5704a8d4cd
commit ff98d2c5c2
4 files changed
+28 -15

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
;; #LAYOUT# M65 BASIC_1 #TAKE
;; #LAYOUT# * * #IGNORE
!ifdef HAS_NOLGPL3_WARN {
str_nonlgpl3_warn:
!byte $0D, $0D, $0D, $0D
!pet "build contains non-lgpl3 code"
!byte $0D
!pet " *** do not distribute ***"
!byte $0D, $0D, $00
}
-13
View File
@@ -108,16 +108,3 @@ INITMSG_revision:
lda #<rom_revision_basic_string
ldy #>rom_revision_basic_string
jmp STROUT
!ifdef HAS_NOLGPL3_WARN {
str_nonlgpl3_warn:
!byte $0D, $0D, $0D, $0D
!pet "build contains non-lgpl3 code"
!byte $0D
!pet " *** do not distribute ***"
!byte $0D, $0D, $00
}
+1 -1
View File
@@ -107,4 +107,4 @@ initmsg_real:
}
!ifdef HAS_NOLGPL3_WARN { !error "HAS_NOLGPL3_WARN not implemented"
!ifdef HAS_NOLGPL3_WARN { !error "HAS_NOLGPL3_WARN not implemented" }
+12 -1
View File
@@ -70,7 +70,8 @@ const std::vector<uint8_t> STR_SNAPSHOT = { 0x28, 0x44, 0x45, 0x56, 0x45, 0x4C,
0x00 };
const std::vector<uint8_t> STR_DOSDATE = { 0x4F, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58 };
const std::string STR_DEV = "DEV.";
const std::string STR_DEV = "DEV.";
const std::string STR_BLOCK = "DO NOT DISTRIBUTE";
//
// Command and enviroment line settings
@@ -357,6 +358,16 @@ void ROMFile::readSrcFile()
if (!srcFile.good()) ERROR(std::string("unable to read ROM file '") + srcFileNamePath + "'");
srcFile.close();
// Check if it is OK to distribute the file
for (size_t idx = 0; idx < srcFileContent.size() - STR_BLOCK.size(); idx++)
{
if (memcmp(&srcFileContent[idx], STR_BLOCK.c_str(), STR_BLOCK.size()) == 0)
{
ERROR(std::string("not allowed to distribute ROM file '") + srcFileNamePath + "'");
}
}
}
void ROMFile::readDstFile()