summaryrefslogtreecommitdiff
path: root/support/pkgcheck/src/messages
diff options
context:
space:
mode:
Diffstat (limited to 'support/pkgcheck/src/messages')
-rw-r--r--support/pkgcheck/src/messages/errorsd.rs68
-rw-r--r--support/pkgcheck/src/messages/fatald.rs10
-rw-r--r--support/pkgcheck/src/messages/informationd.rs13
-rw-r--r--support/pkgcheck/src/messages/mod.rs113
-rw-r--r--support/pkgcheck/src/messages/warningsd.rs28
5 files changed, 192 insertions, 40 deletions
diff --git a/support/pkgcheck/src/messages/errorsd.rs b/support/pkgcheck/src/messages/errorsd.rs
index f839f5538b..09c2f4cc53 100644
--- a/support/pkgcheck/src/messages/errorsd.rs
+++ b/support/pkgcheck/src/messages/errorsd.rs
@@ -49,7 +49,8 @@ pub fn e0004d() {
E0004 -- Empty directory not allowed
Empty directories are considered as rubbish, and are usually not
-accepted as part of a package.
+accepted as part of a package, neither in the package tree nor in the
+TDS zip archive.
For more details refer to:
http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noemptyfiles
@@ -76,7 +77,8 @@ pub fn e0006d() {
r#"
E0006 -- Hidden directories not allowed
-A package should not contain hidden directories.
+A package should not contain hidden directories, neither in the package
+tree nor in the TDS zip archive.
For more details refer to:
http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noauxfiles
@@ -89,7 +91,8 @@ pub fn e0007d() {
r#"
E0007 -- Hidden files not allowed
-A package should not contain hidden files.
+A package should not contain hidden files, neither in the package tree
+nor in the TDS zip archive.
For more details refer to:
http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noauxfiles
@@ -264,26 +267,6 @@ 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#"
@@ -453,3 +436,42 @@ A package directory should not contain a TDS zip archive.
)
}
+pub fn e0036d() {
+ println!(
+ r#"
+E0036 -- .dtx/.ins files found in wrong directory in TDS zip archive
+
+In a TDS zip archive a .dtx resp. .ins file must be in a subdirectory of
+either of source/ or doc/ top level directories.
+"#
+ )
+}
+
+pub fn e0037d() {
+ println!(
+ r#"
+E0037 -- CR line endings detected
+
+The file specified in the error message contains CR 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 e0038d() {
+ println!(
+ r#"
+E0038 -- File has inconsistent line endings: CR: x, LF: y, CRLF: z
+
+The file specified in the error message contains CR 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
+"#
+ )
+}
+
diff --git a/support/pkgcheck/src/messages/fatald.rs b/support/pkgcheck/src/messages/fatald.rs
index b41cab83b1..ee02e47bde 100644
--- a/support/pkgcheck/src/messages/fatald.rs
+++ b/support/pkgcheck/src/messages/fatald.rs
@@ -64,3 +64,13 @@ code was specified.
)
}
+pub fn f0007d() {
+ println!(
+ r#"
+F0007 -- Could not create temporary directory for unzipping the TDS zip archive
+
+Make sure the temp directory is writable and/or the temp directory has
+enough space.
+"#
+ )
+}
diff --git a/support/pkgcheck/src/messages/informationd.rs b/support/pkgcheck/src/messages/informationd.rs
index d4e3ea43b3..340ade4766 100644
--- a/support/pkgcheck/src/messages/informationd.rs
+++ b/support/pkgcheck/src/messages/informationd.rs
@@ -75,3 +75,16 @@ http://mirror.ctan.org/help/ctan/CTAN-upload-addendum.html#noauxfiles
)
}
+pub fn i0007d() {
+ println!(
+ r#"
+I0007 -- Successfully corrected wrong line endings to LF resp. CRLF
+
+pkgcheck successfully converted wrong line endings to LF line endings or
+to CRLF line endings if it the file was a Windows text file.
+
+Wrong line endings could be CR, CRLF or a mixture of line endings.
+"#
+ )
+}
+
diff --git a/support/pkgcheck/src/messages/mod.rs b/support/pkgcheck/src/messages/mod.rs
index 2edda3c536..842c693718 100644
--- a/support/pkgcheck/src/messages/mod.rs
+++ b/support/pkgcheck/src/messages/mod.rs
@@ -117,6 +117,17 @@ macro_rules! f0005 {
// };
// }
+macro_rules! f0007 {
+ ($fmt1:expr) => {
+ error_occured!();
+ print!(
+ "{} Unable to create temporary directory for unzipping the TDS zip archive: {}. Exiting...\n",
+ msgid!("F0007"),
+ $fmt1
+ );
+ };
+}
+
macro_rules! e0001 {
($fmt1:expr, $fmt2:expr, $fmt3:expr) => {
error_occured!();
@@ -171,6 +182,17 @@ macro_rules! e0006 {
};
}
+macro_rules! e0006t {
+ ($fmt:expr) => {
+ error_occured!();
+ print!(
+ "{} Hidden directory {} detected in TDS zip archive\n",
+ msgid!("E0006"),
+ $fmt
+ );
+ };
+}
+
macro_rules! e0007 {
($fmt:expr) => {
error_occured!();
@@ -178,6 +200,17 @@ macro_rules! e0007 {
};
}
+macro_rules! e0007t {
+ ($fmt:expr) => {
+ error_occured!();
+ print!(
+ "{} Hidden file {} detected in TDS zip archive\n",
+ msgid!("E0007"),
+ $fmt
+ );
+ };
+}
+
macro_rules! e0008 {
($fmt:expr) => {
error_occured!();
@@ -185,6 +218,16 @@ macro_rules! e0008 {
};
}
+macro_rules! e0008t {
+ ($fmt:expr) => {
+ error_occured!();
+ print!(
+ "{} Temporary file {} detected in TDS zip archive\n",
+ msgid!("E0008"),
+ $fmt
+ );
+ };
+}
macro_rules! e0009 {
() => {
error_occured!();
@@ -217,7 +260,7 @@ macro_rules! e0011 {
macro_rules! e0012 {
($fmt:expr) => {
error_occured!();
- print!("{} CRLF detected: {}\n", msgid!("E0012"), $fmt);
+ print!("{} File {} has CRLF line endings\n", msgid!("E0012"), $fmt);
};
}
@@ -283,17 +326,6 @@ macro_rules! e0019 {
};
}
-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!();
@@ -448,8 +480,30 @@ macro_rules! e0035 {
};
}
+macro_rules! e0036 {
+ ($fmt:expr) => {
+ error_occured!();
+ print!(
+ "{} File `{}` not below `source/` or `doc/` top level directory in TDS zip archive\n",
+ msgid!("E0036"),
+ $fmt
+ );
+ };
+}
+macro_rules! e0037 {
+ ($fmt:expr) => {
+ error_occured!();
+ print!("{} File {} has CR line endings\n", msgid!("E0037"), $fmt);
+ };
+}
+macro_rules! e0038 {
+ ($fmt1:expr, $fmt2:expr, $fmt3:expr, $fmt4:expr) => {
+ error_occured!();
+ print!("{} File {} has inconsistent line endings: CR={}, LF={}, CRLF={}\n", msgid!("E0038"), $fmt1, $fmt2, $fmt3, $fmt4);
+ };
+}
macro_rules! w0001 {
($fmt:expr) => {
print!(
@@ -513,6 +567,20 @@ macro_rules! w0006 {
};
}
+macro_rules! w0007 {
+ ($fmt:expr) => {
+ error_occured!();
+ print!("{} Empty directory {} detected in TDS zip archive\n", msgid!("W0007"), $fmt);
+ };
+}
+
+macro_rules! w0008 {
+ ($fmt:expr) => {
+ error_occured!();
+ print!("{} Windows file {} has Unix line endings\n", msgid!("W0008"), $fmt);
+ };
+}
+
macro_rules! i0002 {
($fmt:expr) => {
print!(
@@ -565,15 +633,17 @@ macro_rules! i0006 {
}
macro_rules! i0007 {
- ($fmt:expr) => {
+ ($fmt1:expr, $fmt2:expr) => {
print!(
- "{} {}: Successfully converted from CRLF to LF\n",
+ "{} {}: Successfully corrected wrong line endings to {}\n",
msgid!("I0007"),
- $fmt
+ $fmt1,
+ $fmt2
);
};
}
+
pub fn explains(err: &str) {
let err_upp = err.to_ascii_uppercase();
match err_upp.as_str() {
@@ -583,6 +653,7 @@ pub fn explains(err: &str) {
"F0004" => f0004d(),
"F0005" => f0005d(),
"F0006" => f0006d(),
+ "F0007" => f0007d(),
"E0001" => e0001d(),
"E0002" => e0002d(),
@@ -603,7 +674,6 @@ pub fn explains(err: &str) {
"E0017" => e0017d(),
"E0018" => e0018d(),
"E0019" => e0019d(),
- "E0020" => e0020d(),
"E0021" => e0021d(),
"E0022" => e0022d(),
"E0023" => e0023d(),
@@ -618,6 +688,9 @@ pub fn explains(err: &str) {
"E0033" => e0033d(),
"E0034" => e0034d(),
"E0035" => e0035d(),
+ "E0036" => e0036d(),
+ "E0037" => e0037d(),
+ "E0038" => e0038d(),
// "I0001" => i0001d!(),
"I0001" => i0001d(),
@@ -626,6 +699,7 @@ pub fn explains(err: &str) {
"I0004" => i0004d(),
"I0005" => i0005d(),
"I0006" => i0006d(),
+ "I0007" => i0007d(),
"W0001" => w0001d(),
"W0002" => w0002d(),
@@ -633,6 +707,8 @@ pub fn explains(err: &str) {
"W0004" => w0004d(),
"W0005" => w0005d(),
"W0006" => w0006d(),
+ "W0007" => w0007d(),
+ "W0008" => w0008d(),
e => println!(
"F0006 Unknown error code `{}` specified with option -e resp. --explain. Exiting...",
@@ -668,7 +744,6 @@ pub fn explains_all() {
explains("E0017");
explains("E0018");
explains("E0019");
- explains("E0020");
explains("E0021");
explains("E0022");
explains("E0023");
@@ -683,6 +758,7 @@ pub fn explains_all() {
explains("E0033");
explains("E0034");
explains("E0035");
+ explains("E0036");
explains("I0001");
explains("I0002");
@@ -690,6 +766,7 @@ pub fn explains_all() {
explains("I0004");
explains("I0005");
explains("I0006");
+ explains("I0007");
explains("W0001");
explains("W0002");
@@ -697,4 +774,6 @@ pub fn explains_all() {
explains("W0004");
explains("W0005");
explains("W0006");
+ explains("W0007");
+ explains("W0008");
}
diff --git a/support/pkgcheck/src/messages/warningsd.rs b/support/pkgcheck/src/messages/warningsd.rs
index b8a1aa8ef3..cea814c8ce 100644
--- a/support/pkgcheck/src/messages/warningsd.rs
+++ b/support/pkgcheck/src/messages/warningsd.rs
@@ -78,3 +78,31 @@ in the TDS zip archive.
)
}
+pub fn w0007d() {
+ println!(
+ r#"
+W0007 -- Empty directory detected in the TDS zip archive
+
+Empty directories in a TDS zip archive are discouraged. As they usually
+don't create errors in the distribution we issue a warning only.
+"#
+ )
+}
+
+pub fn w0008d() {
+ println!(
+ r#"
+W0008 -- Windows file has Unix line endings
+
+A Windows file with Unix line endings was detected.
+
+We regard a file as a Windows file if its name ends with:
+
+- .bat
+- .cmd
+- .nsh, or
+- .reg
+"#
+ )
+}
+