diff options
Diffstat (limited to 'support/pkgcheck/src/messages')
-rw-r--r-- | support/pkgcheck/src/messages/errorsd.rs | 445 | ||||
-rw-r--r-- | support/pkgcheck/src/messages/fatald.rs | 66 | ||||
-rw-r--r-- | support/pkgcheck/src/messages/informationd.rs | 77 | ||||
-rw-r--r-- | support/pkgcheck/src/messages/mod.rs | 657 | ||||
-rw-r--r-- | support/pkgcheck/src/messages/warningsd.rs | 58 |
5 files changed, 1303 insertions, 0 deletions
diff --git a/support/pkgcheck/src/messages/errorsd.rs b/support/pkgcheck/src/messages/errorsd.rs new file mode 100644 index 0000000000..bd726754c0 --- /dev/null +++ b/support/pkgcheck/src/messages/errorsd.rs @@ -0,0 +1,445 @@ +// This file is generated by a Perl script. The source is +// in the docs/ directory of the repository. + +pub fn e0001d() { + println!( + r#" +E0001 -- Bad characters in file name + +File name should not contain non-ascii characters. Additionally, file +names should not contain control characters or other characters which +may have a special meaning for UNIX shells. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#nounixspecialcharacters +"# + ) +} + +pub fn e0002d() { + println!( + r#" +E0002 -- File Permissions + +Files submitted to CTAN should be world readable. + +Only files that are truly executable (like scripts and binaries) should +be marked as such. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#filepermissions +"# + ) +} + +pub fn e0003d() { + println!( + r#" +E0003 -- README is not a text file + +The README file specified in the error message must be a text file but +it isn't. +"# + ) +} + +pub fn e0004d() { + println!( + r#" +E0004 -- Empty directory not allowed + +Empty directories are considered as rubbish, and are usually not +accepted as part of a package. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noemptyfiles +"# + ) +} + +pub fn e0005d() { + println!( + r#" +E0005 -- Empty files not allowed + +Empty files are considered as rubbish, and are usually not accepted as +part of a package. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noemptyfiles +"# + ) +} + +pub fn e0006d() { + println!( + r#" +E0006 -- Hidden directories not allowed + +A package should not contain hidden directories. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noauxfiles +"# + ) +} + +pub fn e0007d() { + println!( + r#" +E0007 -- Hidden files not allowed + +A package should not contain hidden files. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noauxfiles +"# + ) +} + +pub fn e0008d() { + println!( + r#" +E0008 -- Temporary file detected + +A temporary file was detected. These are typically files created by TeX +& friends and should not be part of a package. + +Temporary files will also be detected in a TDS zip archive. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noauxfiles +"# + ) +} + +pub fn e0009d() { + println!( + r#" +E0009 -- Package doesn't contain a README file + +A package must contain at least one of README, README.md or README.txt +file. + +For more details refer to: +http://mirrors.ibiblio.org/CTAN/help/ctan/CTAN-upload-addendum.html#readme +"# + ) +} + +pub fn e0010d() { + println!( + r#" +E0010 -- Broken symlink detected + +A broken symlink was detected. +"# + ) +} + +pub fn e0011d() { + println!( + r#" +E0011 -- Wrong permission for directory + +Directories should have rwx for the owner and at least r-x for others +(i.e. world readable). + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#filepermissions +"# + ) +} + +pub fn e0012d() { + println!( + r#" +E0012 -- CRLF line endings detected + +The file specified in the error message contains CRLF line endings. Text +files should have UNIX style line endings. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#crlf +"# + ) +} + +pub fn e0013d() { + println!( + r#" +E0013 -- Socket special fie detected + +The file specified in the error message is a socket special file which +is not allowed. +"# + ) +} + +pub fn e0014d() { + println!( + r#" +E0014 -- Fifo special file detected + +The file specified in the error message is a fifo special file which is +not allowed. +"# + ) +} + +pub fn e0015d() { + println!( + r#" +E0015 -- Bloch device file detected + +The file specified in the error message is a block device file which is +not allowed. +"# + ) +} + +pub fn e0016d() { + println!( + r#" +E0016 -- Character device file detected + +The file specified in the error message is a character device file which +is not allowed. +"# + ) +} + +pub fn e0017d() { + println!( + r#" +E0017 -- PDF document is in error + +The PDF document mentioned in the message is in error. + +pdfinfo will be run to check if a PDF document can be read. Message +E0017 will be followed by the error messages from pdfinfo. + +Example: + + I0002 Checking package files in directory somepkg + E0017 PDF error detected in somepkg/sompkg.pdf + Syntax Error (1293042): Illegal character ')' + Syntax Error: Couldn't find trailer dictionary + Syntax Error (1293042): Illegal character ')' + Syntax Error: Couldn't find trailer dictionary + Syntax Error: Couldn't read xref table +"# + ) +} + +pub fn e0018d() { + println!( + r#" +E0018 -- Unwanted directory detected + +A directory was detected which should not be part of a package. Example: +__MACOSX +"# + ) +} + +pub fn e0019d() { + println!( + r#" +E0019 -- Generated file detected + +In order to avoid redundancy we don't want to have included files in a +package which easily can be generated from other files in the +submission. + +Exceptions are the README files of the package, i.e. README, README.md +or README.txt. + +Starting with version 1.1.0 pkgcheck also detects generated files if +they are in a different directory in the package. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#nogeneratedfiles +"# + ) +} + +pub fn e0020d() { + println!( + r#" +E0020 -- Unwanted directory detected in the top level directory in TDS zip archive + +A top level directory of a TDS archive should only contain all or some +of the following directories: + +- tex +- fonts +- metafont +- metapost +- bibtex +- scripts +- doc +- source +"# + ) +} + +pub fn e0021d() { + println!( + r#" +E0021 -- Error when reading a file + +An error was encountered when reading the file specified in the message. +"# + ) +} + +pub fn e0022d() { + println!( + r#" +E0022 -- Check of an URL in a README file failed + +URL checking is in effect. An error occcured when trying to retrieve an +URL which was found in the specified README file. +"# + ) +} + +pub fn e0023d() { + println!( + r#" +E0023 -- Follow up error when trying to read a directory with insufficient permissions + +Error which is a follow-up error. For instance, when a directory could +not be read. +"# + ) +} + +pub fn e0024d() { + println!( + r#" +E0024 -- TDS zip archive has wrong permissions + +The TDS zip archive should have at least r-- for the owner and at least +r-- for others (i.e. world readable). + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#filepermissions +"# + ) +} + +pub fn e0025d() { + println!( + r#" +E0025 -- Duplicate names when ignoring letter case for files or directories + +As there are operating systems which do not distinguish between myfile +and MYFILE we don't want to have file names in a directory which are the +same after converting to lower case. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#filenames +"# + ) +} + +pub fn e0026d() { + println!( + r#" +E0026 -- Files not in TDS or different in TDS and non-install tree + +The file mentioned in the error message is either not existing in the +TDS zip archive, or it is different to the one in the non-install tree +"# + ) +} + +pub fn e0027d() { + println!( + r#" +E0027 -- An I/O error occured + +Some kind of I/O error occured. If you believe there is an error in +pkgcheck please contact the author. +"# + ) +} + +pub fn e0028d() { + println!( + r#" +E0028 -- A path name in a TDS zip archive must contain the package name + +The path names in a TDS zip archive must contain the package name. + +EXAMPLE: Assume a package somepkg. Then path names should look like +follows: + + tex/latex/somepkg/somepkg.cls + doc/latex/somepkg/README + source/latex/somepkg/somepkg.dtx + ... +"# + ) +} + +pub fn e0029d() { + println!( + r#" +E0029 -- README file: encoding with BOM detected + +A README file should be either ASCII or UTF-8 without BOM(byte order +mark) + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#readme +"# + ) +} + +pub fn e0030d() { + println!( + r#" +E0030 -- A symlink was found which points outside of the package directory tree + +A symlink must not point to a file or directory outside of the package +directory tree. +"# + ) +} + +pub fn e0031d() { + println!( + r#" +E0031 -- File name contains invalid UTF-8 character(s) + +A file name contains invald UTF-8 character(s). +"# + ) +} + +pub fn e0033d() { + println!( + r#" +E0033 -- Error when unpacking tds archive + +In order to investigate the contents of the TDS zip archive pkgcheck +unpacks the TDS zip archive to a temporary location which failed for the +reason given in the error message. +"# + ) +} + +pub fn e0034d() { + println!( + r#" +E0034 -- Unwanted file detected in the top level directory in TDS zip archive + +A top level directory of a TDS archive should only contain certain +directories but no files. +"# + ) +} + diff --git a/support/pkgcheck/src/messages/fatald.rs b/support/pkgcheck/src/messages/fatald.rs new file mode 100644 index 0000000000..b41cab83b1 --- /dev/null +++ b/support/pkgcheck/src/messages/fatald.rs @@ -0,0 +1,66 @@ +// This file is generated by a Perl script. The source is +// in the docs/ directory of the repository. + +pub fn f0001d() { + println!( + r#" +F0001 -- Specify a directory to check (use option -d) + +pkgcheck was called without any options. Use option -d to check a +directory +"# + ) +} + +pub fn f0002d() { + println!( + r#" +F0002 -- Specified directory does not exist. Exiting... + +The directory specified at the command line does not exit. +"# + ) +} + +pub fn f0003d() { + println!( + r#" +F0003 -- Specified TDS archive does not exist or is no file + +Specify a valid TDS zip archive when calling pkgcheck +"# + ) +} + +pub fn f0004d() { + println!( + r#" +F0004 -- The file specified as TDS archive is no zip archive + +Specify a valid TDS zip archive when calling pkgcheck +"# + ) +} + +pub fn f0005d() { + println!( + r#" +F0005 -- Bad file name for the zip archive + +pkgcheck detected that the file name of the TDS zip archive doesn't end +with .tds.zip +"# + ) +} + +pub fn f0006d() { + println!( + r#" +F0006 -- Unknown error code specified with option -e resp. ---explain. Exiting... + +pkgcheck was called with option -e resp. --explain, and an unknown error +code was specified. +"# + ) +} + diff --git a/support/pkgcheck/src/messages/informationd.rs b/support/pkgcheck/src/messages/informationd.rs new file mode 100644 index 0000000000..d4e3ea43b3 --- /dev/null +++ b/support/pkgcheck/src/messages/informationd.rs @@ -0,0 +1,77 @@ +// This file is generated by a Perl script. The source is +// in the docs/ directory of the repository. + +pub fn i0001d() { + println!( + r#" +I0001 -- Successfully converted from CRLF to LF + +Just an information that pkgcheck has successfully converted a file from +CRLF to LF line endings +"# + ) +} + +pub fn i0002d() { + println!( + r#" +I0002 -- Checking package files in directory + +Just an information that pkgcheck starts checking the package files in +the unzipped directory trees +"# + ) +} + +pub fn i0003d() { + println!( + r#" +I0003 -- Checking TDS zip archive + +Just an information that pkgcheck starts checking the TDS zip archive +"# + ) +} + +pub fn i0004d() { + println!( + r#" +I0004 -- Correcting line endings for file + +The file had CRLF line ending and will be corrected to have LF (Unix +like) line endings. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#crlf +"# + ) +} + +pub fn i0005d() { + println!( + r#" +I0005 -- Corrections permissions for file or directory + +pkgcheck corrects wrong permsissions for package files and directories. +It runs the chmod command in verbose mode. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#filepermissions +"# + ) +} + +pub fn i0006d() { + println!( + r#" +I0006 -- Files having one of the following file name endings are regarded as temporary + +Option --show-temp-endings was used, and pkgcheck prints a list of +temporary file endings and their meanings. + +For more details refer to: +http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noauxfiles +"# + ) +} + diff --git a/support/pkgcheck/src/messages/mod.rs b/support/pkgcheck/src/messages/mod.rs new file mode 100644 index 0000000000..c63b6e2cec --- /dev/null +++ b/support/pkgcheck/src/messages/mod.rs @@ -0,0 +1,657 @@ +mod errorsd; +mod fatald; +mod informationd; +mod warningsd; + +use self::errorsd::*; +use self::fatald::*; +use self::informationd::*; +use self::warningsd::*; + +macro_rules! no_colors { + () => { + $crate::ARGS.no_colors + }; +} + +macro_rules! error_occured { + () => { + $crate::ERROR_OCCURED.store(true, Ordering::Relaxed); + }; +} +macro_rules! yellow { + ($fmt:expr) => { + if no_colors!() { + $fmt.clear() + } else { + $fmt.bright_yellow() + } + }; +} + +// macro_rules! red { +// ($fmt:expr) => { +// if no_colors!() { +// $fmt.clear() +// } else { +// $fmt.bright_red() +// } +// }; +// } + +macro_rules! msgid { + ($fmt:expr) => { + match (no_colors!(), &$fmt[..1]) { + (true, _) => $fmt.clear(), + (false, "E") => $fmt.bright_red().bold(), + (false, "I") => $fmt.bright_yellow(), + (false, "W") => $fmt.bright_red(), + (false, "F") => $fmt.bright_red().bold(), + (_, _) => $fmt.clear(), + } + }; +} + +macro_rules! f0001 { + () => { + error_occured!(); + print!( + "{} Specify a directory to check (use option -d)\n", + msgid!("F0001") + ); + }; +} + +macro_rules! f0002 { + ($fmt1:expr) => { + error_occured!(); + print!( + "{} Specified directory {} does not exist. Exiting...\n", + msgid!("F0002"), + $fmt1 + ); + }; +} + +macro_rules! f0003 { + ($fmt1:expr) => { + error_occured!(); + print!( + "{} Specified TDS archive {} does not exist or is no file. Exiting...\n", + msgid!("F0003"), + $fmt1 + ); + }; +} + +macro_rules! f0004 { + ($fmt1:expr) => { + error_occured!(); + print!( + "{} File {} specified as TDS archive is no zip archive. Exiting...\n", + msgid!("F0004"), + $fmt1 + ); + }; +} + +macro_rules! f0005 { + ($fmt1:expr) => { + error_occured!(); + print!( + "{} Bad filename {} for the tds.zip archive. Exiting...\n", + msgid!("F0005"), + $fmt1 + ); + }; +} + +// macro_rules! f0006 { +// ($fmt1:expr) => { +// error_occured!(); +// print!( +// "{} Unknown error code `{}` specified with option -e resp. ---explain. Exiting...\n", +// msgid!("F0006"), +// $fmt1 +// ); +// }; +// } + +macro_rules! e0001 { + ($fmt1:expr, $fmt2:expr, $fmt3:expr) => { + error_occured!(); + print!( + "{} Bad character {} ({:#02x}) found in file name {} at offset {}\n", + msgid!("E0001"), + $fmt1, + $fmt1 as usize, + $fmt2, + $fmt3 + ); + }; +} + +macro_rules! e0002 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} File {} has bad permissions: {}\n", + msgid!("E0002"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0003 { + ($fmt:expr) => { + error_occured!(); + print!("{} {} is no text file\n", msgid!("E0003"), $fmt); + }; +} + +macro_rules! e0004 { + ($fmt:expr) => { + error_occured!(); + print!("{} Empty directory {} detected\n", msgid!("E0004"), $fmt); + }; +} + +macro_rules! e0005 { + ($fmt:expr) => { + error_occured!(); + print!("{} Empty file {} detected\n", msgid!("E0005"), $fmt); + }; +} + +macro_rules! e0006 { + ($fmt:expr) => { + error_occured!(); + print!("{} Hidden directory {} detected\n", msgid!("E0006"), $fmt); + }; +} + +macro_rules! e0007 { + ($fmt:expr) => { + error_occured!(); + print!("{} Hidden file {} detected\n", msgid!("E0007"), $fmt); + }; +} + +macro_rules! e0008 { + ($fmt:expr) => { + error_occured!(); + print!("{} Temporary file {} detected\n", msgid!("E0008"), $fmt); + }; +} + +macro_rules! e0009 { + () => { + error_occured!(); + print!( + "{} One of README/README.md/README.txt must exist\n", + msgid!("E0009") + ); + }; +} + +macro_rules! e0010 { + ($fmt:expr) => { + error_occured!(); + print!("{} {} is a broken symlink\n", msgid!("E0010"), $fmt); + }; +} + +macro_rules! e0011 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} Directory {} has bad permissions: {}\n", + msgid!("E0011"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0012 { + ($fmt:expr) => { + error_occured!(); + print!("{} CRLF detected: {}\n", msgid!("E0012"), $fmt); + }; +} + +macro_rules! e0013 { + ($fmt:expr) => { + error_occured!(); + print!("{} {} is a socket special file\n", msgid!("E0013"), $fmt); + }; +} + +macro_rules! e0014 { + ($fmt:expr) => { + error_occured!(); + print!("{} {} is a fifo file\n", msgid!("E0014"), $fmt); + }; +} + +macro_rules! e0015 { + ($fmt:expr) => { + error_occured!(); + print!("{} {} is a block device file\n", msgid!("E0015"), $fmt); + }; +} + +macro_rules! e0016 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} {} is a character device file\n", + msgid!("E0016"), + $fmt + ); + }; +} + +macro_rules! e0017 { + ($fmt:expr) => { + error_occured!(); + print!("{} PDF error detected in {}\n", msgid!("E0017"), $fmt); + }; +} + +macro_rules! e0018 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} Unwanted directory {} detected\n", + msgid!("E0018"), + $fmt + ); + }; +} + +macro_rules! e0019 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} {} generated by {} exists\n", + msgid!("E0019"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0020 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} Unwanted directory `{}` detected in the top level directory of a TDS archive\n", + msgid!("E0020"), + $fmt + ); + }; +} + +macro_rules! e0021 { + ($fmt1:expr, $fmt2:expr, $fmt3:expr) => { + error_occured!(); + print!( + "{} File {} : Error reading in line {}: {}\n", + msgid!("E0021"), + $fmt1, + $fmt2, + $fmt3 + ); + }; +} + +macro_rules! e0022 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!("{} {}: `{}`\n", msgid!("E0022"), $fmt1, $fmt2); + }; +} + +macro_rules! e0023 { + ($fmt:expr) => { + error_occured!(); + print!("{} {}\n", msgid!("E0023"), $fmt); + }; +} + +macro_rules! e0024 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} The TDS zip archive {} has bad permissions: {}\n", + msgid!("E0024"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0025 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} Duplicate names when ignoring letter case for: {}\n", + msgid!("E0025"), + $fmt + ); + }; +} + +macro_rules! e0026 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} {} : file not in TDS or different in TDS and non-install tree\n", + msgid!("E0026"), + $fmt + ); + }; +} + +macro_rules! e0027 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} {}: An I/O error occured -> {}\n", + msgid!("E0027"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0028 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} No directory {} (= package name) found in path {}\n", + msgid!("E0028"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0029 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} {}: {} encoding with BOM detected\n", + msgid!("E0029"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0030 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} Symlink {} points to {} which is outside of the package directory tree\n", + msgid!("E0030"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! e0031 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} File name {} contains invalid UTF-8 character(s)\n", + msgid!("E0031"), + $fmt + ); + }; +} + +macro_rules! e0033 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} Error `{}` when unpacking tds archive {}. Exiting...\n", + msgid!("E0033"), + $fmt2, + $fmt1 + ); + }; +} + +macro_rules! e0034 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} Unwanted file `{}` detected in the top level directory of a TDS archive\n", + msgid!("E0034"), + $fmt + ); + }; +} + +macro_rules! w0001 { + ($fmt:expr) => { + print!( + "{} Archive as package file detected: {}\n", + msgid!("W0001"), + $fmt + ); + }; +} + +macro_rules! w0002 { + () => { + print!("{} Duplicate files detected\n", msgid!("W0002"),); + }; +} + +macro_rules! w0003 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} Same named files detected in the package directory tree: {}\n", + msgid!("W0003"), + $fmt + ); + }; +} + +macro_rules! w0004 { + ($fmt1:expr, $fmt2:expr) => { + error_occured!(); + print!( + "{} {}: {} encoding with BOM detected\n", + msgid!("W0004"), + $fmt1, + $fmt2 + ); + }; +} + +macro_rules! i0002 { + ($fmt:expr) => { + print!( + "{} {} {}\n", + msgid!("I0002"), + yellow!("Checking package files in directory"), + yellow!($fmt) + ); + }; +} + +macro_rules! i0003 { + ($fmt:expr) => { + print!( + "{} {} {}\n", + msgid!("I0003"), + yellow!("Checking TDS zip archive"), + yellow!($fmt) + ); + }; +} + +macro_rules! i0004 { + ($fmt:expr) => { + print!( + "{} Correcting line endings for file {}\n", + msgid!("I0004"), + $fmt + ); + }; +} + +macro_rules! i0005 { + ($fmt:expr) => { + print!( + "{} Correcting permissions for {}\n", + msgid!("I0005"), + $fmt + ); + }; +} + +macro_rules! i0006 { + () => { + print!( + "{} Files having one of the following file name endings are regarded as temporary\n", + msgid!("I0006") + ); + }; +} + +macro_rules! i0007 { + ($fmt:expr) => { + print!( + "{} {}: Successfully converted from CRLF to LF\n", + msgid!("I0007"), + $fmt + ); + }; +} + +pub fn explains(err: &str) { + let err_upp = err.to_ascii_uppercase(); + match err_upp.as_str() { + "F0001" => f0001d(), + "F0002" => f0002d(), + "F0003" => f0003d(), + "F0004" => f0004d(), + "F0005" => f0005d(), + "F0006" => f0006d(), + + "E0001" => e0001d(), + "E0002" => e0002d(), + "E0003" => e0003d(), + "E0004" => e0004d(), + "E0005" => e0005d(), + "E0006" => e0006d(), + "E0007" => e0007d(), + "E0008" => e0008d(), + "E0009" => e0009d(), + "E0010" => e0010d(), + "E0011" => e0011d(), + "E0012" => e0012d(), + "E0013" => e0013d(), + "E0014" => e0014d(), + "E0015" => e0015d(), + "E0016" => e0016d(), + "E0017" => e0017d(), + "E0018" => e0018d(), + "E0019" => e0019d(), + "E0020" => e0020d(), + "E0021" => e0021d(), + "E0022" => e0022d(), + "E0023" => e0023d(), + "E0024" => e0024d(), + "E0025" => e0025d(), + "E0026" => e0026d(), + "E0027" => e0027d(), + "E0028" => e0028d(), + "E0029" => e0029d(), + "E0030" => e0030d(), + "E0031" => e0031d(), + "E0033" => e0033d(), + "E0034" => e0034d(), + + // "I0001" => i0001d!(), + "I0001" => i0001d(), + "I0002" => i0002d(), + "I0003" => i0003d(), + "I0004" => i0004d(), + "I0005" => i0005d(), + "I0006" => i0006d(), + + "W0001" => w0001d(), + "W0002" => w0002d(), + "W0003" => w0003d(), + "W0004" => w0004d(), + + e => println!( + "F0006 Unknown error code `{}` specified with option -e resp. --explain. Exiting...", + e + ), + } +} + +pub fn explains_all() { + explains("F0001"); + explains("F0002"); + explains("F0003"); + explains("F0004"); + explains("F0005"); + explains("F0006"); + + explains("E0001"); + explains("E0002"); + explains("E0003"); + explains("E0004"); + explains("E0005"); + explains("E0006"); + explains("E0007"); + explains("E0008"); + explains("E0009"); + explains("E0010"); + explains("E0011"); + explains("E0012"); + explains("E0013"); + explains("E0014"); + explains("E0015"); + explains("E0016"); + explains("E0017"); + explains("E0018"); + explains("E0019"); + explains("E0020"); + explains("E0021"); + explains("E0022"); + explains("E0023"); + explains("E0024"); + explains("E0025"); + explains("E0026"); + explains("E0027"); + explains("E0028"); + explains("E0029"); + explains("E0030"); + explains("E0031"); + explains("E0033"); + explains("E0034"); + + explains("I0001"); + explains("I0002"); + explains("I0003"); + explains("I0004"); + explains("I0005"); + explains("I0006"); + + explains("W0001"); + explains("W0002"); + explains("W0003"); + explains("W0004"); +} diff --git a/support/pkgcheck/src/messages/warningsd.rs b/support/pkgcheck/src/messages/warningsd.rs new file mode 100644 index 0000000000..588144968d --- /dev/null +++ b/support/pkgcheck/src/messages/warningsd.rs @@ -0,0 +1,58 @@ +// This file is generated by a Perl script. The source is +// in the docs/ directory of the repository. + +pub fn w0001d() { + println!( + r#" +W0001 -- Archive as package file detected + +Usually a CTAN package should not contain archives. An exception are +situations where, for example, the source code of a package is kept in a +separate zip archive. +"# + ) +} + +pub fn w0002d() { + println!( + r#" +W0002 -- Duplicate files detected + +Duplicate files were detected which are listed right after this message. + +The message is a warning message as something like this could not be +seen as an error in general. +"# + ) +} + +pub fn w0003d() { + println!( + r#" +W0003 -- Same named files detected in the package tree + +We like to have unique file names over the whole package directory tree. +When we discover same named files we report it as a warning. Common +names like README, README.txt, README.md, Makefile, Makefile.in, +Makefile.am and makefile are ignored when checking. + +For more details refer to: +http://mirror.utexas.edu/ctan/help/ctan/CTAN-upload-addendum.html#uniquefilenames +"# + ) +} + +pub fn w0004d() { + println!( + r#" +W0004 -- encoding with BOM detected + +A UTF encoded package file contains a BOM (byte order mark). Currently, +we issues a warning. + +Nevertheless, the CTAN team discourages uses of BOM. Please be aware, +that in some future time this could be reagarded as an error. +"# + ) +} + |