Skip to content
Snippets Groups Projects
Commit 6614794d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Better support for CD-ROM filenaming (no dashes in ISO 9660 filenames!)

Though the FILES.BBS might have filenames with dashes, the filenames actually
have underscores. Consider converting any other valid DOS filename characters
that are not allowed in ISO 9660 filenames as well (but to what?).

More logging of missing and renamed files (e.g. fixed case, dashes replaced
with underscores).
parent 201a19ff
Branches
Tags
1 merge request!455Update branch with changes from master
Pipeline #6395 passed
...@@ -151,6 +151,8 @@ if(!dir_list.length) { ...@@ -151,6 +151,8 @@ if(!dir_list.length) {
var added = 0; var added = 0;
var updated = 0; var updated = 0;
var renamed = 0;
var missing = [];
for(var d = 0; d < dir_list.length; d++) { for(var d = 0; d < dir_list.length; d++) {
var code = dir_list[d]; var code = dir_list[d];
...@@ -231,10 +233,18 @@ for(var d = 0; d < dir_list.length; d++) { ...@@ -231,10 +233,18 @@ for(var d = 0; d < dir_list.length; d++) {
} }
var path = file_area.dir[code].path + file.name; var path = file_area.dir[code].path + file.name;
var realpath = file_getcase(path); var realpath = file_getcase(path);
if(!realpath) {
realpath = file_getcase(path.replace(/-/g, "_"));
if(!realpath) { if(!realpath) {
alert("does not exist: " + path); alert("does not exist: " + path);
missing.push(path);
continue; continue;
} }
}
if(file.name != file_getname(realpath)) {
print("Renamed " + file.name + " to " + file_getname(realpath));
++renamed;
}
path = realpath; path = realpath;
file.name = file_getname(path); file.name = file_getname(path);
if(options.date) if(options.date)
...@@ -282,6 +292,15 @@ for(var d = 0; d < dir_list.length; d++) { ...@@ -282,6 +292,15 @@ for(var d = 0; d < dir_list.length; d++) {
writeln(added + " files added"); writeln(added + " files added");
if(updated) if(updated)
writeln(updated + " files updated"); writeln(updated + " files updated");
if(renamed)
writeln(renamed + " files renamed");
if(missing.length) {
alert(missing.length + " files missing");
if(verbosity) {
for(var i in missing)
alert(missing[i]);
}
}
// Parse a FILES.BBS (or similar) file listing file // Parse a FILES.BBS (or similar) file listing file
// Note: file descriptions must begin with an alphabetic character // Note: file descriptions must begin with an alphabetic character
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment