Rust dep updates

This commit is contained in:
Yorhel 2019-05-25 08:27:23 +02:00
parent fbd7b71d73
commit f0df5092c3
9 changed files with 431 additions and 467 deletions

799
indexer/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -4,17 +4,17 @@ version = "0.1.0"
authors = ["Yorhel <git@yorhel.nl>"]
[dependencies]
regex = "0.2.10"
regex = "1.1.0"
log = "0.4.1"
env_logger = "0.5.6"
env_logger = "0.6.0"
lazy_static = "1.0.0"
libc = "0.2.39"
libarchive3-sys = "0.1.2"
encoding = { git = "https://github.com/lifthrasiir/rust-encoding", features = ["no-optimized-legacy-encoding"] }
ring = "0.12.1"
ring = "0.14.6"
postgres = "0.15.2"
clap = "2.31.2"
hyper = { version = "0.10.13", default-features = false } # TODO: Update?
url = "1.7.0"
chrono = "0.4.0"
quick-xml = "0.12.1"
quick-xml = "0.14.0"

View file

@ -190,7 +190,7 @@ impl<'a> ArchiveEntry<'a> {
str::from_utf8(c_str.to_bytes()).ok()
// Perform some simple opinionated normalization. Full normalization might be better,
// but also slower and more complex. This solution covers the most important cases.
.map(|s| s.trim_left_matches('/').trim_left_matches("./").trim_right_matches('/'))
.map(|s| s.trim_start_matches('/').trim_start_matches("./").trim_end_matches('/'))
}
pub fn size(&self) -> usize {

View file

@ -93,7 +93,7 @@ fn main() {
unsafe { pkg::DRY_RUN = arg.is_present("dry") };
let verbose = arg.occurrences_of("v");
env_logger::Builder::new()
env_logger::Builder::from_default_env()
.filter(Some("indexer"), match verbose {
0 => log::LevelFilter::Warn,
1 => log::LevelFilter::Info,

View file

@ -92,7 +92,7 @@ pub fn sync(pg: &postgres::GenericConnection, sys: i32, arch: &str, mirror: &str
fn trimext(n: &str) -> &str {
n.trim_right_matches(".tgz").trim_right_matches(".tbz")
n.trim_end_matches(".tgz").trim_end_matches(".tbz")
}

View file

@ -7,7 +7,7 @@ Module::Build->new(
dist_version_from => 'ManUtils.pm',
dist_abstract => 'Utils for manned.org',
license => 'MIT',
extra_linker_flags => '../../web/target/release/libweb.a',
extra_linker_flags => '../../web/target/release/libweb.a -lpthread',
pm_files => {
'ManUtils.pm' => 'lib/ManUtils.pm',
},

77
web/Cargo.lock generated
View file

@ -1,78 +1,58 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.6.4"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lazy_static"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.39"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "memchr"
version = "2.0.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
version = "0.2.10"
version = "1.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
version = "0.5.3"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "thread_local"
version = "0.3.5"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ucd-util"
version = "0.1.1"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unreachable"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "utf8-ranges"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "void"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@ -80,19 +60,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "web"
version = "0.1.0"
dependencies = [
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
"checksum libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "f54263ad99207254cf58b5f701ecb432c717445ea2ee8af387334bdd1a03fdff"
"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
"checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb"
"checksum regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2550876c31dc914696a6c2e01cbce8afba79a93c8ae979d2fe051c0230b3756"
"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c"
"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
"checksum regex 1.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8f0a0bcab2fd7d1d7c54fa9eae6f43eddeb9ce2e7352f8518a814a4f65d60c58"
"checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96"
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"

View file

@ -8,7 +8,7 @@ name = "web"
crate-type = ["lib", "staticlib"]
[dependencies]
regex = "0.2.10"
regex = "1.1.0"
lazy_static = "1.0.0"
# Add debugging symbols even in release mode, in order to help with profiling.

View file

@ -216,7 +216,7 @@ impl FmtBuf {
// - https://manned.org/urn/8cb83e85
// TODO: Add heuristic to only remove ) at the end of the URL if there is no matching (
// inside the URL.
let url = url.trim_right_matches(|c|
let url = url.trim_end_matches(|c|
match c { '.' | ',' | ';' | ')' | '⟩' | '\'' | ':' | ']' | '}' => true, _ => false }
);
if url.len() < 10 {
@ -266,7 +266,7 @@ impl FmtBuf {
// Find the indices where the first line ends, and the last line starts. These are used to
// efficiently disable reference formatting on the first and last line.
let firstlineend = self.buf.find('\n').unwrap_or(self.buf.len());
let lastlinestart = self.buf.trim_right_matches('\n').rfind('\n').unwrap_or(0);
let lastlinestart = self.buf.trim_end_matches('\n').rfind('\n').unwrap_or(0);
// This regex is used to quickly *find* interesting patterns, any further validation
// and processing is done afterwards by the (slower) specialized flush_ methods.