diff --git a/collector/compile-benchmarks/README.md b/collector/compile-benchmarks/README.md index 85c2dfc36..8ece0cf88 100644 --- a/collector/compile-benchmarks/README.md +++ b/collector/compile-benchmarks/README.md @@ -24,7 +24,6 @@ They mostly consist of real-world crates. - **clap_derive-4.5.32**: The proc macro sub-crate of a command line argument parser library that is used by many Rust programs. - **cranelift-codegen-0.119.0**: The largest crate from a code generator. Used by wasmtime. Stresses obligation processing. - **diesel-2.2:10**: A type-safe SQL query builder. Utilizes the type system to ensure a lot of invariants. Stresses anything related to resolving trait bounds, by having a lot of trait impls for a large number of different types. -- **exa-0.10.1**: An `ls` replacement. A widely-used utility, and a binary crate. - **eza-0.21.2**: An `ls` replacement. A widely-used utility, and a binary crate. Fork of `exa`. - **helloworld**: A trivial program. Gives a lower bound on compile time. - **html5ever-0.31.0**: An HTML parser. Stresses macro parsing code. diff --git a/collector/compile-benchmarks/REUSE.toml b/collector/compile-benchmarks/REUSE.toml index 75f4a8cb6..15aae004a 100644 --- a/collector/compile-benchmarks/REUSE.toml +++ b/collector/compile-benchmarks/REUSE.toml @@ -77,11 +77,6 @@ path = "encoding/**" SPDX-FileCopyrightText = "encoding contributors" SPDX-License-Identifier = "MIT" -[[annotations]] -path = "exa-0.10.1/**" -SPDX-FileCopyrightText = "exa contributors" -SPDX-License-Identifier = "MIT" - [[annotations]] path = "eza-0.21.2/**" SPDX-FileCopyrightText = "Christina Sørensen, eza contributors" diff --git a/collector/compile-benchmarks/exa-0.10.1/.github/FUNDING.yml b/collector/compile-benchmarks/exa-0.10.1/.github/FUNDING.yml deleted file mode 100644 index 8f689a84d..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: ogham diff --git a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/bug_report.md b/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index bdb032344..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: Bug report -about: Report a crash, runtime error, or invalid output in exa ---- - -If exa does something unexpected, or its output looks wrong, or it displays an error on the screen, or if it outright crashes, then please include the following information in your report: - -- The version of exa being used (`exa --version`) -- The command-line arguments you are using -- Your operating system and hardware platform - -If it’s a crash, please include the full text of the crash that gets printed to the screen. If you’re seeing unexpected behaviour, a screenshot of the issue will help a lot. - ---- diff --git a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/compilation_error.md b/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/compilation_error.md deleted file mode 100644 index 669f1d618..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/compilation_error.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Compilation error -about: Report a problem compiling exa ---- - -If exa fails to compile, or if there is a problem during the build process, then please include the following information in your report: - -- The exact exa commit you are building (`git rev-parse --short HEAD`) -- The version of rustc you are compiling it with (`rustc --version`) -- Your operating system and hardware platform -- The Rust build target (the _exact_ output of `rustc --print cfg`) - -If you are seeing compilation errors, please include the output of the build process. - ---- diff --git a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/config.yml b/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 0086358db..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: true diff --git a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/feature_request.md b/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index a19135631..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -name: Feature request -about: Request a feature or enhancement to exa ---- diff --git a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/question.md b/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index fccaba556..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -name: Question -about: Ask a question about exa ---- diff --git a/collector/compile-benchmarks/exa-0.10.1/.gitignore b/collector/compile-benchmarks/exa-0.10.1/.gitignore deleted file mode 100644 index ede6ac038..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# Rust stuff -target - -# Vagrant stuff -.vagrant -ubuntu-xenial-16.04-cloudimg-console.log - -# Compiled artifacts -# (see devtools/*-package-for-*.sh) -/exa-linux-x86_64 -/exa-linux-x86_64-*.zip -/exa-macos-x86_64 -/exa-macos-x86_64-*.zip -/MD5SUMS -/SHA1SUMS - -# Snap stuff -parts -prime -stage -*.snap diff --git a/collector/compile-benchmarks/exa-0.10.1/.rustfmt.toml b/collector/compile-benchmarks/exa-0.10.1/.rustfmt.toml deleted file mode 100644 index c7ad93baf..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.rustfmt.toml +++ /dev/null @@ -1 +0,0 @@ -disable_all_formatting = true diff --git a/collector/compile-benchmarks/exa-0.10.1/.travis.yml b/collector/compile-benchmarks/exa-0.10.1/.travis.yml deleted file mode 100644 index cc980818d..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: rust -rust: - - 1.42.0 - - stable - - beta - - nightly - -jobs: - fast_finish: true - allow_failures: - - rust: nightly - - include: - - name: 'Rust: test with all features' - rust: stable - install: - - cargo install cargo-hack - script: - - cargo hack test --feature-powerset diff --git a/collector/compile-benchmarks/exa-0.10.1/0-printlns.patch b/collector/compile-benchmarks/exa-0.10.1/0-printlns.patch deleted file mode 100644 index 138fea85a..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/0-printlns.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/src/fs/file.rs b/src/fs/file.rs -index b57777d1..ccaa460c 100644 ---- a/src/fs/file.rs -+++ b/src/fs/file.rs -@@ -70,6 +70,8 @@ impl<'dir> File<'dir> { - where PD: Into>, - FN: Into> - { -+ println!("testing 3"); -+ - let parent_dir = parent_dir.into(); - let name = filename.into().unwrap_or_else(|| File::filename(&path)); - let ext = File::ext(&path); -diff --git a/src/logger.rs b/src/logger.rs -index b3c33c5d..b1eb99b3 100644 ---- a/src/logger.rs -+++ b/src/logger.rs -@@ -39,6 +39,7 @@ const GLOBAL_LOGGER: &Logger = &Logger; - - impl log::Log for Logger { - fn enabled(&self, _: &log::Metadata<'_>) -> bool { -+ println!("testing 1"); - true // no need to filter after using ‘set_max_level’. - } - -diff --git a/src/theme/ui_styles.rs b/src/theme/ui_styles.rs -index f92c5442..ef42825c 100644 ---- a/src/theme/ui_styles.rs -+++ b/src/theme/ui_styles.rs -@@ -117,6 +117,7 @@ impl UiStyles { - /// by the `LS_COLORS` environment variable. Invalid keys set nothing, but - /// return false. - pub fn set_ls(&mut self, pair: &Pair<'_>) -> bool { -+ println!("testing 2"); - match pair.key { - "di" => self.filekinds.directory = pair.to_style(), // DIR - "ex" => self.filekinds.executable = pair.to_style(), // EXEC diff --git a/collector/compile-benchmarks/exa-0.10.1/Cargo.lock b/collector/compile-benchmarks/exa-0.10.1/Cargo.lock deleted file mode 100644 index ed3a06827..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/Cargo.lock +++ /dev/null @@ -1,394 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "cc" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" -dependencies = [ - "jobserver", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "datetime" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c3f7a77f3e57fedf80e09136f2d8777ebf621207306f6d96d610af048354bc" -dependencies = [ - "libc", - "locale", - "pad", - "redox_syscall", - "winapi", -] - -[[package]] -name = "exa" -version = "0.10.1" -dependencies = [ - "ansi_term", - "datetime", - "git2", - "glob", - "lazy_static", - "libc", - "locale", - "log", - "natord", - "num_cpus", - "number_prefix", - "scoped_threadpool", - "term_grid", - "term_size", - "unicode-width", - "users", - "zoneinfo_compiled", -] - -[[package]] -name = "form_urlencoded" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" -dependencies = [ - "matches", - "percent-encoding", -] - -[[package]] -name = "git2" -version = "0.13.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d250f5f82326884bd39c2853577e70a121775db76818ffa452ed1e80de12986" -dependencies = [ - "bitflags", - "libc", - "libgit2-sys", - "log", - "openssl-sys", - "url", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "hermit-abi" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" -dependencies = [ - "libc", -] - -[[package]] -name = "idna" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "jobserver" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" -dependencies = [ - "libc", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" - -[[package]] -name = "libgit2-sys" -version = "0.12.18+1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da6a42da88fc37ee1ecda212ffa254c25713532980005d5f7c0b0fbe7e6e885" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - -[[package]] -name = "libz-sys" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "locale" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fdbe492a9c0238da900a1165c42fc5067161ce292678a6fe80921f30fe307fd" -dependencies = [ - "libc", -] - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "natord" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308d96db8debc727c3fd9744aac51751243420e46edf401010908da7f8d5e57c" - -[[package]] -name = "num_cpus" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - -[[package]] -name = "openssl-src" -version = "111.15.0+1.1.1k" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a5f6ae2ac04393b217ea9f700cd04fa9bf3d93fae2872069f3d15d908af70a" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f" -dependencies = [ - "autocfg", - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "pad" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ad9b889f1b12e0b9ee24db044b5129150d5eada288edc800f789928dc8c0e3" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pkg-config" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" - -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - -[[package]] -name = "scoped_threadpool" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" - -[[package]] -name = "term_grid" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230d3e804faaed5a39b08319efb797783df2fd9671b39b7596490cb486d702cf" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "term_size" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "tinyvec" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "unicode-bidi" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - -[[package]] -name = "url" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" -dependencies = [ - "form_urlencoded", - "idna", - "matches", - "percent-encoding", -] - -[[package]] -name = "users" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032" -dependencies = [ - "libc", - "log", -] - -[[package]] -name = "vcpkg" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "zoneinfo_compiled" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64fbebe65e899530f43bd760b23fda8f141118f4db49952b02998cbd0907a5de" -dependencies = [ - "byteorder", - "datetime", -] diff --git a/collector/compile-benchmarks/exa-0.10.1/Cargo.toml b/collector/compile-benchmarks/exa-0.10.1/Cargo.toml deleted file mode 100644 index ee599289d..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/Cargo.toml +++ /dev/null @@ -1,102 +0,0 @@ -# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -# -# When uploading crates to the registry Cargo will automatically -# "normalize" Cargo.toml files for maximal compatibility -# with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies -# -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) - -[package] -edition = "2018" -name = "exa" -version = "0.10.1" -authors = ["Benjamin Sago "] -exclude = ["/devtools/*", "/Justfile", "/Vagrantfile", "/screenshots.png"] -description = "A modern replacement for ls" -homepage = "https://the.exa.website/" -categories = ["command-line-utilities"] -license = "MIT" -repository = "https://github.com/ogham/exa" -[package.metadata.deb] -assets = [["target/release/exa", "/usr/bin/exa", "0755"], ["contrib/man/exa.1", "/usr/share/man/man1/exa.1", "0644"], ["contrib/completions.bash", "/etc/bash_completion.d/exa", "0644"]] -depends = "$auto" -extended-description = "exa is a replacement for ls written in Rust.\n" -license-file = ["LICENCE"] -priority = "optional" -section = "utils" -[profile.dev] -debug = false - -[profile.release] -lto = true - -[[bin]] -name = "exa" -[dependencies.ansi_term] -version = "0.12" - -[dependencies.datetime] -version = "0.5.2" -features = ["format"] -default-features = false - -[dependencies.git2] -version = "0.13" -optional = true -default-features = false - -[dependencies.glob] -version = "0.3" - -[dependencies.lazy_static] -version = "1.3" - -[dependencies.libc] -version = "0.2" - -[dependencies.locale] -version = "0.2" - -[dependencies.log] -version = "0.4" - -[dependencies.natord] -version = "1.0" - -[dependencies.num_cpus] -version = "1.10" - -[dependencies.number_prefix] -version = "0.4" - -[dependencies.scoped_threadpool] -version = "0.1" - -[dependencies.term_grid] -version = "0.1" - -[dependencies.term_size] -version = "0.3" - -[dependencies.unicode-width] -version = "0.1" - -[dependencies.users] -version = "0.11" - -[dependencies.zoneinfo_compiled] -version = "0.5.1" -[build-dependencies.datetime] -version = "0.5.2" -default-features = false - -[features] -default = ["git"] -git = ["git2"] -vendored-openssl = ["git2/vendored-openssl"] - -[workspace] diff --git a/collector/compile-benchmarks/exa-0.10.1/Cargo.toml.orig b/collector/compile-benchmarks/exa-0.10.1/Cargo.toml.orig deleted file mode 100644 index 1d4220410..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/Cargo.toml.orig +++ /dev/null @@ -1,77 +0,0 @@ -[package] -name = "exa" -description = "A modern replacement for ls" - -authors = ["Benjamin Sago "] -categories = ["command-line-utilities"] -edition = "2018" -exclude = ["/devtools/*", "/Justfile", "/Vagrantfile", "/screenshots.png"] -homepage = "https://the.exa.website/" -license = "MIT" -repository = "https://github.com/ogham/exa" -version = "0.10.1" - - -[[bin]] -name = "exa" - - -[dependencies] -ansi_term = "0.12" -glob = "0.3" -lazy_static = "1.3" -libc = "0.2" -locale = "0.2" -log = "0.4" -natord = "1.0" -num_cpus = "1.10" -number_prefix = "0.4" -scoped_threadpool = "0.1" -term_grid = "0.1" -term_size = "0.3" -unicode-width = "0.1" -users = "0.11" -zoneinfo_compiled = "0.5.1" - -[dependencies.datetime] -version = "0.5.2" -default-features = false -features = ["format"] - -[dependencies.git2] -version = "0.13" -optional = true -default-features = false - -[build-dependencies.datetime] -version = "0.5.2" -default-features = false - -[features] -default = [ "git" ] -git = [ "git2" ] -vendored-openssl = ["git2/vendored-openssl"] - - -# make dev builds faster by excluding debug symbols -[profile.dev] -debug = false - -# use LTO for smaller binaries (that take longer to build) -[profile.release] -lto = true - - -[package.metadata.deb] -license-file = [ "LICENCE" ] -depends = "$auto" -extended-description = """ -exa is a replacement for ls written in Rust. -""" -section = "utils" -priority = "optional" -assets = [ - [ "target/release/exa", "/usr/bin/exa", "0755" ], - [ "contrib/man/exa.1", "/usr/share/man/man1/exa.1", "0644" ], - [ "contrib/completions.bash", "/etc/bash_completion.d/exa", "0644" ], -] diff --git a/collector/compile-benchmarks/exa-0.10.1/LICENCE b/collector/compile-benchmarks/exa-0.10.1/LICENCE deleted file mode 100644 index 3228cc99b..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/LICENCE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Benjamin Sago - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/collector/compile-benchmarks/exa-0.10.1/README.md b/collector/compile-benchmarks/exa-0.10.1/README.md deleted file mode 100644 index 1939928d5..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/README.md +++ /dev/null @@ -1,277 +0,0 @@ -
-

exa

