Compare commits

..

1 Commits

Author SHA1 Message Date
andy.boot 71c2a7f36b Version: Increment version 2022-08-23 11:49:08 +01:00
6 changed files with 248 additions and 331 deletions
+7 -35
View File
@@ -81,41 +81,13 @@ jobs:
matrix: matrix:
job: job:
# { os, target, cargo-options, features, use-cross, toolchain } # { os, target, cargo-options, features, use-cross, toolchain }
- { - { os: ubuntu-latest , target: aarch64-unknown-linux-gnu , use-cross: use-cross }
os: ubuntu-latest, - { os: ubuntu-latest , target: aarch64-unknown-linux-musl , use-cross: use-cross }
target: aarch64-unknown-linux-gnu, - { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross: use-cross }
use-cross: use-cross, - { os: ubuntu-latest , target: i686-unknown-linux-gnu , use-cross: use-cross }
} - { os: ubuntu-latest , target: i686-unknown-linux-musl , use-cross: use-cross }
- { - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , use-cross: use-cross }
os: ubuntu-latest, - { os: ubuntu-latest , target: x86_64-unknown-linux-musl , use-cross: use-cross }
target: aarch64-unknown-linux-musl,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: arm-unknown-linux-gnueabihf,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: i686-unknown-linux-gnu,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: i686-unknown-linux-musl,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: x86_64-unknown-linux-gnu,
use-cross: use-cross,
}
- {
os: ubuntu-latest,
target: x86_64-unknown-linux-musl,
use-cross: use-cross,
}
- { os: macos-latest , target: x86_64-apple-darwin } - { os: macos-latest , target: x86_64-apple-darwin }
- { os: windows-latest , target: i686-pc-windows-gnu } - { os: windows-latest , target: i686-pc-windows-gnu }
- { os: windows-latest , target: i686-pc-windows-msvc } - { os: windows-latest , target: i686-pc-windows-msvc }
Generated
+1 -40
View File
@@ -68,12 +68,6 @@ dependencies = [
"regex-automata", "regex-automata",
] ]
[[package]]
name = "cc"
version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.0" version = "1.0.0"
@@ -124,12 +118,6 @@ dependencies = [
"toml", "toml",
] ]
[[package]]
name = "core-foundation-sys"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[package]] [[package]]
name = "crossbeam-channel" name = "crossbeam-channel"
version = "0.5.6" version = "0.5.6"
@@ -209,7 +197,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]] [[package]]
name = "du-dust" name = "du-dust"
version = "0.8.3" version = "0.8.2"
dependencies = [ dependencies = [
"ansi_term", "ansi_term",
"assert_cmd", "assert_cmd",
@@ -222,7 +210,6 @@ dependencies = [
"regex", "regex",
"serde", "serde",
"stfu8", "stfu8",
"sysinfo",
"tempfile", "tempfile",
"terminal_size", "terminal_size",
"thousands", "thousands",
@@ -335,15 +322,6 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "ntapi"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "num_cpus" name = "num_cpus"
version = "1.13.1" version = "1.13.1"
@@ -540,23 +518,6 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "sysinfo"
version = "0.15.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de94457a09609f33fec5e7fceaf907488967c6c7c75d64da6a7ce6ffdb8b5abd"
dependencies = [
"cc",
"cfg-if",
"core-foundation-sys",
"doc-comment",
"libc",
"ntapi",
"once_cell",
"rayon",
"winapi",
]
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.3.0" version = "3.3.0"
+1 -2
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "du-dust" name = "du-dust"
description = "A more intuitive version of du" description = "A more intuitive version of du"
version = "0.8.3" version = "0.8.2"
authors = ["bootandy <bootandy@gmail.com>", "nebkor <code@ardent.nebcorp.com>"] authors = ["bootandy <bootandy@gmail.com>", "nebkor <code@ardent.nebcorp.com>"]
edition = "2021" edition = "2021"
readme = "README.md" readme = "README.md"
@@ -39,7 +39,6 @@ regex = "1"
config-file = "0.2" config-file = "0.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
directories = "4" directories = "4"
sysinfo = "0.15"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi-util = "0.1" winapi-util = "0.1"
+18 -18
View File
@@ -1,3 +1,4 @@
[![Build Status](https://travis-ci.org/bootandy/dust.svg?branch=master)](https://travis-ci.org/bootandy/dust) [![Build Status](https://travis-ci.org/bootandy/dust.svg?branch=master)](https://travis-ci.org/bootandy/dust)
# Dust # Dust
@@ -9,37 +10,35 @@ du + rust = dust. Like du but more intuitive.
Because I want an easy way to see where my disk is being used. Because I want an easy way to see where my disk is being used.
# Demo # Demo
![Example](media/snap.png) ![Example](media/snap.png)
## Install ## Install
#### Cargo <a href="https://repology.org/project/du-dust/versions"><img src="https://repology.org/badge/vertical-allrepos/du-dust.svg" alt="Packaging status" align="right"></a> #### Cargo <a href="https://repology.org/project/du-dust/versions"><img src="https://repology.org/badge/vertical-allrepos/du-dust.svg" alt="Packaging status" align="right"></a>
- `cargo install du-dust` * `cargo install du-dust`
#### 🍺 Homebrew (Mac OS) #### 🍺 Homebrew (Mac OS)
- `brew install dust` * `brew install dust`
#### 🍺 Homebrew (Linux) #### 🍺 Homebrew (Linux)
- `brew tap tgotwig/linux-dust && brew install dust` * `brew tap tgotwig/linux-dust && brew install dust`
#### [Pacstall](https://github.com/pacstall/pacstall) (Debian/Ubuntu) #### [Pacstall](https://github.com/pacstall/pacstall) (Debian/Ubuntu)
- `pacstall -I dust-bin` * `pacstall -I dust-bin`
#### Windows: #### Windows:
* Windows GNU version - works
- Windows GNU version - works * Windows MSVC - requires: [VCRUNTIME140.dll](https://docs.microsoft.com/en-gb/cpp/windows/latest-supported-vc-redist?view=msvc-170)
- Windows MSVC - requires: [VCRUNTIME140.dll](https://docs.microsoft.com/en-gb/cpp/windows/latest-supported-vc-redist?view=msvc-170)
#### Download #### Download
- Download Linux/Mac binary from [Releases](https://github.com/bootandy/dust/releases) * Download Linux/Mac binary from [Releases](https://github.com/bootandy/dust/releases)
- unzip file: `tar -xvf _downloaded_file.tar.gz` * unzip file: `tar -xvf _downloaded_file.tar.gz`
- move file to executable path: `sudo mv dust /usr/local/bin/` * move file to executable path: `sudo mv dust /usr/local/bin/`
## Overview ## Overview
@@ -70,17 +69,18 @@ Usage: dust -f (Count files instead of diskspace)
Usage: dust -t (Group by filetype) Usage: dust -t (Group by filetype)
Usage: dust -z 10M (min-size, Only include files larger than 10M) Usage: dust -z 10M (min-size, Only include files larger than 10M)
Usage: dust -e regex (Only include files matching this regex (eg dust -e "\.png$" would match png files)) Usage: dust -e regex (Only include files matching this regex (eg dust -e "\.png$" would match png files))
Usage: dust -v regex (Exclude files matching this regex (eg dust -v "\.png$" would ignore png files)) Usage: dust -v regex (Exculde files matching this regex (eg dust -v "\.png$" would ignore png files))
``` ```
## Alternatives ## Alternatives
- [NCDU](https://dev.yorhel.nl/ncdu) * [NCDU](https://dev.yorhel.nl/ncdu)
- [dutree](https://github.com/nachoparker/dutree) * [dutree](https://github.com/nachoparker/dutree)
- [dua](https://github.com/Byron/dua-cli/) * [dua](https://github.com/Byron/dua-cli/)
- [pdu](https://github.com/KSXGitHub/parallel-disk-usage) * [pdu](https://github.com/KSXGitHub/parallel-disk-usage)
- [dirstat-rs](https://github.com/scullionw/dirstat-rs) * [dirstat-rs](https://github.com/scullionw/dirstat-rs)
- du -d 1 -h | sort -h * du -d 1 -h | sort -h
Note: Apparent-size is calculated slightly differently in dust to gdu. In dust each hard link is counted as using file_length space. In gdu only the first entry is counted. Note: Apparent-size is calculated slightly differently in dust to gdu. In dust each hard link is counted as using file_length space. In gdu only the first entry is counted.
+5 -20
View File
@@ -11,9 +11,7 @@ mod utils;
use crate::cli::build_cli; use crate::cli::build_cli;
use std::collections::HashSet; use std::collections::HashSet;
use std::panic;
use std::process; use std::process;
use sysinfo::{System, SystemExt};
use self::display::draw_it; use self::display::draw_it;
use clap::Values; use clap::Values;
@@ -21,7 +19,6 @@ use config::get_config;
use dir_walker::{walk_it, WalkData}; use dir_walker::{walk_it, WalkData};
use filter::get_biggest; use filter::get_biggest;
use filter_type::get_all_file_types; use filter_type::get_all_file_types;
use rayon::ThreadPoolBuildError;
use regex::Regex; use regex::Regex;
use std::cmp::max; use std::cmp::max;
use std::path::PathBuf; use std::path::PathBuf;
@@ -157,10 +154,11 @@ fn main() {
by_filecount, by_filecount,
ignore_hidden: config.get_ignore_hidden(&options), ignore_hidden: config.get_ignore_hidden(&options),
}; };
let pool = panic::catch_unwind(init_rayon); // Larger stack size to handle cases with lots of nested directories
if pool.is_err() { rayon::ThreadPoolBuilder::new()
eprintln!("Warning: Could not configure threads {:?}", pool.err()); .stack_size(usize::pow(1024, 3))
} .build_global()
.unwrap();
let iso = config.get_iso(&options); let iso = config.get_iso(&options);
let (top_level_nodes, has_errors) = walk_it(simplified_dirs, walk_data); let (top_level_nodes, has_errors) = walk_it(simplified_dirs, walk_data);
@@ -193,16 +191,3 @@ fn main() {
) )
} }
} }
fn init_rayon() -> Result<(), ThreadPoolBuildError> {
let s = System::new_all();
let av = s.get_available_memory();
let free = s.get_free_memory();
println!("{}", av);
println!("{}", free);
// Larger stack size to handle cases with lots of nested directories
rayon::ThreadPoolBuilder::new()
.stack_size(usize::pow(1024, 3))
.build_global()
}
+1 -1
View File
@@ -196,7 +196,7 @@ pub fn test_apparent_size() {
} }
fn apparent_size_output() -> Vec<String> { fn apparent_size_output() -> Vec<String> {
// The apparent directory sizes are too unpredictable and system dependent to try and match // The apparent directory sizes are too unpredictable and system dependant to try and match
let files = r#" let files = r#"
0B ┌── a_file 0B ┌── a_file
6B ├── hello_file 6B ├── hello_file