From ea4f09d3c582e05bd30a1f4a47a4fcf0257f01d7 Mon Sep 17 00:00:00 2001 From: sylvestre Date: Thu, 25 May 2023 02:38:43 +0000 Subject: [PATCH] deploy: f0e8d44e6e64ee3354f95864c0a25b74cf1c1151 --- dev/src/uu_more/more.rs.html | 22 +++++- dev/src/uucore/features/perms.rs.html | 78 +++++++++++++++++++ dev/uu_more/fn.uu_app.html | 2 +- dev/uu_more/index.html | 2 +- dev/uucore/perms/fn.chown_base.html | 2 +- dev/uucore/perms/index.html | 2 +- .../perms/options/constant.ARG_FILES.html | 2 +- .../perms/options/constant.ARG_GROUP.html | 2 +- .../perms/options/constant.ARG_OWNER.html | 2 +- dev/uucore/perms/options/constant.FROM.html | 2 +- dev/uucore/perms/options/constant.HELP.html | 2 +- .../perms/options/constant.RECURSIVE.html | 2 +- .../perms/options/constant.REFERENCE.html | 2 +- .../dereference/constant.DEREFERENCE.html | 2 +- .../dereference/constant.NO_DEREFERENCE.html | 2 +- .../perms/options/dereference/index.html | 2 +- dev/uucore/perms/options/index.html | 2 +- .../preserve_root/constant.NO_PRESERVE.html | 2 +- .../preserve_root/constant.PRESERVE.html | 2 +- .../perms/options/preserve_root/index.html | 2 +- .../options/traverse/constant.EVERY.html | 2 +- .../traverse/constant.NO_TRAVERSE.html | 2 +- .../options/traverse/constant.TRAVERSE.html | 2 +- dev/uucore/perms/options/traverse/index.html | 2 +- .../options/verbosity/constant.CHANGES.html | 2 +- .../options/verbosity/constant.QUIET.html | 2 +- .../options/verbosity/constant.SILENT.html | 2 +- .../options/verbosity/constant.VERBOSE.html | 2 +- dev/uucore/perms/options/verbosity/index.html | 2 +- dev/uucore/perms/struct.ChownExecutor.html | 2 +- .../perms/struct.GidUidOwnerFilter.html | 2 +- 31 files changed, 128 insertions(+), 30 deletions(-) diff --git a/dev/src/uu_more/more.rs.html b/dev/src/uu_more/more.rs.html index 59cad6cf0..4cafaa41f 100644 --- a/dev/src/uu_more/more.rs.html +++ b/dev/src/uu_more/more.rs.html @@ -563,6 +563,16 @@ 563 564 565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575
//  * This file is part of the uutils coreutils package.
 //  *
 //  * (c) Martin Kysel <code@martinkysel.com>
@@ -669,7 +679,17 @@
             if length > 1 {
                 buff.push_str(&MULTI_FILE_TOP_PROMPT.replace("{}", file.to_str().unwrap()));
             }
-            let mut reader = BufReader::new(File::open(file).unwrap());
+            let opened_file = match File::open(file) {
+                Err(why) => {
+                    terminal::disable_raw_mode().unwrap();
+                    return Err(USimpleError::new(
+                        1,
+                        format!("cannot open {}: {}", file.quote(), why.kind()),
+                    ));
+                }
+                Ok(opened_file) => opened_file,
+            };
+            let mut reader = BufReader::new(opened_file);
             reader.read_to_string(&mut buff).unwrap();
             more(&buff, &mut stdout, next_file.copied(), &options)?;
             buff.clear();
diff --git a/dev/src/uucore/features/perms.rs.html b/dev/src/uucore/features/perms.rs.html
index 25b392a0a..9d43655cf 100644
--- a/dev/src/uucore/features/perms.rs.html
+++ b/dev/src/uucore/features/perms.rs.html
@@ -551,6 +551,45 @@
 551
 552
 553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
 