- -[exa](https://the.exa.website/) is a modern replacement for _ls_. - -**README Sections:** [Options](#options) — [Installation](#installation) — [Development](#development) - - - Build status - - - - Say thanks! - -
- -![Screenshots of exa](screenshots.png) - ---- - -**exa** is a modern replacement for the venerable file-listing command-line program `ls` that ships with Unix and Linux operating systems, giving it more features and better defaults. -It uses colours to distinguish file types and metadata. -It knows about symlinks, extended attributes, and Git. -And it’s **small**, **fast**, and just **one single binary**. - -By deliberately making some decisions differently, exa attempts to be a more featureful, more user-friendly version of `ls`. -For more information, see [exa’s website](https://the.exa.website/). - - ---- - - -

Command-line options

-
- -exa’s options are almost, but not quite, entirely unlike `ls`’s. - -### Display options - -- **-1**, **--oneline**: display one entry per line -- **-G**, **--grid**: display entries as a grid (default) -- **-l**, **--long**: display extended details and attributes -- **-R**, **--recurse**: recurse into directories -- **-T**, **--tree**: recurse into directories as a tree -- **-x**, **--across**: sort the grid across, rather than downwards -- **-F**, **--classify**: display type indicator by file names -- **--colo[u]r**: when to use terminal colours -- **--colo[u]r-scale**: highlight levels of file sizes distinctly -- **--icons**: display icons -- **--no-icons**: don't display icons (always overrides --icons) - -### Filtering options - -- **-a**, **--all**: show hidden and 'dot' files -- **-d**, **--list-dirs**: list directories like regular files -- **-L**, **--level=(depth)**: limit the depth of recursion -- **-r**, **--reverse**: reverse the sort order -- **-s**, **--sort=(field)**: which field to sort by -- **--group-directories-first**: list directories before other files -- **-D**, **--only-dirs**: list only directories -- **--git-ignore**: ignore files mentioned in `.gitignore` -- **-I**, **--ignore-glob=(globs)**: glob patterns (pipe-separated) of files to ignore - -Pass the `--all` option twice to also show the `.` and `..` directories. - -### Long view options - -These options are available when running with `--long` (`-l`): - -- **-b**, **--binary**: list file sizes with binary prefixes -- **-B**, **--bytes**: list file sizes in bytes, without any prefixes -- **-g**, **--group**: list each file’s group -- **-h**, **--header**: add a header row to each column -- **-H**, **--links**: list each file’s number of hard links -- **-i**, **--inode**: list each file’s inode number -- **-m**, **--modified**: use the modified timestamp field -- **-S**, **--blocks**: list each file’s number of file system blocks -- **-t**, **--time=(field)**: which timestamp field to use -- **-u**, **--accessed**: use the accessed timestamp field -- **-U**, **--created**: use the created timestamp field -- **-@**, **--extended**: list each file’s extended attributes and sizes -- **--changed**: use the changed timestamp field -- **--git**: list each file’s Git status, if tracked or ignored -- **--time-style**: how to format timestamps -- **--no-permissions**: suppress the permissions field -- **--octal-permissions**: list each file's permission in octal format -- **--no-filesize**: suppress the filesize field -- **--no-user**: suppress the user field -- **--no-time**: suppress the time field - -Some of the options accept parameters: - -- Valid **--color** options are **always**, **automatic**, and **never**. -- Valid sort fields are **accessed**, **changed**, **created**, **extension**, **Extension**, **inode**, **modified**, **name**, **Name**, **size**, **type**, and **none**. Fields starting with a capital letter sort uppercase before lowercase. The modified field has the aliases **date**, **time**, and **newest**, while its reverse has the aliases **age** and **oldest**. -- Valid time fields are **modified**, **changed**, **accessed**, and **created**. -- Valid time styles are **default**, **iso**, **long-iso**, and **full-iso**. - - ---- - - -

Installation

-
- -exa is available for macOS and Linux. -More information on how to install exa is available on [the Installation page](https://the.exa.website/install). - -### Alpine Linux - -On Alpine Linux, [enable community repository](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository) and install the [`exa`](https://pkgs.alpinelinux.org/package/edge/community/x86_64/exa) package. - - $ apk add exa - -### Arch Linux - -On Arch, install the [`exa`](https://www.archlinux.org/packages/community/x86_64/exa/) package. - - $ pacman -S exa - -### Android / Termux - -On Android / Termux, install the [`exa`](https://github.com/termux/termux-packages/tree/master/packages/exa) package. - - $ pkg install exa - -### Debian - -On Debian, install the [`exa`](https://packages.debian.org/unstable/exa) package. -For now, exa is in the _unstable_ repository. - - $ apt install exa - -### Fedora - -On Fedora, install the [`exa`](https://src.fedoraproject.org/modules/exa) package. - - $ dnf install exa - -### Gentoo - -On Gentoo, install the [`sys-apps/exa`](https://packages.gentoo.org/packages/sys-apps/exa) package. - - $ emerge sys-apps/exa - -### Homebrew - -If you’re using [Homebrew](https://brew.sh/) on macOS, install the [`exa`](http://formulae.brew.sh/formula/exa) formula. - - $ brew install exa - -### MacPorts - -If you're using [MacPorts](https://www.macports.org/) on macOS, install the [`exa`](https://ports.macports.org/port/exa/summary) port. - - $ port install exa - -### Nix - -On nixOS, install the [`exa`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/exa/default.nix) package. - - $ nix-env -i exa - -### openSUSE - -On openSUSE, install the [`exa`](https://software.opensuse.org/package/exa) package. - - $ zypper install exa - -### Ubuntu - -On Ubuntu 20.10 (Groovy Gorilla) and later, install the [`exa`](https://packages.ubuntu.com/groovy/exa) package. - - $ sudo apt install exa - -### Void Linux - -On Void Linux, install the [`exa`](https://github.com/void-linux/void-packages/blob/master/srcpkgs/exa/template) package. - - $ xbps-install -S exa - -### Manual installation from GitHub - -Compiled binary versions of exa are uploaded to GitHub when a release is made. -You can install exa manually by [downloading a release](https://github.com/ogham/exa/releases), extracting it, and copying the binary to a directory in your `$PATH`, such as `/usr/local/bin`. - -For more information, see the [Manual Installation page](https://the.exa.website/install/linux#manual). - -### Cargo - -If you already have a Rust environment set up, you can use the `cargo install` command: - - $ cargo install exa - -Cargo will build the `exa` binary and place it in `$HOME/.cargo`. - -To build without Git support, run `cargo install --no-default-features exa` is also available, if the requisite dependencies are not installed. - - ---- - - -

Development - - - Rust 1.42+ - - - - MIT Licence - -

- -exa is written in [Rust](https://www.rust-lang.org/). -You will need rustc version 1.42.0 or higher. -The recommended way to install Rust for development is from the [official download page](https://www.rust-lang.org/tools/install), using rustup. - -Once Rust is installed, you can compile exa with Cargo: - - $ cargo build - $ cargo test - -- The [just](https://github.com/casey/just) command runner can be used to run some helpful development commands, in a manner similar to `make`. -Run `just --tasks` to get an overview of what’s available. - -- If you are compiling a copy for yourself, be sure to run `cargo build --release` or `just build-release` to benefit from release-mode optimisations. -Copy the resulting binary, which will be in the `target/release` directory, into a folder in your `$PATH`. -`/usr/local/bin` is usually a good choice. - -- To compile and install the manual pages, you will need [pandoc](https://pandoc.org/). -The `just man` command will compile the Markdown into manual pages, which it will place in the `target/man` directory. -To use them, copy them into a directory that `man` will read. -`/usr/local/share/man` is usually a good choice. - -- exa depends on [libgit2](https://github.com/rust-lang/git2-rs) for certain features. -If you’re unable to compile libgit2, you can opt out of Git support by running `cargo build --no-default-features`. - -- If you intend to compile for musl, you will need to use the flag `vendored-openssl` if you want to get the Git feature working. -The full command is `cargo build --release --target=x86_64-unknown-linux-musl --features vendored-openssl,git`. - -For more information, see the [Building from Source page](https://the.exa.website/install/source). - - -### Testing with Vagrant - -exa uses [Vagrant][] to configure virtual machines for testing. - -Programs such as exa that are basically interfaces to the system are [notoriously difficult to test][testing]. -Although the internal components have unit tests, it’s impossible to do a complete end-to-end test without mandating the current user’s name, the time zone, the locale, and directory structure to test. -(And yes, these tests are worth doing. I have missed an edge case on many an occasion.) - -The initial attempt to solve the problem was just to create a directory of “awkward” test cases, run exa on it, and make sure it produced the correct output. -But even this output would change if, say, the user’s locale formats dates in a different way. -These can be mocked inside the code, but at the cost of making that code more complicated to read and understand. - -An alternative solution is to fake *everything*: create a virtual machine with a known state and run the tests on *that*. -This is what Vagrant does. -Although it takes a while to download and set up, it gives everyone the same development environment to test for any obvious regressions. - -[Vagrant]: https://www.vagrantup.com/ -[testing]: https://eev.ee/blog/2016/08/22/testing-for-people-who-hate-testing/#troublesome-cases - -First, initialise the VM: - - host$ vagrant up - -The first command downloads the virtual machine image, and then runs our provisioning script, which installs Rust and exa’s build-time dependencies, configures the environment, and generates some awkward files and folders to use as test cases. -Once this is done, you can SSH in, and build and test: - - host$ vagrant ssh - vm$ cd /vagrant - vm$ cargo build - vm$ ./xtests/run - All the tests passed! - -Of course, the drawback of having a standard development environment is that you stop noticing bugs that occur outside of it. -For this reason, Vagrant isn’t a *necessary* development step — it’s there if you’d like to use it, but exa still gets used and tested on other platforms. -It can still be built and compiled on any target triple that it supports, VM or no VM, with `cargo build` and `cargo test`. diff --git a/collector/compile-benchmarks/exa-0.10.1/archiver2.pl b/collector/compile-benchmarks/exa-0.10.1/archiver2.pl deleted file mode 100755 index 2e981cf93..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/archiver2.pl +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env perl -use Archive::Zip; - -my $version = '0.10.1'; - -sub add_regulars { - my $zip = shift; - - $zip->addFile('completions/completions.bash', 'completions/exa.bash'); - $zip->addFile('completions/completions.zsh', 'completions/exa.zsh'); - $zip->addFile('completions/completions.fish', 'completions/exa.fish'); - - $zip->addFile('target/man/exa.1', 'man/exa.1'); - $zip->addFile('target/man/exa_colors.5', 'man/exa_colors.5'); -} - -sub acc { - my $zip = Archive::Zip->new(); - add_regulars($zip); - $zip->writeToFileNamed("exa-accoutrements-v$version.zip") == AZ_OK || die 'Zip write error!'; -} - -sub src { - my $zip = Archive::Zip->new(); - add_regulars($zip); - $zip->addFile('Cargo.lock', 'Cargo.lock'); - $zip->addFile('Cargo.toml', 'Cargo.toml'); - $zip->addFile('LICENCE', 'LICENCE'); - $zip->addFile('build.rs', 'build.rs'); - $zip->addFile('Justfile', 'Justfile'); - $zip->addFile('README.md', 'README.md'); - $zip->addTree('vendor', 'vendor'); - $zip->writeToFileNamed("exa-vendored-source-v$version.zip") == AZ_OK || die 'Zip write error!'; -} - -acc(); -src(); diff --git a/collector/compile-benchmarks/exa-0.10.1/build.rs b/collector/compile-benchmarks/exa-0.10.1/build.rs deleted file mode 100644 index f27aa243a..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/build.rs +++ /dev/null @@ -1,122 +0,0 @@ -/// The version string isn’t the simplest: we want to show the version, -/// current Git hash, and compilation date when building *debug* versions, but -/// just the version for *release* versions so the builds are reproducible. -/// -/// This script generates the string from the environment variables that Cargo -/// adds (http://doc.crates.io/environment-variables.html) and runs `git` to -/// get the SHA1 hash. It then writes the string into a file, which exa then -/// includes at build-time. -/// -/// - https://stackoverflow.com/q/43753491/3484614 -/// - https://crates.io/crates/vergen - -use std::env; -use std::fs::File; -use std::io::{self, Write}; -use std::path::PathBuf; - -use datetime::{LocalDateTime, ISO}; - - -/// The build script entry point. -fn main() -> io::Result<()> { - #![allow(clippy::write_with_newline)] - - let tagline = "exa - list files on the command-line"; - let url = "https://the.exa.website/"; - - let ver = - if is_debug_build() { - format!("{}\nv{} \\1;31m(pre-release debug build!)\\0m\n\\1;4;34m{}\\0m", tagline, version_string(), url) - } - else if is_development_version() { - format!("{}\nv{} [{}] built on {} \\1;31m(pre-release!)\\0m\n\\1;4;34m{}\\0m", tagline, version_string(), git_hash(), build_date(), url) - } - else { - format!("{}\nv{}\n\\1;4;34m{}\\0m", tagline, version_string(), url) - }; - - // We need to create these files in the Cargo output directory. - let out = PathBuf::from(env::var("OUT_DIR").unwrap()); - - // Bland version text - let mut f = File::create(&out.join("version_string.txt"))?; - writeln!(f, "{}", strip_codes(&ver))?; - - Ok(()) -} - -/// Removes escape codes from a string. -fn strip_codes(input: &str) -> String { - input.replace("\\0m", "") - .replace("\\1;31m", "") - .replace("\\1;4;34m", "") -} - -/// Retrieve the project’s current Git hash, as a string. -fn git_hash() -> String { - use std::process::Command; - - String::from_utf8_lossy( - &Command::new("git") - .args(&["rev-parse", "--short", "HEAD"]) - .output().unwrap() - .stdout).trim().to_string() -} - -/// Whether we should show pre-release info in the version string. -/// -/// Both weekly releases and actual releases are --release releases, -/// but actual releases will have a proper version number. -fn is_development_version() -> bool { - cargo_version().ends_with("-pre") || env::var("PROFILE").unwrap() == "debug" -} - -/// Whether we are building in debug mode. -fn is_debug_build() -> bool { - env::var("PROFILE").unwrap() == "debug" -} - -/// Retrieves the [package] version in Cargo.toml as a string. -fn cargo_version() -> String { - env::var("CARGO_PKG_VERSION").unwrap() -} - -/// Returns the version and build parameters string. -fn version_string() -> String { - let mut ver = cargo_version(); - - let feats = nonstandard_features_string(); - if ! feats.is_empty() { - ver.push_str(&format!(" [{}]", &feats)); - } - - ver -} - -/// Finds whether a feature is enabled by examining the Cargo variable. -fn feature_enabled(name: &str) -> bool { - env::var(&format!("CARGO_FEATURE_{}", name)) - .map(|e| ! e.is_empty()) - .unwrap_or(false) -} - -/// A comma-separated list of non-standard feature choices. -fn nonstandard_features_string() -> String { - let mut s = Vec::new(); - - if feature_enabled("GIT") { - s.push("+git"); - } - else { - s.push("-git"); - } - - s.join(", ") -} - -/// Formats the current date as an ISO 8601 string. -fn build_date() -> String { - let now = LocalDateTime::now(); - format!("{}", now.date().iso()) -} diff --git a/collector/compile-benchmarks/exa-0.10.1/completions/completions.bash b/collector/compile-benchmarks/exa-0.10.1/completions/completions.bash deleted file mode 100644 index 4a370f377..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/completions/completions.bash +++ /dev/null @@ -1,42 +0,0 @@ -_exa() -{ - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - - case "$prev" in - -'?'|--help|-v|--version) - return - ;; - - -L|--level) - COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) - return - ;; - - -s|--sort) - COMPREPLY=( $( compgen -W 'name filename Name Filename size filesize extension Extension date time modified changed accessed created type inode oldest newest age none --' -- "$cur" ) ) - return - ;; - - -t|--time) - COMPREPLY=( $( compgen -W 'modified changed accessed created --' -- $cur ) ) - return - ;; - - --time-style) - COMPREPLY=( $( compgen -W 'default iso long-iso full-iso --' -- $cur ) ) - return - ;; - esac - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - ;; - - *) - _filedir - ;; - esac -} && -complete -o filenames -o bashdefault -F _exa exa diff --git a/collector/compile-benchmarks/exa-0.10.1/completions/completions.fish b/collector/compile-benchmarks/exa-0.10.1/completions/completions.fish deleted file mode 100755 index d26119678..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/completions/completions.fish +++ /dev/null @@ -1,87 +0,0 @@ -# Meta-stuff -complete -c exa -s 'v' -l 'version' -d "Show version of exa" -complete -c exa -s '?' -l 'help' -d "Show list of command-line options" - -# Display options -complete -c exa -s '1' -l 'oneline' -d "Display one entry per line" -complete -c exa -s 'l' -l 'long' -d "Display extended file metadata as a table" -complete -c exa -s 'G' -l 'grid' -d "Display entries in a grid" -complete -c exa -s 'x' -l 'across' -d "Sort the grid across, rather than downwards" -complete -c exa -s 'R' -l 'recurse' -d "Recurse into directories" -complete -c exa -s 'T' -l 'tree' -d "Recurse into directories as a tree" -complete -c exa -s 'F' -l 'classify' -d "Display type indicator by file names" -complete -c exa -l 'color' -d "When to use terminal colours" -complete -c exa -l 'colour' -d "When to use terminal colours" -complete -c exa -l 'color-scale' -d "Highlight levels of file sizes distinctly" -complete -c exa -l 'colour-scale' -d "Highlight levels of file sizes distinctly" -complete -c exa -l 'icons' -d "Display icons" -complete -c exa -l 'no-icons' -d "Don't display icons" - -# Filtering and sorting options -complete -c exa -l 'group-directories-first' -d "Sort directories before other files" -complete -c exa -l 'git-ignore' -d "Ignore files mentioned in '.gitignore'" -complete -c exa -s 'a' -l 'all' -d "Show hidden and 'dot' files" -complete -c exa -s 'd' -l 'list-dirs' -d "List directories like regular files" -complete -c exa -s 'L' -l 'level' -d "Limit the depth of recursion" -a "1 2 3 4 5 6 7 8 9" -complete -c exa -s 'r' -l 'reverse' -d "Reverse the sort order" -complete -c exa -s 's' -l 'sort' -x -d "Which field to sort by" -a " - accessed\t'Sort by file accessed time' - age\t'Sort by file modified time (newest first)' - changed\t'Sort by changed time' - created\t'Sort by file modified time' - date\t'Sort by file modified time' - ext\t'Sort by file extension' - Ext\t'Sort by file extension (uppercase first)' - extension\t'Sort by file extension' - Extension\t'Sort by file extension (uppercase first)' - filename\t'Sort by filename' - Filename\t'Sort by filename (uppercase first)' - inode\t'Sort by file inode' - modified\t'Sort by file modified time' - name\t'Sort by filename' - Name\t'Sort by filename (uppercase first)' - newest\t'Sort by file modified time (newest first)' - none\t'Do not sort files at all' - oldest\t'Sort by file modified time' - size\t'Sort by file size' - time\t'Sort by file modified time' - type\t'Sort by file type' -" - -complete -c exa -s 'I' -l 'ignore-glob' -d "Ignore files that match these glob patterns" -r -complete -c exa -s 'D' -l 'only-dirs' -d "List only directories" - -# Long view options -complete -c exa -s 'b' -l 'binary' -d "List file sizes with binary prefixes" -complete -c exa -s 'B' -l 'bytes' -d "List file sizes in bytes, without any prefixes" -complete -c exa -s 'g' -l 'group' -d "List each file's group" -complete -c exa -s 'h' -l 'header' -d "Add a header row to each column" -complete -c exa -s 'h' -l 'links' -d "List each file's number of hard links" -complete -c exa -s 'g' -l 'group' -d "List each file's inode number" -complete -c exa -s 'S' -l 'blocks' -d "List each file's number of filesystem blocks" -complete -c exa -s 't' -l 'time' -x -d "Which timestamp field to list" -a " - modified\t'Display modified time' - changed\t'Display changed time' - accessed\t'Display accessed time' - created\t'Display created time' -" -complete -c exa -s 'm' -l 'modified' -d "Use the modified timestamp field" -complete -c exa -s 'n' -l 'numeric' -d "List numeric user and group IDs." -complete -c exa -l 'changed' -d "Use the changed timestamp field" -complete -c exa -s 'u' -l 'accessed' -d "Use the accessed timestamp field" -complete -c exa -s 'U' -l 'created' -d "Use the created timestamp field" -complete -c exa -l 'time-style' -x -d "How to format timestamps" -a " - default\t'Use the default time style' - iso\t'Display brief ISO timestamps' - long-iso\t'Display longer ISO timestaps, up to the minute' - full-iso\t'Display full ISO timestamps, up to the nanosecond' -" -complete -c exa -l 'no-permissions' -d "Suppress the permissions field" -complete -c exa -l 'octal-permissions' -d "List each file's permission in octal format" -complete -c exa -l 'no-filesize' -d "Suppress the filesize field" -complete -c exa -l 'no-user' -d "Suppress the user field" -complete -c exa -l 'no-time' -d "Suppress the time field" - -# Optional extras -complete -c exa -l 'git' -d "List each file's Git status, if tracked" -complete -c exa -s '@' -l 'extended' -d "List each file's extended attributes and sizes" diff --git a/collector/compile-benchmarks/exa-0.10.1/completions/completions.zsh b/collector/compile-benchmarks/exa-0.10.1/completions/completions.zsh deleted file mode 100644 index f33928947..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/completions/completions.zsh +++ /dev/null @@ -1,59 +0,0 @@ -#compdef exa - -# Save this file as _exa in /usr/local/share/zsh/site-functions or in any -# other folder in $fpath. E. g. save it in a folder called ~/.zfunc and add a -# line containing `fpath=(~/.zfunc $fpath)` somewhere before `compinit` in your -# ~/.zshrc. - -__exa() { - # Give completions using the `_arguments` utility function with - # `-s` for option stacking like `exa -ab` for `exa -a -b` and - # `-S` for delimiting options with `--` like in `exa -- -a`. - _arguments -s -S \ - "(- *)"{-v,--version}"[Show version of exa]" \ - "(- *)"{-'\?',--help}"[Show list of command-line options]" \ - {-1,--oneline}"[Display one entry per line]" \ - {-l,--long}"[Display extended file metadata as a table]" \ - {-G,--grid}"[Display entries as a grid]" \ - {-x,--across}"[Sort the grid across, rather than downwards]" \ - {-R,--recurse}"[Recurse into directories]" \ - {-T,--tree}"[Recurse into directories as a tree]" \ - {-F,--classify}"[Display type indicator by file names]" \ - --colo{,u}r"[When to use terminal colours]" \ - --colo{,u}r-scale"[Highlight levels of file sizes distinctly]" \ - --icons"[Display icons]" \ - --no-icons"[Hide icons]" \ - --group-directories-first"[Sort directories before other files]" \ - --git-ignore"[Ignore files mentioned in '.gitignore']" \ - {-a,--all}"[Show hidden and 'dot' files]" \ - {-d,--list-dirs}"[List directories like regular files]" \ - {-D,--only-dirs}"[List only directories]" \ - {-L,--level}"+[Limit the depth of recursion]" \ - {-r,--reverse}"[Reverse the sort order]" \ - {-s,--sort}="[Which field to sort by]:(sort field):(accessed age changed created date extension Extension filename Filename inode modified oldest name Name newest none size time type)" \ - {-I,--ignore-glob}"[Ignore files that match these glob patterns]" \ - {-b,--binary}"[List file sizes with binary prefixes]" \ - {-B,--bytes}"[List file sizes in bytes, without any prefixes]" \ - --changed"[Use the changed timestamp field]" \ - {-g,--group}"[List each file's group]" \ - {-h,--header}"[Add a header row to each column]" \ - {-H,--links}"[List each file's number of hard links]" \ - {-i,--inode}"[List each file's inode number]" \ - {-m,--modified}"[Use the modified timestamp field]" \ - {-n,--numeric}"[List numeric user and group IDs.]" \ - {-S,--blocks}"[List each file's number of filesystem blocks]" \ - {-t,--time}="[Which time field to show]:(time field):(accessed changed created modified)" \ - --time-style="[How to format timestamps]:(time style):(default iso long-iso full-iso)" \ - --no-permissions"[Suppress the permissions field]" \ - --octal-permissions"[List each file's permission in octal format]" \ - --no-filesize"[Suppress the filesize field]" \ - --no-user"[Suppress the user field]" \ - --no-time"[Suppress the time field]" \ - {-u,--accessed}"[Use the accessed timestamp field]" \ - {-U,--created}"[Use the created timestamp field]" \ - --git"[List each file's Git status, if tracked]" \ - {-@,--extended}"[List each file's extended attributes and sizes]" \ - '*:filename:_files' -} - -__exa diff --git a/collector/compile-benchmarks/exa-0.10.1/man/exa.1.md b/collector/compile-benchmarks/exa-0.10.1/man/exa.1.md deleted file mode 100644 index bd91a7c02..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/man/exa.1.md +++ /dev/null @@ -1,260 +0,0 @@ -% exa(1) v0.9.0 - - - - - - -NAME -==== - -exa — a modern replacement for ls - - -SYNOPSIS -======== - -`exa [options] [files...]` - -**exa** is a modern replacement for `ls`. -It uses colours for information by default, helping you distinguish between many types of files, such as whether you are the owner, or in the owning group. - -It also has extra features not present in the original `ls`, such as viewing the Git status for a directory, or recursing into directories with a tree view. - - -EXAMPLES -======== - -`exa` -: Lists the contents of the current directory in a grid. - -`exa --oneline --reverse --sort=size` -: Displays a list of files with the largest at the top. - -`exa --long --header --inode --git` -: Displays a table of files with a header, showing each file’s metadata, inode, and Git status. - -`exa --long --tree --level=3` -: Displays a tree of files, three levels deep, as well as each file’s metadata. - - -DISPLAY OPTIONS -=============== - -`-1`, `--oneline` -: Display one entry per line. - -`-F`, `--classify` -: Display file kind indicators next to file names. - -`-G`, `--grid` -: Display entries as a grid (default). - -`-l`, `--long` -: Display extended file metadata as a table. - -`-R`, `--recurse` -: Recurse into directories. - -`-T`, `--tree` -: Recurse into directories as a tree. - -`-x`, `--across` -: Sort the grid across, rather than downwards. - -`--color`, `--colour=WHEN` -: When to use terminal colours. -Valid settings are ‘`always`’, ‘`automatic`’, and ‘`never`’. - -`--color-scale`, `--colour-scale` -: Colour file sizes on a scale. - -`--icons` -: Display icons next to file names. - -`--no-icons` -: Don't display icons. (Always overrides --icons) - - -FILTERING AND SORTING OPTIONS -============================= - -`-a`, `--all` -: Show hidden and “dot” files. -Use this twice to also show the ‘`.`’ and ‘`..`’ directories. - -`-d`, `--list-dirs` -: List directories as regular files, rather than recursing and listing their contents. - -`-L`, `--level=DEPTH` -: Limit the depth of recursion. - -`-r`, `--reverse` -: Reverse the sort order. - -`-s`, `--sort=SORT_FIELD` -: Which field to sort by. - -Valid sort fields are ‘`name`’, ‘`Name`’, ‘`extension`’, ‘`Extension`’, ‘`size`’, ‘`modified`’, ‘`changed`’, ‘`accessed`’, ‘`created`’, ‘`inode`’, ‘`type`’, and ‘`none`’. - -The `modified` sort field has the aliases ‘`date`’, ‘`time`’, and ‘`newest`’, and its reverse order has the aliases ‘`age`’ and ‘`oldest`’. - -Sort fields starting with a capital letter will sort uppercase before lowercase: ‘A’ then ‘B’ then ‘a’ then ‘b’. Fields starting with a lowercase letter will mix them: ‘A’ then ‘a’ then ‘B’ then ‘b’. - -`-I`, `--ignore-glob=GLOBS` -: Glob patterns, pipe-separated, of files to ignore. - -`--git-ignore` [if exa was built with git support] -: Do not list files that are ignored by Git. - -`--group-directories-first` -: List directories before other files. - -`-D`, `--only-dirs` -: List only directories, not files. - - -LONG VIEW OPTIONS -================= - -These options are available when running with `--long` (`-l`): - -`-b`, `--binary` -: List file sizes with binary prefixes. - -`-B`, `--bytes` -: List file sizes in bytes, without any prefixes. - -`--changed` -: Use the changed timestamp field. - -`-g`, `--group` -: List each file’s group. - -`-h`, `--header` -: Add a header row to each column. - -`-H`, `--links` -: List each file’s number of hard links. - -`-i`, `--inode` -: List each file’s inode number. - -`-m`, `--modified` -: Use the modified timestamp field. - -`-n`, `--numeric` -: List numeric user and group IDs. - -`-S`, `--blocks` -: List each file’s number of file system blocks. - -`-t`, `--time=WORD` -: Which timestamp field to list. - -: Valid timestamp fields are ‘`modified`’, ‘`changed`’, ‘`accessed`’, and ‘`created`’. - -`--time-style=STYLE` -: How to format timestamps. - -: Valid timestamp styles are ‘`default`’, ‘`iso`’, ‘`long-iso`’, and ‘`full-iso`’. - -`-u`, `--accessed` -: Use the accessed timestamp field. - -`-U`, `--created` -: Use the created timestamp field. - -`--no-permissions` -: Suppress the permissions field. - -`--no-filesize` -: Suppress the file size field. - -`--no-user` -: Suppress the user field. - -`--no-time` -: Suppress the time field. - -`-@`, `--extended` -: List each file’s extended attributes and sizes. - -`--git` [if exa was built with git support] -: List each file’s Git status, if tracked. - -This adds a two-character column indicating the staged and unstaged statuses respectively. The status character can be ‘`-`’ for not modified, ‘`M`’ for a modified file, ‘`N`’ for a new file, ‘`D`’ for deleted, ‘`R`’ for renamed, ‘`T`’ for type-change, ‘`I`’ for ignored, and ‘`U`’ for conflicted. - -Directories will be shown to have the status of their contents, which is how ‘deleted’ is possible: if a directory contains a file that has a certain status, it will be shown to have that status. - - -ENVIRONMENT VARIABLES -===================== - -exa responds to the following environment variables: - -## `COLUMNS` - -Overrides the width of the terminal, in characters. - -For example, ‘`COLUMNS=80 exa`’ will show a grid view with a maximum width of 80 characters. - -This option won’t do anything when exa’s output doesn’t wrap, such as when using the `--long` view. - -## `EXA_STRICT` - -Enables _strict mode_, which will make exa error when two command-line options are incompatible. - -Usually, options can override each other going right-to-left on the command line, so that exa can be given aliases: creating an alias ‘`exa=exa --sort=ext`’ then running ‘`exa --sort=size`’ with that alias will run ‘`exa --sort=ext --sort=size`’, and the sorting specified by the user will override the sorting specified by the alias. - -In strict mode, the two options will not co-operate, and exa will error. - -This option is intended for use with automated scripts and other situations where you want to be certain you’re typing in the right command. - -## `EXA_GRID_ROWS` - -Limits the grid-details view (‘`exa --grid --long`’) so it’s only activated when at least the given number of rows of output would be generated. - -With widescreen displays, it’s possible for the grid to look very wide and sparse, on just one or two lines with none of the columns lining up. -By specifying a minimum number of rows, you can only use the view if it’s going to be worth using. - -## `EXA_ICON_SPACING` - -Specifies the number of spaces to print between an icon (see the ‘`--icons`’ option) and its file name. - -Different terminals display icons differently, as they usually take up more than one character width on screen, so there’s no “standard” number of spaces that exa can use to separate an icon from text. One space may place the icon too close to the text, and two spaces may place it too far away. So the choice is left up to the user to configure depending on their terminal emulator. - -## `LS_COLORS`, `EXA_COLORS` - -Specifies the colour scheme used to highlight files based on their name and kind, as well as highlighting metadata and parts of the UI. - -For more information on the format of these environment variables, see the `exa_colors(5)` manual page. - - -EXIT STATUSES -============= - -0 -: If everything goes OK. - -1 -: If there was an I/O error during operation. - -3 -: If there was a problem with the command-line arguments. - - -AUTHOR -====== - -exa is maintained by Benjamin ‘ogham’ Sago and many other contributors. - -**Website:** `https://the.exa.website/` \ -**Source code:** `https://github.com/ogham/exa` \ -**Contributors:** `https://github.com/ogham/exa/graphs/contributors` - - -SEE ALSO -======== - -- `exa_colors(5)` diff --git a/collector/compile-benchmarks/exa-0.10.1/man/exa_colors.5.md b/collector/compile-benchmarks/exa-0.10.1/man/exa_colors.5.md deleted file mode 100644 index c775f0a11..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/man/exa_colors.5.md +++ /dev/null @@ -1,282 +0,0 @@ -% exa_colors(5) v0.9.0 - - - - - - -NAME -==== - -exa_colors — customising the file and UI colours of exa - - -SYNOPSIS -======== - -The `EXA_COLORS` environment variable can be used to customise the colours that `exa` uses to highlight file names, file metadata, and parts of the UI. - -You can use the `dircolors` program to generate a script that sets the variable from an input file, or if you don’t mind editing long strings of text, you can just type it out directly. These variables have the following structure: - -- A list of key-value pairs separated by ‘`=`’, such as ‘`*.txt=32`’. -- Multiple ANSI formatting codes are separated by ‘`;`’, such as ‘`*.txt=32;1;4`’. -- Finally, multiple pairs are separated by ‘`:`’, such as ‘`*.txt=32:*.mp3=1;35`’. - -The key half of the pair can either be a two-letter code or a file glob, and anything that’s not a valid code will be treated as a glob, including keys that happen to be two letters long. - - -EXAMPLES -======== - -`EXA_COLORS="uu=0:gu=0"` -: Disable the “current user” highlighting - -`EXA_COLORS="da=32"` -: Turn the date column green - -`EXA_COLORS="Vagrantfile=1;4;33"` -: Highlight Vagrantfiles - -`EXA_COLORS="*.zip=38;5;125"` -: Override the existing zip colour - -`EXA_COLORS="*.md=38;5;121:*.log=38;5;248"` -: Markdown files a shade of green, log files a shade of grey - - -LIST OF CODES -============= - -`LS_COLORS` can use these ten codes: - -`di` -: directories - -`ex` -: executable files - -`fi` -: regular files - -`pi` -: named pipes - -`so` -: sockets - -`bd` -: block devices - -`cd` -: character devices - -`ln` -: symlinks - -`or` -: symlinks with no target - - -`EXA_COLORS` can use many more: - -`ur` -: the user-read permission bit - -`uw` -: the user-write permission bit - -`ux` -: the user-execute permission bit for regular files - -`ue` -: the user-execute for other file kinds - -`gr` -: the group-read permission bit - -`gw` -: the group-write permission bit - -`gx` -: the group-execute permission bit - -`tr` -: the others-read permission bit - -`tw` -: the others-write permission bit - -`tx` -: the others-execute permission bit - -`su` -: setuid, setgid, and sticky permission bits for files - -`sf` -: setuid, setgid, and sticky for other file kinds - -`xa` -: the extended attribute indicator - -`sn` -: the numbers of a file’s size (sets `nb`, `nk`, `nm`, `ng` and `nh`) - -`nb` -: the numbers of a file’s size if it is lower than 1 KB/Kib - -`nk` -: the numbers of a file’s size if it is between 1 KB/KiB and 1 MB/MiB - -`nm` -: the numbers of a file’s size if it is between 1 MB/MiB and 1 GB/GiB - -`ng` -: the numbers of a file’s size if it is between 1 GB/GiB and 1 TB/TiB - -`nt` -: the numbers of a file’s size if it is 1 TB/TiB or higher - -`sb` -: the units of a file’s size (sets `ub`, `uk`, `um`, `ug` and `uh`) - -`ub` -: the units of a file’s size if it is lower than 1 KB/Kib - -`uk` -: the units of a file’s size if it is between 1 KB/KiB and 1 MB/MiB - -`um` -: the units of a file’s size if it is between 1 MB/MiB and 1 GB/GiB - -`ug` -: the units of a file’s size if it is between 1 GB/GiB and 1 TB/TiB - -`ut` -: the units of a file’s size if it is 1 TB/TiB or higher - -`df` -: a device’s major ID - -`ds` -: a device’s minor ID - -`uu` -: a user that’s you - -`un` -: a user that’s someone else - -`gu` -: a group that you belong to - -`gn` -: a group you aren’t a member of - -`lc` -: a number of hard links - -`lm` -: a number of hard links for a regular file with at least two - -`ga` -: a new flag in Git - -`gm` -: a modified flag in Git - -`gd` -: a deleted flag in Git - -`gv` -: a renamed flag in Git - -`gt` -: a modified metadata flag in Git - -`xx` -: “punctuation”, including many background UI elements - -`da` -: a file’s date - -`in` -: a file’s inode number - -`bl` -: a file’s number of blocks - -`hd` -: the header row of a table - -`lp` -: the path of a symlink - -`cc` -: an escaped character in a filename - -`bO` -: the overlay style for broken symlink paths - -Values in `EXA_COLORS` override those given in `LS_COLORS`, so you don’t need to re-write an existing `LS_COLORS` variable with proprietary extensions. - - -LIST OF STYLES -============== - -Unlike some versions of `ls`, the given ANSI values must be valid colour codes: exa won’t just print out whichever characters are given. - -The codes accepted by exa are: - -`1` -: for bold - -`4` -: for underline - -`31` -: for red text - -`32` -: for green text - -`33` -: for yellow text - -`34` -: for blue text - -`35` -: for purple text - -`36` -: for cyan text - -`37` -: for white text - -`38;5;nnn` -: for a colour from 0 to 255 (replace the `nnn` part) - -Many terminals will treat bolded text as a different colour, or at least provide the option to. - -exa provides its own built-in set of file extension mappings that cover a large range of common file extensions, including documents, archives, media, and temporary files. -Any mappings in the environment variables will override this default set: running exa with `LS_COLORS="*.zip=32"` will turn zip files green but leave the colours of other compressed files alone. - -You can also disable this built-in set entirely by including a `reset` entry at the beginning of `EXA_COLORS`. -So setting `EXA_COLORS="reset:*.txt=31"` will highlight only text files; setting `EXA_COLORS="reset"` will highlight nothing. - - -AUTHOR -====== - -exa is maintained by Benjamin ‘ogham’ Sago and many other contributors. - -**Website:** `https://the.exa.website/` \ -**Source code:** `https://github.com/ogham/exa` \ -**Contributors:** `https://github.com/ogham/exa/graphs/contributors` - - -SEE ALSO -======== - -- `exa(1)` diff --git a/collector/compile-benchmarks/exa-0.10.1/perf-config.json b/collector/compile-benchmarks/exa-0.10.1/perf-config.json deleted file mode 100644 index ef9524715..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/perf-config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "category": "primary", - "artifact": "binary" -} diff --git a/collector/compile-benchmarks/exa-0.10.1/snap/.gitignore b/collector/compile-benchmarks/exa-0.10.1/snap/.gitignore deleted file mode 100644 index 48a6af0d3..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/snap/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.snapcraft diff --git a/collector/compile-benchmarks/exa-0.10.1/snap/snapcraft.yaml b/collector/compile-benchmarks/exa-0.10.1/snap/snapcraft.yaml deleted file mode 100644 index 36a6b214d..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/snap/snapcraft.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: exa -version: 'latest' -summary: Replacement for 'ls' written in Rust -description: | - It uses colours for information by default, helping you distinguish between - many types of files, such as whether you are the owner, or in the owning - group. It also has extra features not present in the original ls, such as - viewing the Git status for a directory, or recursing into directories with a - tree view. exa is written in Rust, so it’s small, fast, and portable. - -grade: stable -confinement: classic - -apps: - exa: - command: exa - -parts: - exa: - plugin: rust - source: . - stage-packages: - - libgit2-24 - - cmake - - libz-dev diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/dir.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/dir.rs deleted file mode 100644 index 7f7b067be..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/dir.rs +++ /dev/null @@ -1,211 +0,0 @@ -use crate::fs::feature::git::GitCache; -use crate::fs::fields::GitStatus; -use std::io; -use std::fs; -use std::path::{Path, PathBuf}; -use std::slice::Iter as SliceIter; - -use log::*; - -use crate::fs::File; - - -/// A **Dir** provides a cached list of the file paths in a directory that’s -/// being listed. -/// -/// This object gets passed to the Files themselves, in order for them to -/// check the existence of surrounding files, then highlight themselves -/// accordingly. (See `File#get_source_files`) -pub struct Dir { - - /// A vector of the files that have been read from this directory. - contents: Vec, - - /// The path that was read. - pub path: PathBuf, -} - -impl Dir { - - /// Create a new Dir object filled with all the files in the directory - /// pointed to by the given path. Fails if the directory can’t be read, or - /// isn’t actually a directory, or if there’s an IO error that occurs at - /// any point. - /// - /// The `read_dir` iterator doesn’t actually yield the `.` and `..` - /// entries, so if the user wants to see them, we’ll have to add them - /// ourselves after the files have been read. - pub fn read_dir(path: PathBuf) -> io::Result { - info!("Reading directory {:?}", &path); - - let contents = fs::read_dir(&path)? - .map(|result| result.map(|entry| entry.path())) - .collect::>()?; - - Ok(Self { contents, path }) - } - - /// Produce an iterator of IO results of trying to read all the files in - /// this directory. - pub fn files<'dir, 'ig>(&'dir self, dots: DotFilter, git: Option<&'ig GitCache>, git_ignoring: bool) -> Files<'dir, 'ig> { - Files { - inner: self.contents.iter(), - dir: self, - dotfiles: dots.shows_dotfiles(), - dots: dots.dots(), - git, - git_ignoring, - } - } - - /// Whether this directory contains a file with the given path. - pub fn contains(&self, path: &Path) -> bool { - self.contents.iter().any(|p| p.as_path() == path) - } - - /// Append a path onto the path specified by this directory. - pub fn join(&self, child: &Path) -> PathBuf { - self.path.join(child) - } -} - - -/// Iterator over reading the contents of a directory as `File` objects. -pub struct Files<'dir, 'ig> { - - /// The internal iterator over the paths that have been read already. - inner: SliceIter<'dir, PathBuf>, - - /// The directory that begat those paths. - dir: &'dir Dir, - - /// Whether to include dotfiles in the list. - dotfiles: bool, - - /// Whether the `.` or `..` directories should be produced first, before - /// any files have been listed. - dots: DotsNext, - - git: Option<&'ig GitCache>, - - git_ignoring: bool, -} - -impl<'dir, 'ig> Files<'dir, 'ig> { - fn parent(&self) -> PathBuf { - // We can’t use `Path#parent` here because all it does is remove the - // last path component, which is no good for us if the path is - // relative. For example, while the parent of `/testcases/files` is - // `/testcases`, the parent of `.` is an empty path. Adding `..` on - // the end is the only way to get to the *actual* parent directory. - self.dir.path.join("..") - } - - /// Go through the directory until we encounter a file we can list (which - /// varies depending on the dotfile visibility flag) - fn next_visible_file(&mut self) -> Option, (PathBuf, io::Error)>> { - loop { - if let Some(path) = self.inner.next() { - let filename = File::filename(path); - if ! self.dotfiles && filename.starts_with('.') { - continue; - } - - if self.git_ignoring { - let git_status = self.git.map(|g| g.get(path, false)).unwrap_or_default(); - if git_status.unstaged == GitStatus::Ignored { - continue; - } - } - - return Some(File::from_args(path.clone(), self.dir, filename) - .map_err(|e| (path.clone(), e))) - } - else { - return None - } - } - } -} - -/// The dot directories that need to be listed before actual files, if any. -/// If these aren’t being printed, then `FilesNext` is used to skip them. -enum DotsNext { - - /// List the `.` directory next. - Dot, - - /// List the `..` directory next. - DotDot, - - /// Forget about the dot directories and just list files. - Files, -} - -impl<'dir, 'ig> Iterator for Files<'dir, 'ig> { - type Item = Result, (PathBuf, io::Error)>; - - fn next(&mut self) -> Option { - match self.dots { - DotsNext::Dot => { - self.dots = DotsNext::DotDot; - Some(File::new_aa_current(self.dir) - .map_err(|e| (Path::new(".").to_path_buf(), e))) - } - - DotsNext::DotDot => { - self.dots = DotsNext::Files; - Some(File::new_aa_parent(self.parent(), self.dir) - .map_err(|e| (self.parent(), e))) - } - - DotsNext::Files => { - self.next_visible_file() - } - } - } -} - - -/// Usually files in Unix use a leading dot to be hidden or visible, but two -/// entries in particular are “extra-hidden”: `.` and `..`, which only become -/// visible after an extra `-a` option. -#[derive(PartialEq, Debug, Copy, Clone)] -pub enum DotFilter { - - /// Shows files, dotfiles, and `.` and `..`. - DotfilesAndDots, - - /// Show files and dotfiles, but hide `.` and `..`. - Dotfiles, - - /// Just show files, hiding anything beginning with a dot. - JustFiles, -} - -impl Default for DotFilter { - fn default() -> Self { - Self::JustFiles - } -} - -impl DotFilter { - - /// Whether this filter should show dotfiles in a listing. - fn shows_dotfiles(self) -> bool { - match self { - Self::JustFiles => false, - Self::Dotfiles => true, - Self::DotfilesAndDots => true, - } - } - - /// Whether this filter should add dot directories to a listing. - fn dots(self) -> DotsNext { - match self { - Self::JustFiles => DotsNext::Files, - Self::Dotfiles => DotsNext::Files, - Self::DotfilesAndDots => DotsNext::Dot, - } - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/dir_action.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/dir_action.rs deleted file mode 100644 index 26e78d3a8..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/dir_action.rs +++ /dev/null @@ -1,82 +0,0 @@ -//! What to do when encountering a directory? - -/// The action to take when trying to list a file that turns out to be a -/// directory. -/// -/// By default, exa will display the information about files passed in as -/// command-line arguments, with one file per entry. However, if a directory -/// is passed in, exa assumes that the user wants to see its contents, rather -/// than the directory itself. -/// -/// This can get annoying sometimes: if a user does `exa ~/Downloads/img-*` -/// to see the details of every file starting with `img-`, any directories -/// that happen to start with the same will be listed after the files at -/// the end in a separate block. By listing directories as files, their -/// directory status will be ignored, and both will be listed side-by-side. -/// -/// These two modes have recursive analogues in the “recurse” and “tree” -/// modes. Here, instead of just listing the directories, exa will descend -/// into them and print out their contents. The recurse mode does this by -/// having extra output blocks at the end, while the tree mode will show -/// directories inline, with their contents immediately underneath. -#[derive(PartialEq, Debug, Copy, Clone)] -pub enum DirAction { - - /// This directory should be listed along with the regular files, instead - /// of having its contents queried. - AsFile, - - /// This directory should not be listed, and should instead be opened and - /// *its* files listed separately. This is the default behaviour. - List, - - /// This directory should be listed along with the regular files, and then - /// its contents should be listed afterward. The recursive contents of - /// *those* contents are dictated by the options argument. - Recurse(RecurseOptions), -} - -impl DirAction { - - /// Gets the recurse options, if this dir action has any. - pub fn recurse_options(self) -> Option { - match self { - Self::Recurse(o) => Some(o), - _ => None, - } - } - - /// Whether to treat directories as regular files or not. - pub fn treat_dirs_as_files(self) -> bool { - match self { - Self::AsFile => true, - Self::Recurse(o) => o.tree, - _ => false, - } - } -} - - -/// The options that determine how to recurse into a directory. -#[derive(PartialEq, Debug, Copy, Clone)] -pub struct RecurseOptions { - - /// Whether recursion should be done as a tree or as multiple individual - /// views of files. - pub tree: bool, - - /// The maximum number of times that recursion should descend to, if one - /// is specified. - pub max_depth: Option, -} - -impl RecurseOptions { - - /// Returns whether a directory of the given depth would be too deep. - pub fn is_too_deep(self, depth: usize) -> bool { - match self.max_depth { - None => false, - Some(d) => d <= depth - } - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/git.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/git.rs deleted file mode 100644 index 40bc80db5..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/git.rs +++ /dev/null @@ -1,328 +0,0 @@ -//! Getting the Git status of files and directories. - -use std::path::{Path, PathBuf}; -use std::sync::Mutex; - -use log::*; - -use crate::fs::fields as f; - - -/// A **Git cache** is assembled based on the user’s input arguments. -/// -/// This uses vectors to avoid the overhead of hashing: it’s not worth it when the -/// expected number of Git repositories per exa invocation is 0 or 1... -pub struct GitCache { - - /// A list of discovered Git repositories and their paths. - repos: Vec, - - /// Paths that we’ve confirmed do not have Git repositories underneath them. - misses: Vec, -} - -impl GitCache { - pub fn has_anything_for(&self, index: &Path) -> bool { - self.repos.iter().any(|e| e.has_path(index)) - } - - pub fn get(&self, index: &Path, prefix_lookup: bool) -> f::Git { - self.repos.iter() - .find(|e| e.has_path(index)) - .map(|repo| repo.search(index, prefix_lookup)) - .unwrap_or_default() - } -} - -use std::iter::FromIterator; -impl FromIterator for GitCache { - fn from_iter(iter: I) -> Self - where I: IntoIterator - { - let iter = iter.into_iter(); - let mut git = Self { - repos: Vec::with_capacity(iter.size_hint().0), - misses: Vec::new(), - }; - - for path in iter { - if git.misses.contains(&path) { - debug!("Skipping {:?} because it already came back Gitless", path); - } - else if git.repos.iter().any(|e| e.has_path(&path)) { - debug!("Skipping {:?} because we already queried it", path); - } - else { - match GitRepo::discover(path) { - Ok(r) => { - if let Some(r2) = git.repos.iter_mut().find(|e| e.has_workdir(&r.workdir)) { - debug!("Adding to existing repo (workdir matches with {:?})", r2.workdir); - r2.extra_paths.push(r.original_path); - continue; - } - - debug!("Discovered new Git repo"); - git.repos.push(r); - } - Err(miss) => { - git.misses.push(miss) - } - } - } - } - - git - } -} - - -/// A **Git repository** is one we’ve discovered somewhere on the filesystem. -pub struct GitRepo { - - /// The queryable contents of the repository: either a `git2` repo, or the - /// cached results from when we queried it last time. - contents: Mutex, - - /// The working directory of this repository. - /// This is used to check whether two repositories are the same. - workdir: PathBuf, - - /// The path that was originally checked to discover this repository. - /// This is as important as the extra_paths (it gets checked first), but - /// is separate to avoid having to deal with a non-empty Vec. - original_path: PathBuf, - - /// Any other paths that were checked only to result in this same - /// repository. - extra_paths: Vec, -} - -/// A repository’s queried state. -enum GitContents { - - /// All the interesting Git stuff goes through this. - Before { - repo: git2::Repository, - }, - - /// Temporary value used in `repo_to_statuses` so we can move the - /// repository out of the `Before` variant. - Processing, - - /// The data we’ve extracted from the repository, but only after we’ve - /// actually done so. - After { - statuses: Git, - }, -} - -impl GitRepo { - - /// Searches through this repository for a path (to a file or directory, - /// depending on the prefix-lookup flag) and returns its Git status. - /// - /// Actually querying the `git2` repository for the mapping of paths to - /// Git statuses is only done once, and gets cached so we don’t need to - /// re-query the entire repository the times after that. - /// - /// The temporary `Processing` enum variant is used after the `git2` - /// repository is moved out, but before the results have been moved in! - /// See - fn search(&self, index: &Path, prefix_lookup: bool) -> f::Git { - use std::mem::replace; - - let mut contents = self.contents.lock().unwrap(); - if let GitContents::After { ref statuses } = *contents { - debug!("Git repo {:?} has been found in cache", &self.workdir); - return statuses.status(index, prefix_lookup); - } - - debug!("Querying Git repo {:?} for the first time", &self.workdir); - let repo = replace(&mut *contents, GitContents::Processing).inner_repo(); - let statuses = repo_to_statuses(&repo, &self.workdir); - let result = statuses.status(index, prefix_lookup); - let _processing = replace(&mut *contents, GitContents::After { statuses }); - result - } - - /// Whether this repository has the given working directory. - fn has_workdir(&self, path: &Path) -> bool { - self.workdir == path - } - - /// Whether this repository cares about the given path at all. - fn has_path(&self, path: &Path) -> bool { - path.starts_with(&self.original_path) || self.extra_paths.iter().any(|e| path.starts_with(e)) - } - - /// Searches for a Git repository at any point above the given path. - /// Returns the original buffer if none is found. - fn discover(path: PathBuf) -> Result { - info!("Searching for Git repository above {:?}", path); - let repo = match git2::Repository::discover(&path) { - Ok(r) => r, - Err(e) => { - error!("Error discovering Git repositories: {:?}", e); - return Err(path); - } - }; - - if let Some(workdir) = repo.workdir() { - let workdir = workdir.to_path_buf(); - let contents = Mutex::new(GitContents::Before { repo }); - Ok(Self { contents, workdir, original_path: path, extra_paths: Vec::new() }) - } - else { - warn!("Repository has no workdir?"); - Err(path) - } - } -} - - -impl GitContents { - /// Assumes that the repository hasn’t been queried, and extracts it - /// (consuming the value) if it has. This is needed because the entire - /// enum variant gets replaced when a repo is queried (see above). - fn inner_repo(self) -> git2::Repository { - if let Self::Before { repo } = self { - repo - } - else { - unreachable!("Tried to extract a non-Repository") - } - } -} - -/// Iterates through a repository’s statuses, consuming it and returning the -/// mapping of files to their Git status. -/// We will have already used the working directory at this point, so it gets -/// passed in rather than deriving it from the `Repository` again. -fn repo_to_statuses(repo: &git2::Repository, workdir: &Path) -> Git { - let mut statuses = Vec::new(); - - info!("Getting Git statuses for repo with workdir {:?}", workdir); - match repo.statuses(None) { - Ok(es) => { - for e in es.iter() { - let path = workdir.join(Path::new(e.path().unwrap())); - let elem = (path, e.status()); - statuses.push(elem); - } - } - Err(e) => { - error!("Error looking up Git statuses: {:?}", e); - } - } - - Git { statuses } -} - -// The `repo.statuses` call above takes a long time. exa debug output: -// -// 20.311276 INFO:exa::fs::feature::git: Getting Git statuses for repo with workdir "/vagrant/" -// 20.799610 DEBUG:exa::output::table: Getting Git status for file "./Cargo.toml" -// -// Even inserting another logging line immediately afterwards doesn’t make it -// look any faster. - - -/// Container of Git statuses for all the files in this folder’s Git repository. -struct Git { - statuses: Vec<(PathBuf, git2::Status)>, -} - -impl Git { - - /// Get either the file or directory status for the given path. - /// “Prefix lookup” means that it should report an aggregate status of all - /// paths starting with the given prefix (in other words, a directory). - fn status(&self, index: &Path, prefix_lookup: bool) -> f::Git { - if prefix_lookup { self.dir_status(index) } - else { self.file_status(index) } - } - - /// Get the user-facing status of a file. - /// We check the statuses directly applying to a file, and for the ignored - /// status we check if any of its parents directories is ignored by git. - fn file_status(&self, file: &Path) -> f::Git { - let path = reorient(file); - - let s = self.statuses.iter() - .filter(|p| if p.1 == git2::Status::IGNORED { - path.starts_with(&p.0) - } else { - p.0 == path - }) - .fold(git2::Status::empty(), |a, b| a | b.1); - - let staged = index_status(s); - let unstaged = working_tree_status(s); - f::Git { staged, unstaged } - } - - /// Get the combined, user-facing status of a directory. - /// Statuses are aggregating (for example, a directory is considered - /// modified if any file under it has the status modified), except for - /// ignored status which applies to files under (for example, a directory - /// is considered ignored if one of its parent directories is ignored). - fn dir_status(&self, dir: &Path) -> f::Git { - let path = reorient(dir); - - let s = self.statuses.iter() - .filter(|p| if p.1 == git2::Status::IGNORED { - path.starts_with(&p.0) - } else { - p.0.starts_with(&path) - }) - .fold(git2::Status::empty(), |a, b| a | b.1); - - let staged = index_status(s); - let unstaged = working_tree_status(s); - f::Git { staged, unstaged } - } -} - - -/// Converts a path to an absolute path based on the current directory. -/// Paths need to be absolute for them to be compared properly, otherwise -/// you’d ask a repo about “./README.md” but it only knows about -/// “/vagrant/README.md”, prefixed by the workdir. -fn reorient(path: &Path) -> PathBuf { - use std::env::current_dir; - - // TODO: I’m not 100% on this func tbh - let path = match current_dir() { - Err(_) => Path::new(".").join(&path), - Ok(dir) => dir.join(&path), - }; - - path.canonicalize().unwrap_or(path) -} - -/// The character to display if the file has been modified, but not staged. -fn working_tree_status(status: git2::Status) -> f::GitStatus { - match status { - s if s.contains(git2::Status::WT_NEW) => f::GitStatus::New, - s if s.contains(git2::Status::WT_MODIFIED) => f::GitStatus::Modified, - s if s.contains(git2::Status::WT_DELETED) => f::GitStatus::Deleted, - s if s.contains(git2::Status::WT_RENAMED) => f::GitStatus::Renamed, - s if s.contains(git2::Status::WT_TYPECHANGE) => f::GitStatus::TypeChange, - s if s.contains(git2::Status::IGNORED) => f::GitStatus::Ignored, - s if s.contains(git2::Status::CONFLICTED) => f::GitStatus::Conflicted, - _ => f::GitStatus::NotModified, - } -} - -/// The character to display if the file has been modified and the change -/// has been staged. -fn index_status(status: git2::Status) -> f::GitStatus { - match status { - s if s.contains(git2::Status::INDEX_NEW) => f::GitStatus::New, - s if s.contains(git2::Status::INDEX_MODIFIED) => f::GitStatus::Modified, - s if s.contains(git2::Status::INDEX_DELETED) => f::GitStatus::Deleted, - s if s.contains(git2::Status::INDEX_RENAMED) => f::GitStatus::Renamed, - s if s.contains(git2::Status::INDEX_TYPECHANGE) => f::GitStatus::TypeChange, - _ => f::GitStatus::NotModified, - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/mod.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/mod.rs deleted file mode 100644 index 10f491598..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/mod.rs +++ /dev/null @@ -1,33 +0,0 @@ -pub mod xattr; - -#[cfg(feature = "git")] -pub mod git; - -#[cfg(not(feature = "git"))] -pub mod git { - use std::iter::FromIterator; - use std::path::{Path, PathBuf}; - - use crate::fs::fields as f; - - - pub struct GitCache; - - impl FromIterator for GitCache { - fn from_iter(_iter: I) -> Self - where I: IntoIterator - { - Self - } - } - - impl GitCache { - pub fn has_anything_for(&self, _index: &Path) -> bool { - false - } - - pub fn get(&self, _index: &Path, _prefix_lookup: bool) -> f::Git { - unreachable!(); - } - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/xattr.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/xattr.rs deleted file mode 100644 index b819d2479..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/feature/xattr.rs +++ /dev/null @@ -1,287 +0,0 @@ -//! Extended attribute support for Darwin and Linux systems. - -#![allow(trivial_casts)] // for ARM - -use std::cmp::Ordering; -use std::io; -use std::path::Path; - - -pub const ENABLED: bool = cfg!(any(target_os = "macos", target_os = "linux")); - - -pub trait FileAttributes { - fn attributes(&self) -> io::Result>; - fn symlink_attributes(&self) -> io::Result>; -} - -#[cfg(any(target_os = "macos", target_os = "linux"))] -impl FileAttributes for Path { - fn attributes(&self) -> io::Result> { - list_attrs(&lister::Lister::new(FollowSymlinks::Yes), self) - } - - fn symlink_attributes(&self) -> io::Result> { - list_attrs(&lister::Lister::new(FollowSymlinks::No), self) - } -} - -#[cfg(not(any(target_os = "macos", target_os = "linux")))] -impl FileAttributes for Path { - fn attributes(&self) -> io::Result> { - Ok(Vec::new()) - } - - fn symlink_attributes(&self) -> io::Result> { - Ok(Vec::new()) - } -} - - -/// Attributes which can be passed to `Attribute::list_with_flags` -#[cfg(any(target_os = "macos", target_os = "linux"))] -#[derive(Copy, Clone)] -pub enum FollowSymlinks { - Yes, - No, -} - -/// Extended attribute -#[derive(Debug, Clone)] -pub struct Attribute { - pub name: String, - pub size: usize, -} - - -#[cfg(any(target_os = "macos", target_os = "linux"))] -pub fn list_attrs(lister: &lister::Lister, path: &Path) -> io::Result> { - use std::ffi::CString; - - let c_path = match path.to_str().and_then(|s| CString::new(s).ok()) { - Some(cstring) => cstring, - None => { - return Err(io::Error::new(io::ErrorKind::Other, "Error: path somehow contained a NUL?")); - } - }; - - let bufsize = lister.listxattr_first(&c_path); - match bufsize.cmp(&0) { - Ordering::Less => return Err(io::Error::last_os_error()), - Ordering::Equal => return Ok(Vec::new()), - Ordering::Greater => {}, - } - - let mut buf = vec![0_u8; bufsize as usize]; - let err = lister.listxattr_second(&c_path, &mut buf, bufsize); - - match err.cmp(&0) { - Ordering::Less => return Err(io::Error::last_os_error()), - Ordering::Equal => return Ok(Vec::new()), - Ordering::Greater => {}, - } - - let mut names = Vec::new(); - if err > 0 { - // End indices of the attribute names - // the buffer contains 0-terminated c-strings - let idx = buf.iter().enumerate().filter_map(|(i, v)| - if *v == 0 { Some(i) } else { None } - ); - let mut start = 0; - - for end in idx { - let c_end = end + 1; // end of the c-string (including 0) - let size = lister.getxattr(&c_path, &buf[start..c_end]); - - if size > 0 { - names.push(Attribute { - name: lister.translate_attribute_name(&buf[start..end]), - size: size as usize, - }); - } - - start = c_end; - } - } - - Ok(names) -} - - -#[cfg(target_os = "macos")] -mod lister { - use super::FollowSymlinks; - use libc::{c_int, size_t, ssize_t, c_char, c_void}; - use std::ffi::CString; - use std::ptr; - - extern "C" { - fn listxattr( - path: *const c_char, - namebuf: *mut c_char, - size: size_t, - options: c_int, - ) -> ssize_t; - - fn getxattr( - path: *const c_char, - name: *const c_char, - value: *mut c_void, - size: size_t, - position: u32, - options: c_int, - ) -> ssize_t; - } - - pub struct Lister { - c_flags: c_int, - } - - impl Lister { - pub fn new(do_follow: FollowSymlinks) -> Self { - let c_flags: c_int = match do_follow { - FollowSymlinks::Yes => 0x0001, - FollowSymlinks::No => 0x0000, - }; - - Self { c_flags } - } - - pub fn translate_attribute_name(&self, input: &[u8]) -> String { - unsafe { std::str::from_utf8_unchecked(input).into() } - } - - pub fn listxattr_first(&self, c_path: &CString) -> ssize_t { - unsafe { - listxattr( - c_path.as_ptr(), - ptr::null_mut(), - 0, - self.c_flags, - ) - } - } - - pub fn listxattr_second(&self, c_path: &CString, buf: &mut Vec, bufsize: ssize_t) -> ssize_t { - unsafe { - listxattr( - c_path.as_ptr(), - buf.as_mut_ptr() as *mut c_char, - bufsize as size_t, - self.c_flags, - ) - } - } - - pub fn getxattr(&self, c_path: &CString, buf: &[u8]) -> ssize_t { - unsafe { - getxattr( - c_path.as_ptr(), - buf.as_ptr() as *const c_char, - ptr::null_mut(), - 0, - 0, - self.c_flags, - ) - } - } - } -} - - -#[cfg(target_os = "linux")] -mod lister { - use std::ffi::CString; - use libc::{size_t, ssize_t, c_char, c_void}; - use super::FollowSymlinks; - use std::ptr; - - extern "C" { - fn listxattr( - path: *const c_char, - list: *mut c_char, - size: size_t, - ) -> ssize_t; - - fn llistxattr( - path: *const c_char, - list: *mut c_char, - size: size_t, - ) -> ssize_t; - - fn getxattr( - path: *const c_char, - name: *const c_char, - value: *mut c_void, - size: size_t, - ) -> ssize_t; - - fn lgetxattr( - path: *const c_char, - name: *const c_char, - value: *mut c_void, - size: size_t, - ) -> ssize_t; - } - - pub struct Lister { - follow_symlinks: FollowSymlinks, - } - - impl Lister { - pub fn new(follow_symlinks: FollowSymlinks) -> Lister { - Lister { follow_symlinks } - } - - pub fn translate_attribute_name(&self, input: &[u8]) -> String { - String::from_utf8_lossy(input).into_owned() - } - - pub fn listxattr_first(&self, c_path: &CString) -> ssize_t { - let listxattr = match self.follow_symlinks { - FollowSymlinks::Yes => listxattr, - FollowSymlinks::No => llistxattr, - }; - - unsafe { - listxattr( - c_path.as_ptr() as *const _, - ptr::null_mut(), - 0, - ) - } - } - - pub fn listxattr_second(&self, c_path: &CString, buf: &mut Vec, bufsize: ssize_t) -> ssize_t { - let listxattr = match self.follow_symlinks { - FollowSymlinks::Yes => listxattr, - FollowSymlinks::No => llistxattr, - }; - - unsafe { - listxattr( - c_path.as_ptr() as *const _, - buf.as_mut_ptr() as *mut c_char, - bufsize as size_t, - ) - } - } - - pub fn getxattr(&self, c_path: &CString, buf: &[u8]) -> ssize_t { - let getxattr = match self.follow_symlinks { - FollowSymlinks::Yes => getxattr, - FollowSymlinks::No => lgetxattr, - }; - - unsafe { - getxattr( - c_path.as_ptr() as *const _, - buf.as_ptr() as *const c_char, - ptr::null_mut(), - 0, - ) - } - } - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/fields.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/fields.rs deleted file mode 100644 index 7320afa57..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/fields.rs +++ /dev/null @@ -1,247 +0,0 @@ -//! Wrapper types for the values returned from `File`s. -//! -//! The methods of `File` that return information about the entry on the -//! filesystem -- size, modification date, block count, or Git status -- used -//! to just return these as formatted strings, but this became inflexible once -//! customisable output styles landed. -//! -//! Instead, they will return a wrapper type from this module, which tags the -//! type with what field it is while containing the actual raw value. -//! -//! The `output::details` module, among others, uses these types to render and -//! display the information as formatted strings. - -// C-style `blkcnt_t` types don’t follow Rust’s rules! -#![allow(non_camel_case_types)] -#![allow(clippy::struct_excessive_bools)] - - -/// The type of a file’s block count. -pub type blkcnt_t = u64; - -/// The type of a file’s group ID. -pub type gid_t = u32; - -/// The type of a file’s inode. -pub type ino_t = u64; - -/// The type of a file’s number of links. -pub type nlink_t = u64; - -/// The type of a file’s timestamp (creation, modification, access, etc). -pub type time_t = i64; - -/// The type of a file’s user ID. -pub type uid_t = u32; - - -/// The file’s base type, which gets displayed in the very first column of the -/// details output. -/// -/// This type is set entirely by the filesystem, rather than relying on a -/// file’s contents. So “link” is a type, but “image” is just a type of -/// regular file. (See the `filetype` module for those checks.) -/// -/// Its ordering is used when sorting by type. -#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone)] -pub enum Type { - Directory, - File, - Link, - Pipe, - Socket, - CharDevice, - BlockDevice, - Special, -} - -impl Type { - pub fn is_regular_file(self) -> bool { - matches!(self, Self::File) - } -} - - -/// The file’s Unix permission bitfield, with one entry per bit. -#[derive(Copy, Clone)] -pub struct Permissions { - pub user_read: bool, - pub user_write: bool, - pub user_execute: bool, - - pub group_read: bool, - pub group_write: bool, - pub group_execute: bool, - - pub other_read: bool, - pub other_write: bool, - pub other_execute: bool, - - pub sticky: bool, - pub setgid: bool, - pub setuid: bool, -} - -/// The three pieces of information that are displayed as a single column in -/// the details view. These values are fused together to make the output a -/// little more compressed. -#[derive(Copy, Clone)] -pub struct PermissionsPlus { - pub file_type: Type, - pub permissions: Permissions, - pub xattrs: bool, -} - - -/// The permissions encoded as octal values -#[derive(Copy, Clone)] -pub struct OctalPermissions { - pub permissions: Permissions, -} - -/// A file’s number of hard links on the filesystem. -/// -/// Under Unix, a file can exist on the filesystem only once but appear in -/// multiple directories. However, it’s rare (but occasionally useful!) for a -/// regular file to have a link count greater than 1, so we highlight the -/// block count specifically for this case. -#[derive(Copy, Clone)] -pub struct Links { - - /// The actual link count. - pub count: nlink_t, - - /// Whether this file is a regular file with more than one hard link. - pub multiple: bool, -} - - -/// A file’s inode. Every directory entry on a Unix filesystem has an inode, -/// including directories and links, so this is applicable to everything exa -/// can deal with. -#[derive(Copy, Clone)] -pub struct Inode(pub ino_t); - - -/// The number of blocks that a file takes up on the filesystem, if any. -#[derive(Copy, Clone)] -pub enum Blocks { - - /// This file has the given number of blocks. - Some(blkcnt_t), - - /// This file isn’t of a type that can take up blocks. - None, -} - - -/// The ID of the user that owns a file. This will only ever be a number; -/// looking up the username is done in the `display` module. -#[derive(Copy, Clone)] -pub struct User(pub uid_t); - -/// The ID of the group that a file belongs to. -#[derive(Copy, Clone)] -pub struct Group(pub gid_t); - - -/// A file’s size, in bytes. This is usually formatted by the `number_prefix` -/// crate into something human-readable. -#[derive(Copy, Clone)] -pub enum Size { - - /// This file has a defined size. - Some(u64), - - /// This file has no size, or has a size but we aren’t interested in it. - /// - /// Under Unix, directory entries that aren’t regular files will still - /// have a file size. For example, a directory will just contain a list of - /// its files as its “contents” and will be specially flagged as being a - /// directory, rather than a file. However, seeing the “file size” of this - /// data is rarely useful — I can’t think of a time when I’ve seen it and - /// learnt something. So we discard it and just output “-” instead. - /// - /// See this answer for more: http://unix.stackexchange.com/a/68266 - None, - - /// This file is a block or character device, so instead of a size, print - /// out the file’s major and minor device IDs. - /// - /// This is what ls does as well. Without it, the devices will just have - /// file sizes of zero. - DeviceIDs(DeviceIDs), -} - -/// The major and minor device IDs that gets displayed for device files. -/// -/// You can see what these device numbers mean: -/// - -/// - -#[derive(Copy, Clone)] -pub struct DeviceIDs { - pub major: u8, - pub minor: u8, -} - - -/// One of a file’s timestamps (created, accessed, or modified). -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] -pub struct Time { - pub seconds: time_t, - pub nanoseconds: time_t, -} - - -/// A file’s status in a Git repository. Whether a file is in a repository or -/// not is handled by the Git module, rather than having a “null” variant in -/// this enum. -#[derive(PartialEq, Copy, Clone)] -pub enum GitStatus { - - /// This file hasn’t changed since the last commit. - NotModified, - - /// This file didn’t exist for the last commit, and is not specified in - /// the ignored files list. - New, - - /// A file that’s been modified since the last commit. - Modified, - - /// A deleted file. This can’t ever be shown, but it’s here anyway! - Deleted, - - /// A file that Git has tracked a rename for. - Renamed, - - /// A file that’s had its type (such as the file permissions) changed. - TypeChange, - - /// A file that’s ignored (that matches a line in .gitignore) - Ignored, - - /// A file that’s updated but unmerged. - Conflicted, -} - - -/// A file’s complete Git status. It’s possible to make changes to a file, add -/// it to the staging area, then make *more* changes, so we need to list each -/// file’s status for both of these. -#[derive(Copy, Clone)] -pub struct Git { - pub staged: GitStatus, - pub unstaged: GitStatus, -} - -impl Default for Git { - - /// Create a Git status for a file with nothing done to it. - fn default() -> Self { - Self { - staged: GitStatus::NotModified, - unstaged: GitStatus::NotModified, - } - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/file.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/file.rs deleted file mode 100644 index b57777d14..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/file.rs +++ /dev/null @@ -1,565 +0,0 @@ -//! Files, and methods and fields to access their metadata. - -use std::io; -use std::os::unix::fs::{FileTypeExt, MetadataExt, PermissionsExt}; -use std::path::{Path, PathBuf}; -use std::time::{Duration, SystemTime, UNIX_EPOCH}; - -use log::*; - -use crate::fs::dir::Dir; -use crate::fs::fields as f; - - -/// A **File** is a wrapper around one of Rust’s `PathBuf` values, along with -/// associated data about the file. -/// -/// Each file is definitely going to have its filename displayed at least -/// once, have its file extension extracted at least once, and have its metadata -/// information queried at least once, so it makes sense to do all this at the -/// start and hold on to all the information. -pub struct File<'dir> { - - /// The filename portion of this file’s path, including the extension. - /// - /// This is used to compare against certain filenames (such as checking if - /// it’s “Makefile” or something) and to highlight only the filename in - /// colour when displaying the path. - pub name: String, - - /// The file’s name’s extension, if present, extracted from the name. - /// - /// This is queried many times over, so it’s worth caching it. - pub ext: Option, - - /// The path that begat this file. - /// - /// Even though the file’s name is extracted, the path needs to be kept - /// around, as certain operations involve looking up the file’s absolute - /// location (such as searching for compiled files) or using its original - /// path (following a symlink). - pub path: PathBuf, - - /// A cached `metadata` (`stat`) call for this file. - /// - /// This too is queried multiple times, and is *not* cached by the OS, as - /// it could easily change between invocations — but exa is so short-lived - /// it’s better to just cache it. - pub metadata: std::fs::Metadata, - - /// A reference to the directory that contains this file, if any. - /// - /// Filenames that get passed in on the command-line directly will have no - /// parent directory reference — although they technically have one on the - /// filesystem, we’ll never need to look at it, so it’ll be `None`. - /// However, *directories* that get passed in will produce files that - /// contain a reference to it, which is used in certain operations (such - /// as looking up compiled files). - pub parent_dir: Option<&'dir Dir>, - - /// Whether this is one of the two `--all all` directories, `.` and `..`. - /// - /// Unlike all other entries, these are not returned as part of the - /// directory’s children, and are in fact added specifically by exa; this - /// means that they should be skipped when recursing. - pub is_all_all: bool, -} - -impl<'dir> File<'dir> { - pub fn from_args(path: PathBuf, parent_dir: PD, filename: FN) -> io::Result> - where PD: Into>, - FN: Into> - { - let parent_dir = parent_dir.into(); - let name = filename.into().unwrap_or_else(|| File::filename(&path)); - let ext = File::ext(&path); - - debug!("Statting file {:?}", &path); - let metadata = std::fs::symlink_metadata(&path)?; - let is_all_all = false; - - Ok(File { path, parent_dir, metadata, ext, name, is_all_all }) - } - - pub fn new_aa_current(parent_dir: &'dir Dir) -> io::Result> { - let path = parent_dir.path.to_path_buf(); - let ext = File::ext(&path); - - debug!("Statting file {:?}", &path); - let metadata = std::fs::symlink_metadata(&path)?; - let is_all_all = true; - let parent_dir = Some(parent_dir); - - Ok(File { path, parent_dir, metadata, ext, name: ".".into(), is_all_all }) - } - - pub fn new_aa_parent(path: PathBuf, parent_dir: &'dir Dir) -> io::Result> { - let ext = File::ext(&path); - - debug!("Statting file {:?}", &path); - let metadata = std::fs::symlink_metadata(&path)?; - let is_all_all = true; - let parent_dir = Some(parent_dir); - - Ok(File { path, parent_dir, metadata, ext, name: "..".into(), is_all_all }) - } - - /// A file’s name is derived from its string. This needs to handle directories - /// such as `/` or `..`, which have no `file_name` component. So instead, just - /// use the last component as the name. - pub fn filename(path: &Path) -> String { - if let Some(back) = path.components().next_back() { - back.as_os_str().to_string_lossy().to_string() - } - else { - // use the path as fallback - error!("Path {:?} has no last component", path); - path.display().to_string() - } - } - - /// Extract an extension from a file path, if one is present, in lowercase. - /// - /// The extension is the series of characters after the last dot. This - /// deliberately counts dotfiles, so the “.git” folder has the extension “git”. - /// - /// ASCII lowercasing is used because these extensions are only compared - /// against a pre-compiled list of extensions which are known to only exist - /// within ASCII, so it’s alright. - fn ext(path: &Path) -> Option { - let name = path.file_name().map(|f| f.to_string_lossy().to_string())?; - - name.rfind('.') - .map(|p| name[p + 1 ..] - .to_ascii_lowercase()) - } - - /// Whether this file is a directory on the filesystem. - pub fn is_directory(&self) -> bool { - self.metadata.is_dir() - } - - /// Whether this file is a directory, or a symlink pointing to a directory. - pub fn points_to_directory(&self) -> bool { - if self.is_directory() { - return true; - } - - if self.is_link() { - let target = self.link_target(); - if let FileTarget::Ok(target) = target { - return target.points_to_directory(); - } - } - - false - } - - /// If this file is a directory on the filesystem, then clone its - /// `PathBuf` for use in one of our own `Dir` values, and read a list of - /// its contents. - /// - /// Returns an IO error upon failure, but this shouldn’t be used to check - /// if a `File` is a directory or not! For that, just use `is_directory()`. - pub fn to_dir(&self) -> io::Result { - Dir::read_dir(self.path.clone()) - } - - /// Whether this file is a regular file on the filesystem — that is, not a - /// directory, a link, or anything else treated specially. - pub fn is_file(&self) -> bool { - self.metadata.is_file() - } - - /// Whether this file is both a regular file *and* executable for the - /// current user. An executable file has a different purpose from an - /// executable directory, so they should be highlighted differently. - pub fn is_executable_file(&self) -> bool { - let bit = modes::USER_EXECUTE; - self.is_file() && (self.metadata.permissions().mode() & bit) == bit - } - - /// Whether this file is a symlink on the filesystem. - pub fn is_link(&self) -> bool { - self.metadata.file_type().is_symlink() - } - - /// Whether this file is a named pipe on the filesystem. - pub fn is_pipe(&self) -> bool { - self.metadata.file_type().is_fifo() - } - - /// Whether this file is a char device on the filesystem. - pub fn is_char_device(&self) -> bool { - self.metadata.file_type().is_char_device() - } - - /// Whether this file is a block device on the filesystem. - pub fn is_block_device(&self) -> bool { - self.metadata.file_type().is_block_device() - } - - /// Whether this file is a socket on the filesystem. - pub fn is_socket(&self) -> bool { - self.metadata.file_type().is_socket() - } - - - /// Re-prefixes the path pointed to by this file, if it’s a symlink, to - /// make it an absolute path that can be accessed from whichever - /// directory exa is being run from. - fn reorient_target_path(&self, path: &Path) -> PathBuf { - if path.is_absolute() { - path.to_path_buf() - } - else if let Some(dir) = self.parent_dir { - dir.join(&*path) - } - else if let Some(parent) = self.path.parent() { - parent.join(&*path) - } - else { - self.path.join(&*path) - } - } - - /// Again assuming this file is a symlink, follows that link and returns - /// the result of following it. - /// - /// For a working symlink that the user is allowed to follow, - /// this will be the `File` object at the other end, which can then have - /// its name, colour, and other details read. - /// - /// For a broken symlink, returns where the file *would* be, if it - /// existed. If this file cannot be read at all, returns the error that - /// we got when we tried to read it. - pub fn link_target(&self) -> FileTarget<'dir> { - - // We need to be careful to treat the path actually pointed to by - // this file — which could be absolute or relative — to the path - // we actually look up and turn into a `File` — which needs to be - // absolute to be accessible from any directory. - debug!("Reading link {:?}", &self.path); - let path = match std::fs::read_link(&self.path) { - Ok(p) => p, - Err(e) => return FileTarget::Err(e), - }; - - let absolute_path = self.reorient_target_path(&path); - - // Use plain `metadata` instead of `symlink_metadata` - we *want* to - // follow links. - match std::fs::metadata(&absolute_path) { - Ok(metadata) => { - let ext = File::ext(&path); - let name = File::filename(&path); - let file = File { parent_dir: None, path, ext, metadata, name, is_all_all: false }; - FileTarget::Ok(Box::new(file)) - } - Err(e) => { - error!("Error following link {:?}: {:#?}", &path, e); - FileTarget::Broken(path) - } - } - } - - /// This file’s number of hard links. - /// - /// It also reports whether this is both a regular file, and a file with - /// multiple links. This is important, because a file with multiple links - /// is uncommon, while you come across directories and other types - /// with multiple links much more often. Thus, it should get highlighted - /// more attentively. - pub fn links(&self) -> f::Links { - let count = self.metadata.nlink(); - - f::Links { - count, - multiple: self.is_file() && count > 1, - } - } - - /// This file’s inode. - pub fn inode(&self) -> f::Inode { - f::Inode(self.metadata.ino()) - } - - /// This file’s number of filesystem blocks. - /// - /// (Not the size of each block, which we don’t actually report on) - pub fn blocks(&self) -> f::Blocks { - if self.is_file() || self.is_link() { - f::Blocks::Some(self.metadata.blocks()) - } - else { - f::Blocks::None - } - } - - /// The ID of the user that own this file. - pub fn user(&self) -> f::User { - f::User(self.metadata.uid()) - } - - /// The ID of the group that owns this file. - pub fn group(&self) -> f::Group { - f::Group(self.metadata.gid()) - } - - /// This file’s size, if it’s a regular file. - /// - /// For directories, no size is given. Although they do have a size on - /// some filesystems, I’ve never looked at one of those numbers and gained - /// any information from it. So it’s going to be hidden instead. - /// - /// Block and character devices return their device IDs, because they - /// usually just have a file size of zero. - pub fn size(&self) -> f::Size { - if self.is_directory() { - f::Size::None - } - else if self.is_char_device() || self.is_block_device() { - let device_ids = self.metadata.rdev().to_be_bytes(); - - // In C-land, getting the major and minor device IDs is done with - // preprocessor macros called `major` and `minor` that depend on - // the size of `dev_t`, but we just take the second-to-last and - // last bytes. - f::Size::DeviceIDs(f::DeviceIDs { - major: device_ids[6], - minor: device_ids[7], - }) - } - else { - f::Size::Some(self.metadata.len()) - } - } - - /// This file’s last modified timestamp, if available on this platform. - pub fn modified_time(&self) -> Option { - self.metadata.modified().ok() - } - - /// This file’s last changed timestamp, if available on this platform. - pub fn changed_time(&self) -> Option { - let (mut sec, mut nanosec) = (self.metadata.ctime(), self.metadata.ctime_nsec()); - - if sec < 0 { - if nanosec > 0 { - sec += 1; - nanosec -= 1_000_000_000; - } - - let duration = Duration::new(sec.abs() as u64, nanosec.abs() as u32); - Some(UNIX_EPOCH - duration) - } - else { - let duration = Duration::new(sec as u64, nanosec as u32); - Some(UNIX_EPOCH + duration) - } - } - - /// This file’s last accessed timestamp, if available on this platform. - pub fn accessed_time(&self) -> Option { - self.metadata.accessed().ok() - } - - /// This file’s created timestamp, if available on this platform. - pub fn created_time(&self) -> Option { - self.metadata.created().ok() - } - - /// This file’s ‘type’. - /// - /// This is used a the leftmost character of the permissions column. - /// The file type can usually be guessed from the colour of the file, but - /// ls puts this character there. - pub fn type_char(&self) -> f::Type { - if self.is_file() { - f::Type::File - } - else if self.is_directory() { - f::Type::Directory - } - else if self.is_pipe() { - f::Type::Pipe - } - else if self.is_link() { - f::Type::Link - } - else if self.is_char_device() { - f::Type::CharDevice - } - else if self.is_block_device() { - f::Type::BlockDevice - } - else if self.is_socket() { - f::Type::Socket - } - else { - f::Type::Special - } - } - - /// This file’s permissions, with flags for each bit. - pub fn permissions(&self) -> f::Permissions { - let bits = self.metadata.mode(); - let has_bit = |bit| bits & bit == bit; - - f::Permissions { - user_read: has_bit(modes::USER_READ), - user_write: has_bit(modes::USER_WRITE), - user_execute: has_bit(modes::USER_EXECUTE), - - group_read: has_bit(modes::GROUP_READ), - group_write: has_bit(modes::GROUP_WRITE), - group_execute: has_bit(modes::GROUP_EXECUTE), - - other_read: has_bit(modes::OTHER_READ), - other_write: has_bit(modes::OTHER_WRITE), - other_execute: has_bit(modes::OTHER_EXECUTE), - - sticky: has_bit(modes::STICKY), - setgid: has_bit(modes::SETGID), - setuid: has_bit(modes::SETUID), - } - } - - /// Whether this file’s extension is any of the strings that get passed in. - /// - /// This will always return `false` if the file has no extension. - pub fn extension_is_one_of(&self, choices: &[&str]) -> bool { - match &self.ext { - Some(ext) => choices.contains(&&ext[..]), - None => false, - } - } - - /// Whether this file’s name, including extension, is any of the strings - /// that get passed in. - pub fn name_is_one_of(&self, choices: &[&str]) -> bool { - choices.contains(&&self.name[..]) - } -} - - -impl<'a> AsRef> for File<'a> { - fn as_ref(&self) -> &File<'a> { - self - } -} - - -/// The result of following a symlink. -pub enum FileTarget<'dir> { - - /// The symlink pointed at a file that exists. - Ok(Box>), - - /// The symlink pointed at a file that does not exist. Holds the path - /// where the file would be, if it existed. - Broken(PathBuf), - - /// There was an IO error when following the link. This can happen if the - /// file isn’t a link to begin with, but also if, say, we don’t have - /// permission to follow it. - Err(io::Error), - - // Err is its own variant, instead of having the whole thing be inside an - // `io::Result`, because being unable to follow a symlink is not a serious - // error — we just display the error message and move on. -} - -impl<'dir> FileTarget<'dir> { - - /// Whether this link doesn’t lead to a file, for whatever reason. This - /// gets used to determine how to highlight the link in grid views. - pub fn is_broken(&self) -> bool { - matches!(self, Self::Broken(_) | Self::Err(_)) - } -} - - -/// More readable aliases for the permission bits exposed by libc. -#[allow(trivial_numeric_casts)] -mod modes { - - // The `libc::mode_t` type’s actual type varies, but the value returned - // from `metadata.permissions().mode()` is always `u32`. - pub type Mode = u32; - - pub const USER_READ: Mode = libc::S_IRUSR as Mode; - pub const USER_WRITE: Mode = libc::S_IWUSR as Mode; - pub const USER_EXECUTE: Mode = libc::S_IXUSR as Mode; - - pub const GROUP_READ: Mode = libc::S_IRGRP as Mode; - pub const GROUP_WRITE: Mode = libc::S_IWGRP as Mode; - pub const GROUP_EXECUTE: Mode = libc::S_IXGRP as Mode; - - pub const OTHER_READ: Mode = libc::S_IROTH as Mode; - pub const OTHER_WRITE: Mode = libc::S_IWOTH as Mode; - pub const OTHER_EXECUTE: Mode = libc::S_IXOTH as Mode; - - pub const STICKY: Mode = libc::S_ISVTX as Mode; - pub const SETGID: Mode = libc::S_ISGID as Mode; - pub const SETUID: Mode = libc::S_ISUID as Mode; -} - - -#[cfg(test)] -mod ext_test { - use super::File; - use std::path::Path; - - #[test] - fn extension() { - assert_eq!(Some("dat".to_string()), File::ext(Path::new("fester.dat"))) - } - - #[test] - fn dotfile() { - assert_eq!(Some("vimrc".to_string()), File::ext(Path::new(".vimrc"))) - } - - #[test] - fn no_extension() { - assert_eq!(None, File::ext(Path::new("jarlsberg"))) - } -} - - -#[cfg(test)] -mod filename_test { - use super::File; - use std::path::Path; - - #[test] - fn file() { - assert_eq!("fester.dat", File::filename(Path::new("fester.dat"))) - } - - #[test] - fn no_path() { - assert_eq!("foo.wha", File::filename(Path::new("/var/cache/foo.wha"))) - } - - #[test] - fn here() { - assert_eq!(".", File::filename(Path::new("."))) - } - - #[test] - fn there() { - assert_eq!("..", File::filename(Path::new(".."))) - } - - #[test] - fn everywhere() { - assert_eq!("..", File::filename(Path::new("./.."))) - } - - #[test] - fn topmost() { - assert_eq!("/", File::filename(Path::new("/"))) - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/filter.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/filter.rs deleted file mode 100644 index 4cd6ad2c8..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/filter.rs +++ /dev/null @@ -1,413 +0,0 @@ -//! Filtering and sorting the list of files before displaying them. - -use std::cmp::Ordering; -use std::iter::FromIterator; -use std::os::unix::fs::MetadataExt; -use std::path::Path; - -use crate::fs::DotFilter; -use crate::fs::File; - - -/// The **file filter** processes a list of files before displaying them to -/// the user, by removing files they don’t want to see, and putting the list -/// in the desired order. -/// -/// Usually a user does not want to see *every* file in the list. The most -/// common case is to remove files starting with `.`, which are designated -/// as ‘hidden’ files. -/// -/// The special files `.` and `..` files are not actually filtered out, but -/// need to be inserted into the list, in a special case. -/// -/// The filter also governs sorting the list. After being filtered, pairs of -/// files are compared and sorted based on the result, with the sort field -/// performing the comparison. -#[derive(PartialEq, Debug, Clone)] -pub struct FileFilter { - - /// Whether directories should be listed first, and other types of file - /// second. Some users prefer it like this. - pub list_dirs_first: bool, - - /// The metadata field to sort by. - pub sort_field: SortField, - - /// Whether to reverse the sorting order. This would sort the largest - /// files first, or files starting with Z, or the most-recently-changed - /// ones, depending on the sort field. - pub reverse: bool, - - /// Whether to only show directories. - pub only_dirs: bool, - - /// Which invisible “dot” files to include when listing a directory. - /// - /// Files starting with a single “.” are used to determine “system” or - /// “configuration” files that should not be displayed in a regular - /// directory listing, and the directory entries “.” and “..” are - /// considered extra-special. - /// - /// This came about more or less by a complete historical accident, - /// when the original `ls` tried to hide `.` and `..`: - /// https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp - /// - /// When one typed ls, however, these files appeared, so either Ken or - /// Dennis added a simple test to the program. It was in assembler then, - /// but the code in question was equivalent to something like this: - /// if (name[0] == '.') continue; - /// This statement was a little shorter than what it should have been, - /// which is: - /// if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue; - /// but hey, it was easy. - /// - /// Two things resulted. - /// - /// First, a bad precedent was set. A lot of other lazy programmers - /// introduced bugs by making the same simplification. Actual files - /// beginning with periods are often skipped when they should be counted. - /// - /// Second, and much worse, the idea of a "hidden" or "dot" file was - /// created. As a consequence, more lazy programmers started dropping - /// files into everyone's home directory. I don't have all that much - /// stuff installed on the machine I'm using to type this, but my home - /// directory has about a hundred dot files and I don't even know what - /// most of them are or whether they're still needed. Every file name - /// evaluation that goes through my home directory is slowed down by - /// this accumulated sludge. - pub dot_filter: DotFilter, - - /// Glob patterns to ignore. Any file name that matches *any* of these - /// patterns won’t be displayed in the list. - pub ignore_patterns: IgnorePatterns, - - /// Whether to ignore Git-ignored patterns. - /// This is implemented completely separately from the actual Git - /// repository scanning — a `.gitignore` file will still be scanned even - /// if there’s no `.git` folder present. - pub git_ignore: GitIgnore, -} - -impl FileFilter { - /// Remove every file in the given vector that does *not* pass the - /// filter predicate for files found inside a directory. - pub fn filter_child_files(&self, files: &mut Vec>) { - files.retain(|f| ! self.ignore_patterns.is_ignored(&f.name)); - - if self.only_dirs { - files.retain(File::is_directory); - } - } - - /// Remove every file in the given vector that does *not* pass the - /// filter predicate for file names specified on the command-line. - /// - /// The rules are different for these types of files than the other - /// type because the ignore rules can be used with globbing. For - /// example, running `exa -I='*.tmp' .vimrc` shouldn’t filter out the - /// dotfile, because it’s been directly specified. But running - /// `exa -I='*.ogg' music/*` should filter out the ogg files obtained - /// from the glob, even though the globbing is done by the shell! - pub fn filter_argument_files(&self, files: &mut Vec>) { - files.retain(|f| { - ! self.ignore_patterns.is_ignored(&f.name) - }); - } - - /// Sort the files in the given vector based on the sort field option. - pub fn sort_files<'a, F>(&self, files: &mut Vec) - where F: AsRef> - { - files.sort_by(|a, b| { - self.sort_field.compare_files(a.as_ref(), b.as_ref()) - }); - - if self.reverse { - files.reverse(); - } - - if self.list_dirs_first { - // This relies on the fact that `sort_by` is *stable*: it will keep - // adjacent elements next to each other. - files.sort_by(|a, b| { - b.as_ref().points_to_directory() - .cmp(&a.as_ref().points_to_directory()) - }); - } - } -} - - -/// User-supplied field to sort by. -#[derive(PartialEq, Debug, Copy, Clone)] -pub enum SortField { - - /// Don’t apply any sorting. This is usually used as an optimisation in - /// scripts, where the order doesn’t matter. - Unsorted, - - /// The file name. This is the default sorting. - Name(SortCase), - - /// The file’s extension, with extensionless files being listed first. - Extension(SortCase), - - /// The file’s size, in bytes. - Size, - - /// The file’s inode, which usually corresponds to the order in which - /// files were created on the filesystem, more or less. - FileInode, - - /// The time the file was modified (the “mtime”). - /// - /// As this is stored as a Unix timestamp, rather than a local time - /// instance, the time zone does not matter and will only be used to - /// display the timestamps, not compare them. - ModifiedDate, - - /// The time the file was accessed (the “atime”). - /// - /// Oddly enough, this field rarely holds the *actual* accessed time. - /// Recording a read time means writing to the file each time it’s read - /// slows the whole operation down, so many systems will only update the - /// timestamp in certain circumstances. This has become common enough that - /// it’s now expected behaviour! - /// http://unix.stackexchange.com/a/8842 - AccessedDate, - - /// The time the file was changed (the “ctime”). - /// - /// This field is used to mark the time when a file’s metadata - /// changed — its permissions, owners, or link count. - /// - /// In original Unix, this was, however, meant as creation time. - /// https://www.bell-labs.com/usr/dmr/www/cacm.html - ChangedDate, - - /// The time the file was created (the “btime” or “birthtime”). - CreatedDate, - - /// The type of the file: directories, links, pipes, regular, files, etc. - /// - /// Files are ordered according to the `PartialOrd` implementation of - /// `fs::fields::Type`, so changing that will change this. - FileType, - - /// The “age” of the file, which is the time it was modified sorted - /// backwards. The reverse of the `ModifiedDate` ordering! - /// - /// It turns out that listing the most-recently-modified files first is a - /// common-enough use case that it deserves its own variant. This would be - /// implemented by just using the modified date and setting the reverse - /// flag, but this would make reversing *that* output not work, which is - /// bad, even though that’s kind of nonsensical. So it’s its own variant - /// that can be reversed like usual. - ModifiedAge, - - /// The file's name, however if the name of the file begins with `.` - /// ignore the leading `.` and then sort as Name - NameMixHidden(SortCase), -} - -/// Whether a field should be sorted case-sensitively or case-insensitively. -/// This determines which of the `natord` functions to use. -/// -/// I kept on forgetting which one was sensitive and which one was -/// insensitive. Would a case-sensitive sort put capital letters first because -/// it takes the case of the letters into account, or intermingle them with -/// lowercase letters because it takes the difference between the two cases -/// into account? I gave up and just named these two variants after the -/// effects they have. -#[derive(PartialEq, Debug, Copy, Clone)] -pub enum SortCase { - - /// Sort files case-sensitively with uppercase first, with ‘A’ coming - /// before ‘a’. - ABCabc, - - /// Sort files case-insensitively, with ‘A’ being equal to ‘a’. - AaBbCc, -} - -impl SortField { - - /// Compares two files to determine the order they should be listed in, - /// depending on the search field. - /// - /// The `natord` crate is used here to provide a more *natural* sorting - /// order than just sorting character-by-character. This splits filenames - /// into groups between letters and numbers, and then sorts those blocks - /// together, so `file10` will sort after `file9`, instead of before it - /// because of the `1`. - pub fn compare_files(self, a: &File<'_>, b: &File<'_>) -> Ordering { - use self::SortCase::{ABCabc, AaBbCc}; - - match self { - Self::Unsorted => Ordering::Equal, - - Self::Name(ABCabc) => natord::compare(&a.name, &b.name), - Self::Name(AaBbCc) => natord::compare_ignore_case(&a.name, &b.name), - - Self::Size => a.metadata.len().cmp(&b.metadata.len()), - Self::FileInode => a.metadata.ino().cmp(&b.metadata.ino()), - Self::ModifiedDate => a.modified_time().cmp(&b.modified_time()), - Self::AccessedDate => a.accessed_time().cmp(&b.accessed_time()), - Self::ChangedDate => a.changed_time().cmp(&b.changed_time()), - Self::CreatedDate => a.created_time().cmp(&b.created_time()), - Self::ModifiedAge => b.modified_time().cmp(&a.modified_time()), // flip b and a - - Self::FileType => match a.type_char().cmp(&b.type_char()) { // todo: this recomputes - Ordering::Equal => natord::compare(&*a.name, &*b.name), - order => order, - }, - - Self::Extension(ABCabc) => match a.ext.cmp(&b.ext) { - Ordering::Equal => natord::compare(&*a.name, &*b.name), - order => order, - }, - - Self::Extension(AaBbCc) => match a.ext.cmp(&b.ext) { - Ordering::Equal => natord::compare_ignore_case(&*a.name, &*b.name), - order => order, - }, - - Self::NameMixHidden(ABCabc) => natord::compare( - Self::strip_dot(&a.name), - Self::strip_dot(&b.name) - ), - Self::NameMixHidden(AaBbCc) => natord::compare_ignore_case( - Self::strip_dot(&a.name), - Self::strip_dot(&b.name) - ) - } - } - - fn strip_dot(n: &str) -> &str { - if n.starts_with('.') { &n[1..] } - else { n } - } -} - - -/// The **ignore patterns** are a list of globs that are tested against -/// each filename, and if any of them match, that file isn’t displayed. -/// This lets a user hide, say, text files by ignoring `*.txt`. -#[derive(PartialEq, Default, Debug, Clone)] -pub struct IgnorePatterns { - patterns: Vec, -} - -impl FromIterator for IgnorePatterns { - - fn from_iter(iter: I) -> Self - where I: IntoIterator - { - let patterns = iter.into_iter().collect(); - Self { patterns } - } -} - -impl IgnorePatterns { - - /// Create a new list from the input glob strings, turning the inputs that - /// are valid glob patterns into an `IgnorePatterns`. The inputs that - /// don’t parse correctly are returned separately. - pub fn parse_from_iter<'a, I: IntoIterator>(iter: I) -> (Self, Vec) { - let iter = iter.into_iter(); - - // Almost all glob patterns are valid, so it’s worth pre-allocating - // the vector with enough space for all of them. - let mut patterns = match iter.size_hint() { - (_, Some(count)) => Vec::with_capacity(count), - _ => Vec::new(), - }; - - // Similarly, assume there won’t be any errors. - let mut errors = Vec::new(); - - for input in iter { - match glob::Pattern::new(input) { - Ok(pat) => patterns.push(pat), - Err(e) => errors.push(e), - } - } - - (Self { patterns }, errors) - } - - /// Create a new empty set of patterns that matches nothing. - pub fn empty() -> Self { - Self { patterns: Vec::new() } - } - - /// Test whether the given file should be hidden from the results. - fn is_ignored(&self, file: &str) -> bool { - self.patterns.iter().any(|p| p.matches(file)) - } - - /// Test whether the given file should be hidden from the results. - pub fn is_ignored_path(&self, file: &Path) -> bool { - self.patterns.iter().any(|p| p.matches_path(file)) - } - - // TODO(ogham): The fact that `is_ignored_path` is pub while `is_ignored` - // isn’t probably means it’s in the wrong place -} - - -/// Whether to ignore or display files that are mentioned in `.gitignore` files. -#[derive(PartialEq, Debug, Copy, Clone)] -pub enum GitIgnore { - - /// Ignore files that Git would ignore. This means doing a check for a - /// `.gitignore` file, possibly recursively up the filesystem tree. - CheckAndIgnore, - - /// Display files, even if Git would ignore them. - Off, -} - -// This is not fully baked yet. The `ignore` crate lists a lot more files that -// we aren’t checking: -// -// > By default, all ignore files found are respected. This includes .ignore, -// > .gitignore, .git/info/exclude and even your global gitignore globs, -// > usually found in $XDG_CONFIG_HOME/git/ignore. - - -#[cfg(test)] -mod test_ignores { - use super::*; - - #[test] - fn empty_matches_nothing() { - let pats = IgnorePatterns::empty(); - assert_eq!(false, pats.is_ignored("nothing")); - assert_eq!(false, pats.is_ignored("test.mp3")); - } - - #[test] - fn ignores_a_glob() { - let (pats, fails) = IgnorePatterns::parse_from_iter(vec![ "*.mp3" ]); - assert!(fails.is_empty()); - assert_eq!(false, pats.is_ignored("nothing")); - assert_eq!(true, pats.is_ignored("test.mp3")); - } - - #[test] - fn ignores_an_exact_filename() { - let (pats, fails) = IgnorePatterns::parse_from_iter(vec![ "nothing" ]); - assert!(fails.is_empty()); - assert_eq!(true, pats.is_ignored("nothing")); - assert_eq!(false, pats.is_ignored("test.mp3")); - } - - #[test] - fn ignores_both() { - let (pats, fails) = IgnorePatterns::parse_from_iter(vec![ "nothing", "*.mp3" ]); - assert!(fails.is_empty()); - assert_eq!(true, pats.is_ignored("nothing")); - assert_eq!(true, pats.is_ignored("test.mp3")); - } -} diff --git a/collector/compile-benchmarks/exa-0.10.1/src/fs/mod.rs b/collector/compile-benchmarks/exa-0.10.1/src/fs/mod.rs deleted file mode 100644 index 1188f615a..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/fs/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -mod dir; -pub use self::dir::{Dir, DotFilter}; - -mod file; -pub use self::file::{File, FileTarget}; - -pub mod dir_action; -pub mod feature; -pub mod fields; -pub mod filter; diff --git a/collector/compile-benchmarks/exa-0.10.1/src/info/filetype.rs b/collector/compile-benchmarks/exa-0.10.1/src/info/filetype.rs deleted file mode 100644 index 8f54281db..000000000 --- a/collector/compile-benchmarks/exa-0.10.1/src/info/filetype.rs +++ /dev/null @@ -1,142 +0,0 @@ -//! Tests for various types of file (video, image, compressed, etc). -//! -//! Currently this is dependent on the file’s name and extension, because -//! those are the only metadata that we have access to without reading the -//! file’s contents. - -use ansi_term::Style; - -use crate::fs::File; -use crate::output::icons::FileIcon; -use crate::theme::FileColours; - - -#[derive(Debug, Default, PartialEq)] -pub struct FileExtensions; - -impl FileExtensions { - - /// An “immediate” file is something that can be run or activated somehow - /// in order to kick off the build of a project. It’s usually only present - /// in directories full of source code. - fn is_immediate(&self, file: &File<'_>) -> bool { - file.name.to_lowercase().starts_with("readme") || - file.name.ends_with(".ninja") || - file.name_is_one_of( &[ - "Makefile", "Cargo.toml", "SConstruct", "CMakeLists.txt", - "build.gradle", "pom.xml", "Rakefile", "package.json", "Gruntfile.js", - "Gruntfile.coffee", "BUILD", "BUILD.bazel", "WORKSPACE", "build.xml", - "webpack.config.js", "meson.build", "composer.json", "RoboFile.php", "PKGBUILD", - "Justfile", "Procfile", "Dockerfile", "Containerfile", "Vagrantfile", "Brewfile", - "Gemfile", "Pipfile", "build.sbt", "mix.exs", "bsconfig.json", "tsconfig.json", - ]) - } - - fn is_image(&self, file: &File<'_>) -> bool { - file.extension_is_one_of( &[ - "png", "jpeg", "jpg", "gif", "bmp", "tiff", "tif", - "ppm", "pgm", "pbm", "pnm", "webp", "raw", "arw", - "svg", "stl", "eps", "dvi", "ps", "cbr", "jpf", - "cbz", "xpm", "ico", "cr2", "orf", "nef", "heif", - ]) - } - - fn is_video(&self, file: &File<'_>) -> bool { - file.extension_is_one_of( &[ - "avi", "flv", "m2v", "m4v", "mkv", "mov", "mp4", "mpeg", - "mpg", "ogm", "ogv", "vob", "wmv", "webm", "m2ts", "heic", - ]) - } - - fn is_music(&self, file: &File<'_>) -> bool { - file.extension_is_one_of( &[ - "aac", "m4a", "mp3", "ogg", "wma", "mka", "opus", - ]) - } - - // Lossless music, rather than any other kind of data... - fn is_lossless(&self, file: &File<'_>) -> bool { - file.extension_is_one_of( &[ - "alac", "ape", "flac", "wav", - ]) - } - - fn is_crypto(&self, file: &File<'_>) -> bool { - file.extension_is_one_of( &[ - "asc", "enc", "gpg", "pgp", "sig", "signature", "pfx", "p12", - ]) - } - - fn is_document(&self, file: &File<'_>) -> bool { - file.extension_is_one_of( &[ - "djvu", "doc", "docx", "dvi", "eml", "eps", "fotd", "key", - "keynote", "numbers", "odp", "odt", "pages", "pdf", "ppt", - "pptx", "rtf", "xls", "xlsx", - ]) - } - - fn is_compressed(&self, file: &File<'_>) -> bool { - file.extension_is_one_of( &[ - "zip", "tar", "Z", "z", "gz", "bz2", "a", "ar", "7z", - "iso", "dmg", "tc", "rar", "par", "tgz", "xz", "txz", - "lz", "tlz", "lzma", "deb", "rpm", "zst", - ]) - } - - fn is_temp(&self, file: &File<'_>) -> bool { - file.name.ends_with('~') - || (file.name.starts_with('#') && file.name.ends_with('#')) - || file.extension_is_one_of( &[ "tmp", "swp", "swo", "swn", "bak", "bk" ]) - } - - fn is_compiled(&self, file: &File<'_>) -> bool { - if file.extension_is_one_of( &[ "class", "elc", "hi", "o", "pyc", "zwc", "ko" ]) { - true - } - else if let Some(dir) = file.parent_dir { - file.get_source_files().iter().any(|path| dir.contains(path)) - } - else { - false - } - } -} - -impl FileColours for FileExtensions { - fn colour_file(&self, file: &File<'_>) -> Option