diff options
author | Norbert Preining <norbert@preining.info> | 2019-12-13 03:00:58 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-12-13 03:00:58 +0000 |
commit | fdd3c58e8e5b37dcf9affd49326899988992c074 (patch) | |
tree | aa8c48c62e863ef5d009eaf03fc5b66b9b6888ec /support/pkgcheck | |
parent | 867fe7fec2734700356f0f80dbfcad265a6e4e54 (diff) |
CTAN sync 201912130300
Diffstat (limited to 'support/pkgcheck')
-rw-r--r-- | support/pkgcheck/CHANGES.md | 6 | ||||
-rw-r--r-- | support/pkgcheck/Cargo.toml | 2 | ||||
-rwxr-xr-x | support/pkgcheck/bin/pkgcheck | bin | 7927624 -> 7898920 bytes | |||
-rw-r--r-- | support/pkgcheck/docs/errorsd.tex | 7 | ||||
-rw-r--r-- | support/pkgcheck/docs/pkgcheck.pdf | bin | 65641 -> 66749 bytes | |||
-rw-r--r-- | support/pkgcheck/docs/title.tex | 2 | ||||
-rw-r--r-- | support/pkgcheck/src/main.rs | 20 | ||||
-rw-r--r-- | support/pkgcheck/src/messages/errorsd.rs | 10 | ||||
-rw-r--r-- | support/pkgcheck/src/messages/mod.rs | 15 |
9 files changed, 55 insertions, 7 deletions
diff --git a/support/pkgcheck/CHANGES.md b/support/pkgcheck/CHANGES.md index 084a17581a..ac5dc5a1e6 100644 --- a/support/pkgcheck/CHANGES.md +++ b/support/pkgcheck/CHANGES.md @@ -67,4 +67,8 @@ Both features are regarded as experimental because both contain a hard coded check. If required things will be changed in the future. - +2019-11-04 (1.9.0) + - (Experimental) for latex-base, latex-tools, latex-graphics and latex-amsmath use the real + package name 'latex' when checking path names in the TDS zip archive + - New error message e0035 if a TDS zip archive is found in the unpacked directory tree + - add testcases for w0005, w0006 and e0035 diff --git a/support/pkgcheck/Cargo.toml b/support/pkgcheck/Cargo.toml index b682eec3e8..7908036125 100644 --- a/support/pkgcheck/Cargo.toml +++ b/support/pkgcheck/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pkgcheck" -version = "1.8.3" +version = "1.9.0" authors = ["Manfred Lotz <manfred@ctan.org>"] description = "Command-line tool to check packages uploaded to CTAN." license = "MIT/Apache-2.0" diff --git a/support/pkgcheck/bin/pkgcheck b/support/pkgcheck/bin/pkgcheck Binary files differindex 09397b1a1a..1ac3e63302 100755 --- a/support/pkgcheck/bin/pkgcheck +++ b/support/pkgcheck/bin/pkgcheck diff --git a/support/pkgcheck/docs/errorsd.tex b/support/pkgcheck/docs/errorsd.tex index 1557460ea1..25a68c1d79 100644 --- a/support/pkgcheck/docs/errorsd.tex +++ b/support/pkgcheck/docs/errorsd.tex @@ -330,3 +330,10 @@ archive}\label{e0034----unwanted-file-detected-in-the-top-level-directory-in-tds A top level directory of a TDS archive should only contain certain directories but no files. + +\hypertarget{e0035----unwanted-tds-archive-detected-in-package-directory-tree}{% +\subsection{E0035 -\/- Unwanted TDS archive detected in package +directory +tree}\label{e0035----unwanted-tds-archive-detected-in-package-directory-tree}} + +A package directory should not contain a TDS zip archive. diff --git a/support/pkgcheck/docs/pkgcheck.pdf b/support/pkgcheck/docs/pkgcheck.pdf Binary files differindex d8c8a02bc9..87d258b13d 100644 --- a/support/pkgcheck/docs/pkgcheck.pdf +++ b/support/pkgcheck/docs/pkgcheck.pdf diff --git a/support/pkgcheck/docs/title.tex b/support/pkgcheck/docs/title.tex index 0955e7d594..9961a041b9 100644 --- a/support/pkgcheck/docs/title.tex +++ b/support/pkgcheck/docs/title.tex @@ -1 +1 @@ -\title{pkgcheck Utility, v1.8.3} +\title{pkgcheck Utility, v1.9.0} diff --git a/support/pkgcheck/src/main.rs b/support/pkgcheck/src/main.rs index c69423252d..6fb4136f91 100644 --- a/support/pkgcheck/src/main.rs +++ b/support/pkgcheck/src/main.rs @@ -587,13 +587,21 @@ fn check_tds_archive( // which yields a false test when checking for the package name // the path names of the TDS zip archive files. // Therefore, we correct here. - let real_pkg_name = if pkg_name == "babel-base" { - "babel" + // latex-tools, latex-graphics, latex-amsmath, latex-base => latex + //let mut pkg_replacements: HashMap<String,String> = HashMap::default(); + //pkg_replacements.insert("babel-base".to_string(), "babel".to_string()); + let mut pkg_replacements: HashMap<&str,&str> = HashMap::default(); + pkg_replacements.insert("babel-base", "babel"); + pkg_replacements.insert("latex-base", "latex"); + pkg_replacements.insert("latex-tools", "latex"); + pkg_replacements.insert("latex-graphics", "latex"); + pkg_replacements.insert("latex-amsmath", "latex"); + let real_pkg_name = if let Some(real_name) = pkg_replacements.get(pkg_name) { + real_name } else { pkg_name }; - let tmp_dir = TempDir::new("pkgcheck")?; let tmp_dir_offset = tmp_dir.path().to_str().unwrap().len() + 1; unzip_tds_archive(tds_zip, tmp_dir.path().to_str().unwrap()); @@ -1180,7 +1188,11 @@ fn check_package(root: &str, tds_zip: &Option<String>) -> Option<Hashes> { } filemagic::Mimetype::Archive | filemagic::Mimetype::Zip => { - w0001!(dir_entry_str); + if dir_entry_str.ends_with(".tds.zip") { + e0035!(dir_entry_str); + } else { + w0001!(dir_entry_str); + } check_and_correct_perms(dir_entry_str, p); } diff --git a/support/pkgcheck/src/messages/errorsd.rs b/support/pkgcheck/src/messages/errorsd.rs index bd726754c0..f839f5538b 100644 --- a/support/pkgcheck/src/messages/errorsd.rs +++ b/support/pkgcheck/src/messages/errorsd.rs @@ -443,3 +443,13 @@ directories but no files. ) } +pub fn e0035d() { + println!( + r#" +E0035 -- Unwanted TDS archive detected in package directory tree + +A package directory should not contain a TDS zip archive. +"# + ) +} + diff --git a/support/pkgcheck/src/messages/mod.rs b/support/pkgcheck/src/messages/mod.rs index 0a77e14c1e..2edda3c536 100644 --- a/support/pkgcheck/src/messages/mod.rs +++ b/support/pkgcheck/src/messages/mod.rs @@ -437,6 +437,19 @@ macro_rules! e0034 { }; } +macro_rules! e0035 { + ($fmt:expr) => { + error_occured!(); + print!( + "{} Unwanted TDS archive `{}` detected in package directory tree\n", + msgid!("E0035"), + $fmt + ); + }; +} + + + macro_rules! w0001 { ($fmt:expr) => { print!( @@ -604,6 +617,7 @@ pub fn explains(err: &str) { "E0031" => e0031d(), "E0033" => e0033d(), "E0034" => e0034d(), + "E0035" => e0035d(), // "I0001" => i0001d!(), "I0001" => i0001d(), @@ -668,6 +682,7 @@ pub fn explains_all() { explains("E0031"); explains("E0033"); explains("E0034"); + explains("E0035"); explains("I0001"); explains("I0002"); |