// This file is part of the uutils coreutils package.
 //
 // For the full copyright and license information, please view the LICENSE
@@ -824,6 +863,11 @@
                 }
             }
         } else {
+            self.print_verbose_ownership_retained_as(
+                path,
+                meta.uid(),
+                self.dest_gid.map(|_| meta.gid()),
+            );
             0
         };
 
@@ -885,6 +929,11 @@
             };
 
             if !self.matched(meta.uid(), meta.gid()) {
+                self.print_verbose_ownership_retained_as(
+                    path,
+                    meta.uid(),
+                    self.dest_gid.map(|_| meta.gid()),
+                );
                 continue;
             }
 
@@ -946,6 +995,35 @@
             IfFrom::UserGroup(u, g) => u == uid && g == gid,
         }
     }
+
+    fn print_verbose_ownership_retained_as(&self, path: &Path, uid: u32, gid: Option<u32>) {
+        if self.verbosity.level == VerbosityLevel::Verbose {
+            match (self.dest_uid, self.dest_gid, gid) {
+                (Some(_), Some(_), Some(gid)) => {
+                    println!(
+                        "ownership of {} retained as {}:{}",
+                        path.quote(),
+                        entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()),
+                        entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
+                    );
+                }
+                (None, Some(_), Some(gid)) => {
+                    println!(
+                        "ownership of {} retained as {}",
+                        path.quote(),
+                        entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
+                    );
+                }
+                (_, _, _) => {
+                    println!(
+                        "ownership of {} retained as {}",
+                        path.quote(),
+                        entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()),
+                    );
+                }
+            }
+        }
+    }
 }
 
 pub mod options {
diff --git a/dev/uu_more/fn.uu_app.html b/dev/uu_more/fn.uu_app.html
index 7b4fd6c84..63301137b 100644
--- a/dev/uu_more/fn.uu_app.html
+++ b/dev/uu_more/fn.uu_app.html
@@ -1 +1 @@
-uu_app in uu_more - Rust

Function uu_more::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file +uu_app in uu_more - Rust

Function uu_more::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/dev/uu_more/index.html b/dev/uu_more/index.html index dc0091e30..53287274c 100644 --- a/dev/uu_more/index.html +++ b/dev/uu_more/index.html @@ -1 +1 @@ -uu_more - Rust
\ No newline at end of file +uu_more - Rust
\ No newline at end of file diff --git a/dev/uucore/perms/fn.chown_base.html b/dev/uucore/perms/fn.chown_base.html index f7d54aa24..48949ff55 100644 --- a/dev/uucore/perms/fn.chown_base.html +++ b/dev/uucore/perms/fn.chown_base.html @@ -1,4 +1,4 @@ -chown_base in uucore::perms - Rust

Function uucore::perms::chown_base

source ·
pub fn chown_base(
+chown_base in uucore::perms - Rust

Function uucore::perms::chown_base

source ·
pub fn chown_base(
     command: Command,
     args: impl Args,
     add_arg_if_not_reference: &'static str,
diff --git a/dev/uucore/perms/index.html b/dev/uucore/perms/index.html
index 91081837e..f457b4453 100644
--- a/dev/uucore/perms/index.html
+++ b/dev/uucore/perms/index.html
@@ -1,4 +1,4 @@
-uucore::perms - Rust

Module uucore::perms

source ·
Expand description

Common functions to manage permissions

+uucore::perms - Rust

Module uucore::perms

source ·
Expand description

Common functions to manage permissions

Modules

Structs

Enums

Functions

  • Base implementation for chgrp and chown.
  • Perform the change of owner on a path with the various options and error messages management
\ No newline at end of file diff --git a/dev/uucore/perms/options/constant.ARG_FILES.html b/dev/uucore/perms/options/constant.ARG_FILES.html index 27f8e22db..63a552368 100644 --- a/dev/uucore/perms/options/constant.ARG_FILES.html +++ b/dev/uucore/perms/options/constant.ARG_FILES.html @@ -1 +1 @@ -ARG_FILES in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_FILES

source ·
pub const ARG_FILES: &str = "FILE";
\ No newline at end of file +ARG_FILES in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_FILES

source ·
pub const ARG_FILES: &str = "FILE";
\ No newline at end of file diff --git a/dev/uucore/perms/options/constant.ARG_GROUP.html b/dev/uucore/perms/options/constant.ARG_GROUP.html index 16da89e92..363268624 100644 --- a/dev/uucore/perms/options/constant.ARG_GROUP.html +++ b/dev/uucore/perms/options/constant.ARG_GROUP.html @@ -1 +1 @@ -ARG_GROUP in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_GROUP

source ·
pub const ARG_GROUP: &str = "GROUP";
\ No newline at end of file +ARG_GROUP in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_GROUP

source ·
pub const ARG_GROUP: &str = "GROUP";
\ No newline at end of file diff --git a/dev/uucore/perms/options/constant.ARG_OWNER.html b/dev/uucore/perms/options/constant.ARG_OWNER.html index 60f16e7eb..e77a5497d 100644 --- a/dev/uucore/perms/options/constant.ARG_OWNER.html +++ b/dev/uucore/perms/options/constant.ARG_OWNER.html @@ -1 +1 @@ -ARG_OWNER in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_OWNER

source ·
pub const ARG_OWNER: &str = "OWNER";
\ No newline at end of file +ARG_OWNER in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_OWNER

source ·
pub const ARG_OWNER: &str = "OWNER";
\ No newline at end of file diff --git a/dev/uucore/perms/options/constant.FROM.html b/dev/uucore/perms/options/constant.FROM.html index 05d0a885f..8206efd4b 100644 --- a/dev/uucore/perms/options/constant.FROM.html +++ b/dev/uucore/perms/options/constant.FROM.html @@ -1 +1 @@ -FROM in uucore::perms::options - Rust

Constant uucore::perms::options::FROM

source ·
pub const FROM: &str = "from";
\ No newline at end of file +FROM in uucore::perms::options - Rust

Constant uucore::perms::options::FROM

source ·
pub const FROM: &str = "from";
\ No newline at end of file diff --git a/dev/uucore/perms/options/constant.HELP.html b/dev/uucore/perms/options/constant.HELP.html index e19e4f798..c44c4ed2b 100644 --- a/dev/uucore/perms/options/constant.HELP.html +++ b/dev/uucore/perms/options/constant.HELP.html @@ -1 +1 @@ -HELP in uucore::perms::options - Rust

Constant uucore::perms::options::HELP

source ·
pub const HELP: &str = "help";
\ No newline at end of file +HELP in uucore::perms::options - Rust

Constant uucore::perms::options::HELP

source ·
pub const HELP: &str = "help";
\ No newline at end of file diff --git a/dev/uucore/perms/options/constant.RECURSIVE.html b/dev/uucore/perms/options/constant.RECURSIVE.html index 36c5b6336..fead53ec2 100644 --- a/dev/uucore/perms/options/constant.RECURSIVE.html +++ b/dev/uucore/perms/options/constant.RECURSIVE.html @@ -1 +1 @@ -RECURSIVE in uucore::perms::options - Rust

Constant uucore::perms::options::RECURSIVE

source ·
pub const RECURSIVE: &str = "recursive";
\ No newline at end of file +RECURSIVE in uucore::perms::options - Rust

Constant uucore::perms::options::RECURSIVE

source ·
pub const RECURSIVE: &str = "recursive";
\ No newline at end of file diff --git a/dev/uucore/perms/options/constant.REFERENCE.html b/dev/uucore/perms/options/constant.REFERENCE.html index 4d3fcce08..7381137b5 100644 --- a/dev/uucore/perms/options/constant.REFERENCE.html +++ b/dev/uucore/perms/options/constant.REFERENCE.html @@ -1 +1 @@ -REFERENCE in uucore::perms::options - Rust

Constant uucore::perms::options::REFERENCE

source ·
pub const REFERENCE: &str = "reference";
\ No newline at end of file +REFERENCE in uucore::perms::options - Rust

Constant uucore::perms::options::REFERENCE

source ·
pub const REFERENCE: &str = "reference";
\ No newline at end of file diff --git a/dev/uucore/perms/options/dereference/constant.DEREFERENCE.html b/dev/uucore/perms/options/dereference/constant.DEREFERENCE.html index b9a09303d..ada89c761 100644 --- a/dev/uucore/perms/options/dereference/constant.DEREFERENCE.html +++ b/dev/uucore/perms/options/dereference/constant.DEREFERENCE.html @@ -1 +1 @@ -DEREFERENCE in uucore::perms::options::dereference - Rust
pub const DEREFERENCE: &str = "dereference";
\ No newline at end of file +DEREFERENCE in uucore::perms::options::dereference - Rust
pub const DEREFERENCE: &str = "dereference";
\ No newline at end of file diff --git a/dev/uucore/perms/options/dereference/constant.NO_DEREFERENCE.html b/dev/uucore/perms/options/dereference/constant.NO_DEREFERENCE.html index d4922d856..69430fe01 100644 --- a/dev/uucore/perms/options/dereference/constant.NO_DEREFERENCE.html +++ b/dev/uucore/perms/options/dereference/constant.NO_DEREFERENCE.html @@ -1 +1 @@ -NO_DEREFERENCE in uucore::perms::options::dereference - Rust
pub const NO_DEREFERENCE: &str = "no-dereference";
\ No newline at end of file +NO_DEREFERENCE in uucore::perms::options::dereference - Rust
pub const NO_DEREFERENCE: &str = "no-dereference";
\ No newline at end of file diff --git a/dev/uucore/perms/options/dereference/index.html b/dev/uucore/perms/options/dereference/index.html index a73075041..327e1d4f7 100644 --- a/dev/uucore/perms/options/dereference/index.html +++ b/dev/uucore/perms/options/dereference/index.html @@ -1 +1 @@ -uucore::perms::options::dereference - Rust
\ No newline at end of file +uucore::perms::options::dereference - Rust
\ No newline at end of file diff --git a/dev/uucore/perms/options/index.html b/dev/uucore/perms/options/index.html index 9752a89b8..6faa8f4b3 100644 --- a/dev/uucore/perms/options/index.html +++ b/dev/uucore/perms/options/index.html @@ -1 +1 @@ -uucore::perms::options - Rust
\ No newline at end of file +uucore::perms::options - Rust
\ No newline at end of file diff --git a/dev/uucore/perms/options/preserve_root/constant.NO_PRESERVE.html b/dev/uucore/perms/options/preserve_root/constant.NO_PRESERVE.html index 878684ae2..47a61a2d7 100644 --- a/dev/uucore/perms/options/preserve_root/constant.NO_PRESERVE.html +++ b/dev/uucore/perms/options/preserve_root/constant.NO_PRESERVE.html @@ -1 +1 @@ -NO_PRESERVE in uucore::perms::options::preserve_root - Rust
pub const NO_PRESERVE: &str = "no-preserve-root";
\ No newline at end of file +NO_PRESERVE in uucore::perms::options::preserve_root - Rust
pub const NO_PRESERVE: &str = "no-preserve-root";
\ No newline at end of file diff --git a/dev/uucore/perms/options/preserve_root/constant.PRESERVE.html b/dev/uucore/perms/options/preserve_root/constant.PRESERVE.html index c0cb6ca82..649074763 100644 --- a/dev/uucore/perms/options/preserve_root/constant.PRESERVE.html +++ b/dev/uucore/perms/options/preserve_root/constant.PRESERVE.html @@ -1 +1 @@ -PRESERVE in uucore::perms::options::preserve_root - Rust
pub const PRESERVE: &str = "preserve-root";
\ No newline at end of file +PRESERVE in uucore::perms::options::preserve_root - Rust
pub const PRESERVE: &str = "preserve-root";
\ No newline at end of file diff --git a/dev/uucore/perms/options/preserve_root/index.html b/dev/uucore/perms/options/preserve_root/index.html index 057ff0670..8c80c814f 100644 --- a/dev/uucore/perms/options/preserve_root/index.html +++ b/dev/uucore/perms/options/preserve_root/index.html @@ -1 +1 @@ -uucore::perms::options::preserve_root - Rust
\ No newline at end of file +uucore::perms::options::preserve_root - Rust
\ No newline at end of file diff --git a/dev/uucore/perms/options/traverse/constant.EVERY.html b/dev/uucore/perms/options/traverse/constant.EVERY.html index cc95770f2..38d95b10f 100644 --- a/dev/uucore/perms/options/traverse/constant.EVERY.html +++ b/dev/uucore/perms/options/traverse/constant.EVERY.html @@ -1 +1 @@ -EVERY in uucore::perms::options::traverse - Rust

Constant uucore::perms::options::traverse::EVERY

source ·
pub const EVERY: &str = "L";
\ No newline at end of file +EVERY in uucore::perms::options::traverse - Rust

Constant uucore::perms::options::traverse::EVERY

source ·
pub const EVERY: &str = "L";
\ No newline at end of file diff --git a/dev/uucore/perms/options/traverse/constant.NO_TRAVERSE.html b/dev/uucore/perms/options/traverse/constant.NO_TRAVERSE.html index f3b63215d..40bc0dce8 100644 --- a/dev/uucore/perms/options/traverse/constant.NO_TRAVERSE.html +++ b/dev/uucore/perms/options/traverse/constant.NO_TRAVERSE.html @@ -1 +1 @@ -NO_TRAVERSE in uucore::perms::options::traverse - Rust
pub const NO_TRAVERSE: &str = "P";
\ No newline at end of file +NO_TRAVERSE in uucore::perms::options::traverse - Rust
pub const NO_TRAVERSE: &str = "P";
\ No newline at end of file diff --git a/dev/uucore/perms/options/traverse/constant.TRAVERSE.html b/dev/uucore/perms/options/traverse/constant.TRAVERSE.html index 4ddffa124..33d8b05ea 100644 --- a/dev/uucore/perms/options/traverse/constant.TRAVERSE.html +++ b/dev/uucore/perms/options/traverse/constant.TRAVERSE.html @@ -1 +1 @@ -TRAVERSE in uucore::perms::options::traverse - Rust
pub const TRAVERSE: &str = "H";
\ No newline at end of file +TRAVERSE in uucore::perms::options::traverse - Rust
pub const TRAVERSE: &str = "H";
\ No newline at end of file diff --git a/dev/uucore/perms/options/traverse/index.html b/dev/uucore/perms/options/traverse/index.html index 2dd81d6a1..dc713abd4 100644 --- a/dev/uucore/perms/options/traverse/index.html +++ b/dev/uucore/perms/options/traverse/index.html @@ -1 +1 @@ -uucore::perms::options::traverse - Rust
\ No newline at end of file +uucore::perms::options::traverse - Rust
\ No newline at end of file diff --git a/dev/uucore/perms/options/verbosity/constant.CHANGES.html b/dev/uucore/perms/options/verbosity/constant.CHANGES.html index 79b66d9a6..df4bd7b14 100644 --- a/dev/uucore/perms/options/verbosity/constant.CHANGES.html +++ b/dev/uucore/perms/options/verbosity/constant.CHANGES.html @@ -1 +1 @@ -CHANGES in uucore::perms::options::verbosity - Rust
pub const CHANGES: &str = "changes";
\ No newline at end of file +CHANGES in uucore::perms::options::verbosity - Rust
pub const CHANGES: &str = "changes";
\ No newline at end of file diff --git a/dev/uucore/perms/options/verbosity/constant.QUIET.html b/dev/uucore/perms/options/verbosity/constant.QUIET.html index 331fac5cf..e8164487e 100644 --- a/dev/uucore/perms/options/verbosity/constant.QUIET.html +++ b/dev/uucore/perms/options/verbosity/constant.QUIET.html @@ -1 +1 @@ -QUIET in uucore::perms::options::verbosity - Rust

Constant uucore::perms::options::verbosity::QUIET

source ·
pub const QUIET: &str = "quiet";
\ No newline at end of file +QUIET in uucore::perms::options::verbosity - Rust

Constant uucore::perms::options::verbosity::QUIET

source ·
pub const QUIET: &str = "quiet";
\ No newline at end of file diff --git a/dev/uucore/perms/options/verbosity/constant.SILENT.html b/dev/uucore/perms/options/verbosity/constant.SILENT.html index eaa758725..b98af3b9f 100644 --- a/dev/uucore/perms/options/verbosity/constant.SILENT.html +++ b/dev/uucore/perms/options/verbosity/constant.SILENT.html @@ -1 +1 @@ -SILENT in uucore::perms::options::verbosity - Rust

Constant uucore::perms::options::verbosity::SILENT

source ·
pub const SILENT: &str = "silent";
\ No newline at end of file +SILENT in uucore::perms::options::verbosity - Rust

Constant uucore::perms::options::verbosity::SILENT

source ·
pub const SILENT: &str = "silent";
\ No newline at end of file diff --git a/dev/uucore/perms/options/verbosity/constant.VERBOSE.html b/dev/uucore/perms/options/verbosity/constant.VERBOSE.html index a3ffca3b7..4275427c8 100644 --- a/dev/uucore/perms/options/verbosity/constant.VERBOSE.html +++ b/dev/uucore/perms/options/verbosity/constant.VERBOSE.html @@ -1 +1 @@ -VERBOSE in uucore::perms::options::verbosity - Rust
pub const VERBOSE: &str = "verbose";
\ No newline at end of file +VERBOSE in uucore::perms::options::verbosity - Rust
pub const VERBOSE: &str = "verbose";
\ No newline at end of file diff --git a/dev/uucore/perms/options/verbosity/index.html b/dev/uucore/perms/options/verbosity/index.html index e7ecc56c7..4a222a3e7 100644 --- a/dev/uucore/perms/options/verbosity/index.html +++ b/dev/uucore/perms/options/verbosity/index.html @@ -1 +1 @@ -uucore::perms::options::verbosity - Rust
\ No newline at end of file +uucore::perms::options::verbosity - Rust
\ No newline at end of file diff --git a/dev/uucore/perms/struct.ChownExecutor.html b/dev/uucore/perms/struct.ChownExecutor.html index 48628992b..3bbbad4c5 100644 --- a/dev/uucore/perms/struct.ChownExecutor.html +++ b/dev/uucore/perms/struct.ChownExecutor.html @@ -9,7 +9,7 @@ pub recursive: bool, pub preserve_root: bool, pub dereference: bool, -}

Fields§

§dest_uid: Option<u32>§dest_gid: Option<u32>§raw_owner: String§traverse_symlinks: TraverseSymlinks§verbosity: Verbosity§filter: IfFrom§files: Vec<String>§recursive: bool§preserve_root: bool§dereference: bool

Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +}

Fields§

§dest_uid: Option<u32>§dest_gid: Option<u32>§raw_owner: String§traverse_symlinks: TraverseSymlinks§verbosity: Verbosity§filter: IfFrom§files: Vec<String>§recursive: bool§preserve_root: bool§dereference: bool

Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/dev/uucore/perms/struct.GidUidOwnerFilter.html b/dev/uucore/perms/struct.GidUidOwnerFilter.html index 3dd2ba3c1..305002509 100644 --- a/dev/uucore/perms/struct.GidUidOwnerFilter.html +++ b/dev/uucore/perms/struct.GidUidOwnerFilter.html @@ -1,4 +1,4 @@ -GidUidOwnerFilter in uucore::perms - Rust