mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge branch 'main' into fmt_implement_default_for_fmtoptions
This commit is contained in:
@@ -0,0 +1 @@
|
||||
github: uutils
|
||||
@@ -220,7 +220,7 @@ jobs:
|
||||
fault_type="${{ steps.vars.outputs.FAULT_TYPE }}"
|
||||
fault_prefix=$(echo "$fault_type" | tr '[:lower:]' '[:upper:]')
|
||||
# * convert any warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message>
|
||||
S=$(cargo clippy --all-targets ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_UTILITY_LIST_OPTIONS }} -- -W clippy::manual_string_new -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::${fault_type} file=\2,line=\3,col=\4::${fault_prefix}: \`cargo clippy\`: \1 (file:'\2', line:\3)/p;" -e '}' ; fault=true ; }
|
||||
S=$(cargo clippy --all-targets ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_UTILITY_LIST_OPTIONS }} -- -W clippy::default_trait_access -W clippy::manual_string_new -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::${fault_type} file=\2,line=\3,col=\4::${fault_prefix}: \`cargo clippy\`: \1 (file:'\2', line:\3)/p;" -e '}' ; fault=true ; }
|
||||
if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi
|
||||
|
||||
style_spellcheck:
|
||||
@@ -319,7 +319,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
RUSTDOCFLAGS="-Dwarnings" cargo doc ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --no-deps --workspace --document-private-items
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v10
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v11
|
||||
with:
|
||||
command: fix
|
||||
globs: |
|
||||
@@ -452,8 +452,20 @@ jobs:
|
||||
test -f /tmp/usr/local/share/man/man1/whoami.1
|
||||
# Check that the completion is present
|
||||
test -f /tmp/usr/local/share/zsh/site-functions/_install
|
||||
test -f /tmp/usr/local/share/bash-completion/completions/head
|
||||
test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
|
||||
env:
|
||||
RUST_BACKTRACE: "1"
|
||||
- name: "`make uninstall`"
|
||||
shell: bash
|
||||
run: |
|
||||
DESTDIR=/tmp/ make uninstall
|
||||
# Check that the manpage is not present
|
||||
! test -f /tmp/usr/local/share/man/man1/whoami.1
|
||||
# Check that the completion is not present
|
||||
! test -f /tmp/usr/local/share/zsh/site-functions/_install
|
||||
! test -f /tmp/usr/local/share/bash-completion/completions/head
|
||||
! test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
|
||||
|
||||
build_rust_stable:
|
||||
name: Build/stable
|
||||
@@ -1048,6 +1060,15 @@ jobs:
|
||||
name: toybox-result.json
|
||||
path: ${{ steps.vars.outputs.TEST_SUMMARY_FILE }}
|
||||
|
||||
toml_format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check
|
||||
run: npx --yes @taplo/cli fmt --check
|
||||
|
||||
coverage:
|
||||
name: Code Coverage
|
||||
runs-on: ${{ matrix.job.os }}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
name: CheckScripts
|
||||
|
||||
# spell-checker:ignore ludeeus mfinelli
|
||||
|
||||
env:
|
||||
SCRIPT_DIR: 'util'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'util/**/*.sh'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'util/**/*.sh'
|
||||
|
||||
# End the current execution if there is a new changeset in the PR.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
jobs:
|
||||
shell_check:
|
||||
name: ShellScript/Check
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run ShellCheck
|
||||
uses: ludeeus/action-shellcheck@master
|
||||
env:
|
||||
SHELLCHECK_OPTS: -s bash
|
||||
with:
|
||||
severity: warning
|
||||
scandir: ${{ env.SCRIPT_DIR }}
|
||||
format: tty
|
||||
|
||||
shell_fmt:
|
||||
name: ShellScript/Format
|
||||
# no need to run in pr events
|
||||
# shfmt will be performed on main branch when the PR is merged
|
||||
if: github.event_name != 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ shell_check ]
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup shfmt
|
||||
uses: mfinelli/setup-shfmt@v2
|
||||
- name: Run shfmt
|
||||
shell: bash
|
||||
run: |
|
||||
# show differs first for every files that need to be formatted
|
||||
# fmt options: bash syntax, 4 spaces indent, indent for switch-case
|
||||
echo "## show the differences between formatted and original scripts..."
|
||||
find ${{ env.SCRIPT_DIR }} -name "*.sh" -print0 | xargs -0 shfmt -ln=bash -i 4 -ci -d || true
|
||||
# perform a shell format
|
||||
echo "## perform a shell format..."
|
||||
# ignore the error code because `-d` will always return false when the file has difference
|
||||
find ${{ env.SCRIPT_DIR }} -name "*.sh" -print0 | xargs -0 shfmt -ln=bash -i 4 -ci -w
|
||||
- name: Commit any changes
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
default_author: github_actions
|
||||
message: "style: auto format by CI (shfmt)"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -31,12 +31,12 @@ jobs:
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
## VARs setup
|
||||
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||
# surface MSRV from CICD workflow
|
||||
RUST_MIN_SRV=$(grep -P "^\s+RUST_MIN_SRV:" .github/workflows/CICD.yml | grep -Po "(?<=\x22)\d+[.]\d+(?:[.]\d+)?(?=\x22)" )
|
||||
outputs RUST_MIN_SRV
|
||||
- uses: dtolnay/rust-toolchain@${{ steps.vars.outputs.RUST_MIN_SRV }}
|
||||
echo "RUST_MIN_SRV=${RUST_MIN_SRV}" >> $GITHUB_OUTPUT
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ steps.vars.outputs.RUST_MIN_SRV }}
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Ensure updated 'Cargo.lock'
|
||||
shell: bash
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
branch: ${{ env.BRANCH_TARGET }}
|
||||
new_branch: ${{ env.BRANCH_TARGET }}
|
||||
default_author: github_actions
|
||||
message: "maint ~ refresh 'Cargo.lock'"
|
||||
add: Cargo.lock
|
||||
@@ -90,13 +90,11 @@ jobs:
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
## VARs setup
|
||||
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
|
||||
# target-specific options
|
||||
# * CARGO_FEATURES_OPTION
|
||||
CARGO_FEATURES_OPTION='' ;
|
||||
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi
|
||||
outputs CARGO_FEATURES_OPTION
|
||||
echo "CARGO_FEATURES_OPTION=${CARGO_FEATURES_OPTION}" >> $GITHUB_OUTPUT
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
@@ -114,7 +112,7 @@ jobs:
|
||||
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
branch: ${{ env.BRANCH_TARGET }}
|
||||
new_branch: ${{ env.BRANCH_TARGET }}
|
||||
default_author: github_actions
|
||||
message: "maint ~ rustfmt (`cargo fmt`)"
|
||||
env:
|
||||
|
||||
@@ -205,7 +205,7 @@ jobs:
|
||||
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
|
||||
# https://github.com/uutils/coreutils/issues/4294
|
||||
# https://github.com/uutils/coreutils/issues/4295
|
||||
IGNORE_INTERMITTENT='${path_UUTILS}/.github/workflows/ignore-intermittent.txt'
|
||||
IGNORE_INTERMITTENT="${path_UUTILS}/.github/workflows/ignore-intermittent.txt"
|
||||
|
||||
mkdir -p ${{ steps.vars.outputs.path_reference }}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
- name: Run sccache-cache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
- name: Prepare, build and test
|
||||
uses: vmactions/freebsd-vm@v0.3.0
|
||||
uses: vmactions/freebsd-vm@v0.3.1
|
||||
with:
|
||||
usesh: true
|
||||
# We need jq to run show-utils.sh and bash to use inline shell string replacement
|
||||
@@ -125,7 +125,7 @@ jobs:
|
||||
- name: Run sccache-cache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
- name: Prepare, build and test
|
||||
uses: vmactions/freebsd-vm@v0.3.0
|
||||
uses: vmactions/freebsd-vm@v0.3.1
|
||||
with:
|
||||
usesh: true
|
||||
# sync: sshfs
|
||||
|
||||
@@ -5,6 +5,7 @@ target/
|
||||
/busybox/
|
||||
/.vscode/
|
||||
/.vs/
|
||||
/public/
|
||||
*~
|
||||
.*.swp
|
||||
.*.swo
|
||||
|
||||
Vendored
+1
@@ -19,6 +19,7 @@
|
||||
// files to ignore (globs supported)
|
||||
"ignorePaths": [
|
||||
"Cargo.lock",
|
||||
"oranda.json",
|
||||
"target/**",
|
||||
"tests/**/fixtures/**",
|
||||
"src/uu/dd/test-resources/**",
|
||||
|
||||
@@ -356,6 +356,7 @@ The Coreutils have different implementations, with different levels of completio
|
||||
* [V lang](https://github.com/vlang/coreutils)
|
||||
* [SerenityOS](https://github.com/SerenityOS/serenity/tree/master/Userland/Utilities)
|
||||
* [Initial Unix](https://github.com/dspinellis/unix-history-repo)
|
||||
* [Perl Power Tools](https://metacpan.org/pod/PerlPowerTools)
|
||||
|
||||
However, when reimplementing the tools/options in Rust, don't read their source codes
|
||||
when they are using reciprocal licenses (ex: GNU GPL, GNU LGPL, etc).
|
||||
|
||||
Generated
+416
-524
File diff suppressed because it is too large
Load Diff
+338
-338
File diff suppressed because it is too large
Load Diff
+25
-7
@@ -1,4 +1,4 @@
|
||||
# spell-checker:ignore (misc) testsuite runtest findstring (targets) busytest toybox distclean pkgs nextest ; (vars/env) BINDIR BUILDDIR CARGOFLAGS DESTDIR DOCSDIR INSTALLDIR INSTALLEES MULTICALL DATAROOTDIR TESTDIR
|
||||
# spell-checker:ignore (misc) testsuite runtest findstring (targets) busytest toybox distclean pkgs nextest ; (vars/env) BINDIR BUILDDIR CARGOFLAGS DESTDIR DOCSDIR INSTALLDIR INSTALLEES MULTICALL DATAROOTDIR TESTDIR manpages
|
||||
|
||||
# Config options
|
||||
PROFILE ?= debug
|
||||
@@ -337,7 +337,21 @@ clean:
|
||||
distclean: clean
|
||||
$(CARGO) clean $(CARGOFLAGS) && $(CARGO) update $(CARGOFLAGS)
|
||||
|
||||
install: build
|
||||
manpages: build-coreutils
|
||||
mkdir -p $(BUILDDIR)/man/
|
||||
$(foreach prog, $(INSTALLEES), \
|
||||
$(BUILDDIR)/coreutils manpage $(prog) > $(BUILDDIR)/man/$(PROG_PREFIX)$(prog).1; \
|
||||
)
|
||||
|
||||
completions: build-coreutils
|
||||
mkdir -p $(BUILDDIR)/completions/zsh $(BUILDDIR)/completions/bash $(BUILDDIR)/completions/fish
|
||||
$(foreach prog, $(INSTALLEES), \
|
||||
$(BUILDDIR)/coreutils completion $(prog) zsh > $(BUILDDIR)/completions/zsh/_$(PROG_PREFIX)$(prog); \
|
||||
$(BUILDDIR)/coreutils completion $(prog) bash > $(BUILDDIR)/completions/bash/$(PROG_PREFIX)$(prog); \
|
||||
$(BUILDDIR)/coreutils completion $(prog) fish > $(BUILDDIR)/completions/fish/$(PROG_PREFIX)$(prog).fish; \
|
||||
)
|
||||
|
||||
install: build manpages completions
|
||||
mkdir -p $(INSTALLDIR_BIN)
|
||||
ifeq (${MULTICALL}, y)
|
||||
$(INSTALL) $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
|
||||
@@ -349,15 +363,18 @@ else
|
||||
$(INSTALL) $(BUILDDIR)/$(prog) $(INSTALLDIR_BIN)/$(PROG_PREFIX)$(prog);)
|
||||
$(if $(findstring test,$(INSTALLEES)), $(INSTALL) $(BUILDDIR)/test $(INSTALLDIR_BIN)/$(PROG_PREFIX)[)
|
||||
endif
|
||||
mkdir -p $(DESTDIR)$(DATAROOTDIR)/man/man1
|
||||
$(foreach prog, $(INSTALLEES), \
|
||||
$(INSTALL) $(BUILDDIR)/man/$(PROG_PREFIX)$(prog).1 $(DESTDIR)$(DATAROOTDIR)/man/man1/; \
|
||||
)
|
||||
|
||||
mkdir -p $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions
|
||||
mkdir -p $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions
|
||||
mkdir -p $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d
|
||||
mkdir -p $(DESTDIR)$(DATAROOTDIR)/man/man1
|
||||
$(foreach prog, $(INSTALLEES), \
|
||||
$(BUILDDIR)/coreutils completion $(prog) zsh > $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions/_$(PROG_PREFIX)$(prog); \
|
||||
$(BUILDDIR)/coreutils completion $(prog) bash > $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions/$(PROG_PREFIX)$(prog); \
|
||||
$(BUILDDIR)/coreutils completion $(prog) fish > $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d/$(PROG_PREFIX)$(prog).fish; \
|
||||
$(BUILDDIR)/coreutils manpage $(prog) > $(DESTDIR)$(DATAROOTDIR)/man/man1/$(PROG_PREFIX)$(prog).1; \
|
||||
$(INSTALL) $(BUILDDIR)/completions/zsh/_$(PROG_PREFIX)$(prog) $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions/; \
|
||||
$(INSTALL) $(BUILDDIR)/completions/bash/$(PROG_PREFIX)$(prog) $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions/; \
|
||||
$(INSTALL) $(BUILDDIR)/completions/fish/$(PROG_PREFIX)$(prog).fish $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d/; \
|
||||
)
|
||||
|
||||
uninstall:
|
||||
@@ -369,5 +386,6 @@ endif
|
||||
rm -f $(addprefix $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions/_$(PROG_PREFIX),$(PROGS))
|
||||
rm -f $(addprefix $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions/$(PROG_PREFIX),$(PROGS))
|
||||
rm -f $(addprefix $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d/$(PROG_PREFIX),$(addsuffix .fish,$(PROGS)))
|
||||
rm -f $(addprefix $(DESTDIR)$(DATAROOTDIR)/man/man1/$(PROG_PREFIX),$(addsuffix .1,$(PROGS)))
|
||||
|
||||
.PHONY: all build build-coreutils build-pkgs test distclean clean busytest install uninstall
|
||||
|
||||
+56
-106
@@ -20,15 +20,12 @@ run_task = "_init"
|
||||
|
||||
[tasks._init]
|
||||
private = true
|
||||
dependencies = [
|
||||
"_init-vars",
|
||||
]
|
||||
dependencies = ["_init-vars"]
|
||||
|
||||
[tasks._init-vars]
|
||||
private = true
|
||||
script_runner = "@duckscript"
|
||||
script = [
|
||||
'''
|
||||
script = ['''
|
||||
# reset build/test flags
|
||||
set_env CARGO_MAKE_CARGO_BUILD_TEST_FLAGS ""
|
||||
# determine features
|
||||
@@ -90,54 +87,36 @@ for arg in "${args_utils_list}"
|
||||
end
|
||||
args_utils = trim "${args_utils}"
|
||||
set_env CARGO_MAKE_TASK_BUILD_UTILS_ARGS "${args_utils}"
|
||||
'''
|
||||
]
|
||||
''']
|
||||
|
||||
### tasks
|
||||
|
||||
[tasks.default]
|
||||
description = "## *DEFAULT* Build (debug-mode) and test project"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"action-build-debug",
|
||||
"test-terse",
|
||||
]
|
||||
dependencies = ["action-build-debug", "test-terse"]
|
||||
|
||||
##
|
||||
|
||||
[tasks.build]
|
||||
description = "## Build (release-mode) project"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"core::pre-build",
|
||||
"action-build-release",
|
||||
"core::post-build",
|
||||
]
|
||||
dependencies = ["core::pre-build", "action-build-release", "core::post-build"]
|
||||
|
||||
[tasks.build-debug]
|
||||
description = "## Build (debug-mode) project"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"action-build-debug",
|
||||
]
|
||||
dependencies = ["action-build-debug"]
|
||||
|
||||
[tasks.build-examples]
|
||||
description = "## Build (release-mode) project example(s); usage: `cargo make (build-examples | examples) [EXAMPLE]...`"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"core::pre-build",
|
||||
"action-build-examples",
|
||||
"core::post-build",
|
||||
]
|
||||
dependencies = ["core::pre-build", "action-build-examples", "core::post-build"]
|
||||
|
||||
[tasks.build-features]
|
||||
description = "## Build (with features; release-mode) project; usage: `cargo make (build-features | features) FEATURE...`"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"core::pre-build",
|
||||
"action-build-features",
|
||||
"core::post-build",
|
||||
]
|
||||
dependencies = ["core::pre-build", "action-build-features", "core::post-build"]
|
||||
|
||||
[tasks.build-release]
|
||||
alias = "build"
|
||||
@@ -148,9 +127,7 @@ alias = "build-debug"
|
||||
[tasks.example]
|
||||
description = "hidden singular-form alias for 'examples'"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"examples",
|
||||
]
|
||||
dependencies = ["examples"]
|
||||
|
||||
[tasks.examples]
|
||||
alias = "build-examples"
|
||||
@@ -161,17 +138,12 @@ alias = "build-features"
|
||||
[tasks.format]
|
||||
description = "## Format code files (with `cargo fmt`; includes tests)"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"action-format",
|
||||
"action-format-tests",
|
||||
]
|
||||
dependencies = ["action-format", "action-format-tests"]
|
||||
|
||||
[tasks.help]
|
||||
description = "## Display help"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"action-display-help",
|
||||
]
|
||||
dependencies = ["action-display-help"]
|
||||
|
||||
[tasks.install]
|
||||
description = "## Install project binary (to $HOME/.cargo/bin)"
|
||||
@@ -182,10 +154,7 @@ args = ["install", "--path", "."]
|
||||
[tasks.lint]
|
||||
description = "## Display lint report"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"action-clippy",
|
||||
"action-fmt_report",
|
||||
]
|
||||
dependencies = ["action-clippy", "action-fmt_report"]
|
||||
|
||||
[tasks.release]
|
||||
alias = "build"
|
||||
@@ -193,48 +162,32 @@ alias = "build"
|
||||
[tasks.test]
|
||||
description = "## Run project tests"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"core::pre-test",
|
||||
"core::test",
|
||||
"core::post-test",
|
||||
]
|
||||
dependencies = ["core::pre-test", "core::test", "core::post-test"]
|
||||
|
||||
[tasks.test-terse]
|
||||
description = "## Run project tests (with terse/summary output)"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"core::pre-test",
|
||||
"action-test_quiet",
|
||||
"core::post-test",
|
||||
]
|
||||
dependencies = ["core::pre-test", "action-test_quiet", "core::post-test"]
|
||||
|
||||
[tasks.test-util]
|
||||
description = "## Test (individual) utilities; usage: `cargo make (test-util | test-uutil) [UTIL_NAME...]`"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"action-test-utils",
|
||||
]
|
||||
dependencies = ["action-test-utils"]
|
||||
|
||||
[tasks.test-utils]
|
||||
description = "hidden plural-form alias for 'test-util'"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"test-util",
|
||||
]
|
||||
dependencies = ["test-util"]
|
||||
|
||||
[tasks.test-uutil]
|
||||
description = "hidden alias for 'test-util'"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"test-util",
|
||||
]
|
||||
dependencies = ["test-util"]
|
||||
|
||||
[tasks.test-uutils]
|
||||
description = "hidden alias for 'test-util'"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"test-util",
|
||||
]
|
||||
dependencies = ["test-util"]
|
||||
|
||||
[tasks.uninstall]
|
||||
description = "## Remove project binary (from $HOME/.cargo/bin)"
|
||||
@@ -246,63 +199,66 @@ args = ["uninstall"]
|
||||
description = "## Build (individual; release-mode) utilities; usage: `cargo make (util | uutil) [UTIL_NAME...]`"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"core::pre-build",
|
||||
"action-determine-utils",
|
||||
"action-build-utils",
|
||||
"core::post-build",
|
||||
"core::pre-build",
|
||||
"action-determine-utils",
|
||||
"action-build-utils",
|
||||
"core::post-build",
|
||||
]
|
||||
|
||||
[tasks.utils]
|
||||
description = "hidden plural-form alias for 'util'"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"util",
|
||||
]
|
||||
dependencies = ["util"]
|
||||
|
||||
[tasks.uutil]
|
||||
description = "hidden alias for 'util'"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"util",
|
||||
]
|
||||
dependencies = ["util"]
|
||||
|
||||
[tasks.uutils]
|
||||
description = "hidden plural-form alias for 'util'"
|
||||
category = "[project]"
|
||||
dependencies = [
|
||||
"util",
|
||||
]
|
||||
dependencies = ["util"]
|
||||
|
||||
### actions
|
||||
|
||||
[tasks.action-build-release]
|
||||
description = "`cargo build --release`"
|
||||
command = "cargo"
|
||||
args = ["build", "--release", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )" ]
|
||||
args = ["build", "--release", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )"]
|
||||
|
||||
[tasks.action-build-debug]
|
||||
description = "`cargo build`"
|
||||
command = "cargo"
|
||||
args = ["build", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )" ]
|
||||
args = ["build", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )"]
|
||||
|
||||
[tasks.action-build-examples]
|
||||
description = "`cargo build (--examples|(--example EXAMPLE)...)`"
|
||||
command = "cargo"
|
||||
args = ["build", "--release", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", "${CARGO_MAKE_TASK_BUILD_EXAMPLES_ARGS}" ]
|
||||
args = [
|
||||
"build",
|
||||
"--release",
|
||||
"@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )",
|
||||
"${CARGO_MAKE_TASK_BUILD_EXAMPLES_ARGS}",
|
||||
]
|
||||
|
||||
[tasks.action-build-features]
|
||||
description = "`cargo build --release --features FEATURES`"
|
||||
command = "cargo"
|
||||
args = ["build", "--release", "--no-default-features", "--features", "${CARGO_MAKE_TASK_BUILD_FEATURES_ARGS}" ]
|
||||
args = [
|
||||
"build",
|
||||
"--release",
|
||||
"--no-default-features",
|
||||
"--features",
|
||||
"${CARGO_MAKE_TASK_BUILD_FEATURES_ARGS}",
|
||||
]
|
||||
|
||||
[tasks.action-build-utils]
|
||||
description = "Build individual utilities"
|
||||
dependencies = [
|
||||
"action-determine-utils",
|
||||
]
|
||||
dependencies = ["action-determine-utils"]
|
||||
command = "cargo"
|
||||
# args = ["build", "@@remove-empty(CARGO_MAKE_TASK_BUILD_UTILS_ARGS)" ]
|
||||
args = ["build", "--release", "@@split(CARGO_MAKE_TASK_BUILD_UTILS_ARGS, )" ]
|
||||
args = ["build", "--release", "@@split(CARGO_MAKE_TASK_BUILD_UTILS_ARGS, )"]
|
||||
|
||||
[tasks.action-clippy]
|
||||
description = "`cargo clippy` lint report"
|
||||
@@ -311,8 +267,7 @@ args = ["clippy", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )"]
|
||||
|
||||
[tasks.action-determine-utils]
|
||||
script_runner = "@duckscript"
|
||||
script = [
|
||||
'''
|
||||
script = ['''
|
||||
package_options = get_env CARGO_MAKE_TASK_BUILD_UTILS_ARGS
|
||||
if is_empty "${package_options}"
|
||||
show_utils = get_env CARGO_MAKE_VAR_SHOW_UTILS
|
||||
@@ -335,13 +290,11 @@ if is_empty "${package_options}"
|
||||
package_options = trim "${package_options}"
|
||||
end_if
|
||||
set_env CARGO_MAKE_TASK_BUILD_UTILS_ARGS "${package_options}"
|
||||
'''
|
||||
]
|
||||
''']
|
||||
|
||||
[tasks.action-determine-tests]
|
||||
script_runner = "@duckscript"
|
||||
script = [
|
||||
'''
|
||||
script = ['''
|
||||
test_files = glob_array tests/**/*.rs
|
||||
for file in ${test_files}
|
||||
file = replace "${file}" "\\" "/"
|
||||
@@ -354,8 +307,7 @@ for file in ${test_files}
|
||||
end_if
|
||||
end
|
||||
set_env CARGO_MAKE_VAR_TESTS "${tests}"
|
||||
'''
|
||||
]
|
||||
''']
|
||||
|
||||
[tasks.action-format]
|
||||
description = "`cargo fmt`"
|
||||
@@ -364,9 +316,7 @@ args = ["fmt"]
|
||||
|
||||
[tasks.action-format-tests]
|
||||
description = "`cargo fmt` tests"
|
||||
dependencies = [
|
||||
"action-determine-tests",
|
||||
]
|
||||
dependencies = ["action-determine-tests"]
|
||||
command = "cargo"
|
||||
args = ["fmt", "--", "@@split(CARGO_MAKE_VAR_TESTS, )"]
|
||||
|
||||
@@ -381,16 +331,18 @@ args = ["fmt", "--", "--check"]
|
||||
[tasks.action-spellcheck-codespell]
|
||||
description = "`codespell` spellcheck repository"
|
||||
command = "codespell" # (from `pip install codespell`)
|
||||
args = [".", "--skip=*/.git,./target,./tests/fixtures", "--ignore-words-list=mut,od"]
|
||||
args = [
|
||||
".",
|
||||
"--skip=*/.git,./target,./tests/fixtures",
|
||||
"--ignore-words-list=mut,od",
|
||||
]
|
||||
|
||||
[tasks.action-test-utils]
|
||||
description = "Build individual utilities"
|
||||
dependencies = [
|
||||
"action-determine-utils",
|
||||
]
|
||||
dependencies = ["action-determine-utils"]
|
||||
command = "cargo"
|
||||
# args = ["build", "@@remove-empty(CARGO_MAKE_TASK_BUILD_UTILS_ARGS)" ]
|
||||
args = ["test", "@@split(CARGO_MAKE_TASK_BUILD_UTILS_ARGS, )" ]
|
||||
args = ["test", "@@split(CARGO_MAKE_TASK_BUILD_UTILS_ARGS, )"]
|
||||
|
||||
[tasks.action-test_quiet]
|
||||
description = "Test (in `--quiet` mode)"
|
||||
@@ -399,8 +351,7 @@ args = ["test", "--quiet", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )"]
|
||||
|
||||
[tasks.action-display-help]
|
||||
script_runner = "@duckscript"
|
||||
script = [
|
||||
'''
|
||||
script = ['''
|
||||
echo ""
|
||||
echo "usage: `cargo make TARGET [ARGS...]`"
|
||||
echo ""
|
||||
@@ -432,5 +383,4 @@ script = [
|
||||
end_if
|
||||
end
|
||||
echo ""
|
||||
'''
|
||||
]
|
||||
''']
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!-- markdownlint-disable MD033 MD041 MD002 -->
|
||||
<!-- markdownlint-disable commands-show-output no-duplicate-heading -->
|
||||
<!-- spell-checker:ignore markdownlint ; (options) DESTDIR UTILNAME manpages reimplementation -->
|
||||
<!-- spell-checker:ignore markdownlint ; (options) DESTDIR UTILNAME manpages reimplementation oranda -->
|
||||
<div class="oranda-hide">
|
||||
<div align="center">
|
||||
|
||||

|
||||
@@ -19,11 +20,14 @@
|
||||
|
||||
---
|
||||
|
||||
</div>
|
||||
|
||||
uutils coreutils is a cross-platform reimplementation of the GNU coreutils in
|
||||
[Rust](http://www.rust-lang.org). While all programs have been implemented, some
|
||||
options might be missing or different behavior might be experienced.
|
||||
|
||||
<div class="oranda-hide">
|
||||
|
||||
To install it:
|
||||
|
||||
```shell
|
||||
@@ -31,6 +35,8 @@ cargo install coreutils
|
||||
~/.cargo/bin/coreutils
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
<!-- markdownlint-disable-next-line MD026 -->
|
||||
|
||||
## Goals
|
||||
@@ -42,6 +48,8 @@ uutils aims to work on as many platforms as possible, to be able to use the same
|
||||
utils on Linux, Mac, Windows and other platforms. This ensures, for example,
|
||||
that scripts can be easily transferred between platforms.
|
||||
|
||||
<div class="oranda-hide">
|
||||
|
||||
## Documentation
|
||||
|
||||
uutils has both user and developer documentation available:
|
||||
@@ -52,6 +60,7 @@ uutils has both user and developer documentation available:
|
||||
Both can also be generated locally, the instructions for that can be found in
|
||||
the [coreutils docs](https://github.com/uutils/uutils.github.io) repository.
|
||||
|
||||
|
||||
<!-- ANCHOR: build (this mark is needed for mdbook) -->
|
||||
|
||||
## Requirements
|
||||
@@ -301,6 +310,8 @@ See <https://github.com/uutils/coreutils/issues/3336> for the main meta bugs
|
||||
|
||||

|
||||
|
||||
</div> <!-- close oranda-hide div -->
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute to uutils, please see [CONTRIBUTING](CONTRIBUTING.md).
|
||||
|
||||
@@ -38,14 +38,14 @@ pub fn main() {
|
||||
let mut mf = File::create(Path::new(&out_dir).join("uutils_map.rs")).unwrap();
|
||||
|
||||
mf.write_all(
|
||||
"type UtilityMap<T> = phf::Map<&'static str, (fn(T) -> i32, fn() -> Command)>;\n\
|
||||
"type UtilityMap<T> = phf::OrderedMap<&'static str, (fn(T) -> i32, fn() -> Command)>;\n\
|
||||
\n\
|
||||
fn util_map<T: uucore::Args>() -> UtilityMap<T> {\n"
|
||||
.as_bytes(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut phf_map = phf_codegen::Map::<&str>::new();
|
||||
let mut phf_map = phf_codegen::OrderedMap::<&str>::new();
|
||||
for krate in &crates {
|
||||
let map_value = format!("({krate}::uumain, {krate}::uu_app)");
|
||||
match krate.as_ref() {
|
||||
|
||||
@@ -11,7 +11,7 @@ unmaintained = "warn"
|
||||
yanked = "warn"
|
||||
notice = "warn"
|
||||
ignore = [
|
||||
#"RUSTSEC-0000-0000",
|
||||
#"RUSTSEC-0000-0000",
|
||||
]
|
||||
|
||||
# This section is considered when running `cargo deny check licenses`
|
||||
@@ -20,15 +20,14 @@ ignore = [
|
||||
[licenses]
|
||||
unlicensed = "deny"
|
||||
allow = [
|
||||
"MIT",
|
||||
"Apache-2.0",
|
||||
"ISC",
|
||||
"BSD-2-Clause",
|
||||
"BSD-2-Clause-FreeBSD",
|
||||
"BSD-3-Clause",
|
||||
"CC0-1.0",
|
||||
"MPL-2.0", # XXX considered copyleft?
|
||||
"Unicode-DFS-2016",
|
||||
"MIT",
|
||||
"Apache-2.0",
|
||||
"ISC",
|
||||
"BSD-2-Clause",
|
||||
"BSD-2-Clause-FreeBSD",
|
||||
"BSD-3-Clause",
|
||||
"CC0-1.0",
|
||||
"Unicode-DFS-2016",
|
||||
]
|
||||
copyleft = "deny"
|
||||
allow-osi-fsf-free = "neither"
|
||||
@@ -59,29 +58,37 @@ highlight = "all"
|
||||
# introduces it.
|
||||
# spell-checker: disable
|
||||
skip = [
|
||||
# is-terminal
|
||||
{ name = "hermit-abi", version = "0.3.1" },
|
||||
# is-terminal
|
||||
{ name = "rustix", version = "0.36.14" },
|
||||
# is-terminal (via rustix)
|
||||
{ name = "io-lifetimes", version = "1.0.5" },
|
||||
# is-terminal
|
||||
{ name = "linux-raw-sys", version = "0.1.4" },
|
||||
# is-terminal
|
||||
{ name = "windows-sys", version = "0.45.0" },
|
||||
{ name = "windows-targets", version = "0.42.2" },
|
||||
{ name = "windows_aarch64_gnullvm", version = "0.42.2" },
|
||||
{ name = "windows_aarch64_msvc", version = "0.42.2" },
|
||||
{ name = "windows_i686_gnu", version = "0.42.2" },
|
||||
{ name = "windows_i686_msvc", version = "0.42.2" },
|
||||
{ name = "windows_x86_64_gnu", version = "0.42.2" },
|
||||
{ name = "windows_x86_64_gnullvm", version = "0.42.2" },
|
||||
{ name = "windows_x86_64_msvc", version = "0.42.2" },
|
||||
|
||||
# tempfile
|
||||
{ name = "redox_syscall", version = "0.3.5" },
|
||||
# cpp_macros
|
||||
{ name = "aho-corasick", version = "0.7.19" },
|
||||
# procfs
|
||||
{ name = "rustix", version = "0.36.15" },
|
||||
# rustix
|
||||
{ name = "linux-raw-sys", version = "0.1.4" },
|
||||
{ name = "linux-raw-sys", version = "0.3.8" },
|
||||
# tempfile
|
||||
{ name = "rustix", version = "0.37.23" },
|
||||
# various crates
|
||||
{ name = "windows-sys", version = "0.45.0" },
|
||||
# windows-sys
|
||||
{ name = "windows-targets", version = "0.42.2" },
|
||||
# windows-targets
|
||||
{ name = "windows_aarch64_gnullvm", version = "0.42.2" },
|
||||
# windows-targets
|
||||
{ name = "windows_aarch64_msvc", version = "0.42.2" },
|
||||
# windows-targets
|
||||
{ name = "windows_i686_gnu", version = "0.42.2" },
|
||||
# windows-targets
|
||||
{ name = "windows_i686_msvc", version = "0.42.2" },
|
||||
# windows-targets
|
||||
{ name = "windows_x86_64_gnu", version = "0.42.2" },
|
||||
# windows-targets
|
||||
{ name = "windows_x86_64_gnullvm", version = "0.42.2" },
|
||||
# windows-targets
|
||||
{ name = "windows_x86_64_msvc", version = "0.42.2" },
|
||||
# cpp_macros
|
||||
{ name = "aho-corasick", version = "0.7.20" },
|
||||
# various crates
|
||||
{ name = "syn", version = "1.0.109" },
|
||||
# various crates
|
||||
{ name = "bitflags", version = "1.3.2" },
|
||||
]
|
||||
# spell-checker: enable
|
||||
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ src = "src"
|
||||
title = "uutils Documentation"
|
||||
|
||||
[output.html]
|
||||
git-repository-url = "https://github.com/rust-lang/cargo/tree/master/src/doc/src"
|
||||
git-repository-url = "https://github.com/uutils/coreutils/tree/main/docs/src"
|
||||
|
||||
[preprocessor.toc]
|
||||
command = "mdbook-toc"
|
||||
renderer = ["html"]
|
||||
renderer = ["html"]
|
||||
|
||||
+16
-3
@@ -61,7 +61,20 @@ feature is adopted from [FreeBSD](https://www.freebsd.org/cgi/man.cgi?cut).
|
||||
|
||||
## `fmt`
|
||||
|
||||
`fmt` has additional flags for prefixes: `-P/--skip-prefix`, `-x/--exact-prefix`, and
|
||||
`-X/--exact-skip-prefix`. With `-m/--preserve-headers`, an attempt is made to detect and preserve
|
||||
mail headers in the input. `-q/--quick` breaks lines more quickly. And `-T/--tab-width` defines the
|
||||
`fmt` has additional flags for prefixes: `-P`/`--skip-prefix`, `-x`/`--exact-prefix`, and
|
||||
`-X`/`--exact-skip-prefix`. With `-m`/`--preserve-headers`, an attempt is made to detect and preserve
|
||||
mail headers in the input. `-q`/`--quick` breaks lines more quickly. And `-T`/`--tab-width` defines the
|
||||
number of spaces representing a tab when determining the line length.
|
||||
|
||||
## `seq`
|
||||
|
||||
`seq` provides `-t`/`--terminator` to set the terminator character.
|
||||
|
||||
## `ls`
|
||||
|
||||
GNU `ls` provides two ways to use a long listing format: `-l` and `--format=long`. We support a
|
||||
third way: `--long`.
|
||||
|
||||
## `du`
|
||||
|
||||
`du` allows `birth` and `creation` as values for the `--time` argument to show the creation time.
|
||||
|
||||
@@ -37,7 +37,7 @@ apk update uutils-coreutils
|
||||
|
||||
### Arch
|
||||
|
||||
[](https://archlinux.org/packages/community/x86_64/uutils-coreutils/)
|
||||
[](https://archlinux.org/packages/extra/x86_64/uutils-coreutils/)
|
||||
|
||||
```shell
|
||||
pacman -S uutils-coreutils
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
.logo {
|
||||
display: block;
|
||||
height: 170px;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user