1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

addresses a few more issues from PR#2474

- adds project header to multiple files
- updates spell check skip words
- removes linux only flags direct,noatime from mac_os build
- applies rustfmt to test_dd
This commit is contained in:
Tyler 2021-07-06 15:35:48 -07:00
parent 09acfce995
commit d2cebad931
10 changed files with 43 additions and 24 deletions

View file

@ -1,6 +1,16 @@
// Conversion tables are just lookup tables.
// This file is part of the uutils coreutils package.
//
// (c) Tyler Steele <tyler.steele@protonmail.com>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore (UCASE LCASE)
// Note: Conversion tables are just lookup tables.
// eg. The ASCII->EBCDIC table stores the EBCDIC code at the index
// obtained by treating the ASCII representation as a number.
pub type ConversionTable = [u8; 256];
pub const ASCII_UCASE_TO_LCASE: ConversionTable = [

View file

@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore (ToDO) ctable noerror
// spell-checker:ignore (TODO ctable noerror)
use crate::conversion_tables::*;
@ -179,17 +179,17 @@ impl std::fmt::Display for InternalError {
impl Error for InternalError {}
pub mod options {
pub const INFILE: &'static str = "if";
pub const OUTFILE: &'static str = "of";
pub const IBS: &'static str = "ibs";
pub const OBS: &'static str = "obs";
pub const BS: &'static str = "bs";
pub const CBS: &'static str = "cbs";
pub const COUNT: &'static str = "count";
pub const SKIP: &'static str = "skip";
pub const SEEK: &'static str = "seek";
pub const STATUS: &'static str = "status";
pub const CONV: &'static str = "conv";
pub const IFLAG: &'static str = "iflag";
pub const OFLAG: &'static str = "oflag";
pub const INFILE: &str = "if";
pub const OUTFILE: &str = "of";
pub const IBS: &str = "ibs";
pub const OBS: &str = "obs";
pub const BS: &str = "bs";
pub const CBS: &str = "cbs";
pub const COUNT: &str = "count";
pub const SKIP: &str = "skip";
pub const SEEK: &str = "seek";
pub const STATUS: &str = "status";
pub const CONV: &str = "conv";
pub const IFLAG: &str = "iflag";
pub const OFLAG: &str = "oflag";
}

View file

@ -5,7 +5,7 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore (parseargs xfer cflags iflags parseargs parseargs xfer cflags iflags iflags iflags xfer cflags oflags oflags oflags oflags dsync DSYNC noatime NOATIME noctty NOCTTY nofollow NOFOLLOW nonblock NONBLOCK xfer cflags fname fname tlen rlen fullblock rlen tlen tlen noerror rlen rlen remaing plen plen plen plen oflag dsync DSYNC noatime NOATIME noctty NOCTTY nofollow NOFOLLOW nonblock NONBLOCK fname notrunc nocreat fname wlen wlen wlen wlen rstat rstat curr curr curr curr rposition rstat ctable ctable rstat ctable ctable btotal btotal btotal btotal SIGUSR SIGUSR sigval SIGINFO SIGINFO sigval SIGINFO SIGINFO SIGUSR sigval SIGUSR permenantly sigval itegral itegral wstat rmax rmax rmax rsofar rremain rmax rsofar rremain bmax bmax bmax bremain bmax wstat bremain wstat wstat opertaions Noxfer opertaions fileout Noxfer INFILE OUTFILE fileout fileout INFILE INFILE OUTFILE OUTFILE iflag oflag iflag noxfer ucase lcase ucase lcase nocreat nocreat notrunc noerror IFLAG IFLAG iflag iflag fullblock oflag dsync syncronized syncronized nonblock noatime nocache noctty nofollow notrunc OFLAG OFLAG oflag notrunc dsync syncronized syncronized nonblock noatime nocache noctty nofollow T0DO)
// spell-checker:ignore (bmax bremain btotal cflags ctable curr dsync DSYNC fileout fname fullblock iflags INFILE noatime NOATIME nocreat noctty NOCTTY noerror nofollow NOFOLLOW nonblock NONBLOCK notrunc Noxfer oflag oflags OUTFILE parseargs plen rlen rmax rposition rremain rsofar rstat SIGINFO SIGUSR sigval tlen wlen wstat xfer)
#[macro_use]
extern crate uucore;
@ -27,8 +27,6 @@ use byte_unit::Byte;
use clap::{self, crate_version};
use debug_print::debug_println;
use gcd::Gcd;
#[cfg(unix)]
use libc;
use signal_hook::consts::signal;
use std::cmp;
use std::convert::TryInto;
@ -139,10 +137,9 @@ impl Input<File> {
let mut opts = OpenOptions::new();
opts.read(true);
if cfg!(unix) {
if let Some(libc_flags) = make_unix_iflags(&iflags) {
opts.custom_flags(libc_flags);
}
#[cfg(target_os = "linux")]
if let Some(libc_flags) = make_unix_iflags(&iflags) {
opts.custom_flags(libc_flags);
}
opts.open(fname)?
@ -783,7 +780,7 @@ fn print_xfer_stats(update: &ProgUpdate) {
fn gen_prog_updater(
rx: mpsc::Receiver<ProgUpdate>,
xfer_stats: Option<StatusLevel>,
) -> impl Fn() -> () {
) -> impl Fn() {
// --------------------------------------------------------------
fn posixly_correct() -> bool {
env::var("POSIXLY_CORRECT").is_ok()

View file

@ -1,3 +1,5 @@
// spell-checker:ignore (Fileio fname fpath fullblock gibi ifile iflag infile lcase noatime nocreat notrunc noxfer ofile oflag outfile specfile testfile TESTFILE tname ucase unspec urand)
use super::*;
const NL: u8 = '\n' as u8;

View file

@ -1,3 +1,5 @@
// spell-checker:ignore (Fileio fname fpath fullblock gibi ifile iflag infile lcase noatime nocreat notrunc noxfer ofile oflag outfile specfile testfile TESTFILE tname ucase unspec urand)
use super::*;
macro_rules! make_sync_test (

View file

@ -1,3 +1,5 @@
// spell-checker:ignore (Fileio fname fpath fullblock gibi ifile iflag infile lcase noatime nocreat notrunc noxfer ofile oflag outfile specfile testfile TESTFILE tname ucase unspec urand)
use super::*;
macro_rules! make_conv_test (

View file

@ -1,3 +1,5 @@
// spell-checker:ignore (Fileio fname fpath fullblock gibi ifile iflag infile lcase noatime nocreat notrunc noxfer ofile oflag outfile specfile testfile TESTFILE tname ucase unspec urand)
use super::*;
mod block_unblock_tests;

View file

@ -1,3 +1,5 @@
// spell-checker:ignore (Fileio fname fpath fullblock gibi ifile iflag infile lcase noatime nocreat notrunc noxfer ofile oflag outfile specfile testfile TESTFILE tname ucase unspec urand)
use super::*;
const DST_PLACEHOLDER: Vec<u8> = Vec::new();

View file

@ -2,7 +2,7 @@ use super::*;
use crate::StatusLevel;
#[cfg(not(unix))]
#[cfg(not(target_os = "linux"))]
#[test]
fn unimplemented_flags_should_error_non_unix() {
let mut unfailed = Vec::new();

View file

@ -1,3 +1,5 @@
// spell-checker:ignore (Fileio fname fpath fullblock gibi ifile iflag infile lcase noatime nocreat notrunc noxfer ofile oflag outfile specfile testfile TESTFILE tname ucase unspec urand)
use crate::common::util::*;
use std::fs::{File, OpenOptions};