Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package lsd for openSUSE:Factory checked in 
at 2022-09-13 15:09:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lsd (Old)
 and      /work/SRC/openSUSE:Factory/.lsd.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lsd"

Tue Sep 13 15:09:52 2022 rev:3 rq:1003104 version:0.23.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/lsd/lsd.changes  2022-09-05 21:22:20.189186082 
+0200
+++ /work/SRC/openSUSE:Factory/.lsd.new.2083/lsd.changes        2022-09-13 
15:11:20.352972020 +0200
@@ -1,0 +2,7 @@
+Tue Sep 13 05:54:16 UTC 2022 - Dead Mozay <[email protected]>
+
+- Update to version 0.23.1:
+  * Fix tab completion for paths in ZSH.
+  * Fix POSIX-compatible exit status. 
+
+-------------------------------------------------------------------

Old:
----
  lsd-0.23.0.obscpio

New:
----
  lsd-0.23.1.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lsd.spec ++++++
--- /var/tmp/diff_new_pack.BFLVae/_old  2022-09-13 15:11:22.260977391 +0200
+++ /var/tmp/diff_new_pack.BFLVae/_new  2022-09-13 15:11:22.264977403 +0200
@@ -18,7 +18,7 @@
 
 %global rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
 Name:           lsd
-Version:        0.23.0
+Version:        0.23.1
 Release:        0
 Summary:        Ls command with a lot of pretty colors and some other stuff
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.BFLVae/_old  2022-09-13 15:11:22.288977470 +0200
+++ /var/tmp/diff_new_pack.BFLVae/_new  2022-09-13 15:11:22.292977481 +0200
@@ -6,7 +6,7 @@
     <param name="scm">git</param>
     <param name="version">git-master</param>
     <param name="versionformat">@PARENT_TAG@</param>
-    <param name="revision">0.23.0</param>
+    <param name="revision">0.23.1</param>
     <param name="changesgenerate">disable</param>
     <param name="changesauthor">[email protected]</param>
   </service>

++++++ lsd-0.23.0.obscpio -> lsd-0.23.1.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/.release.toml new/lsd-0.23.1/.release.toml
--- old/lsd-0.23.0/.release.toml        2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/.release.toml        2022-09-13 05:25:33.000000000 +0200
@@ -5,7 +5,8 @@
 tag-prefix = ""
 tag-name = "{{version}}"
 pre-release-replacements = [
-  {file="CHANGELOG.md", search="Unreleased", replace="{{version}}"},
-  {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}"},
+  {file="CHANGELOG.md", search="## \\[Unreleased\\]", replace="## 
[Unreleased]\n\n## {{version}} - {{date}}"},
+  {file="CHANGELOG.md", search="HEAD", replace="{{version}}"},
+  {file="CHANGELOG.md", search="\\[Unreleased\\]:", replace="[Unreleased]: 
https://github.com/Peltoche/lsd/compare/{{version}}...HEAD\n[{{version}}]: "},
   {file="README.md", search="lsd_[0-9\\.]+_amd64.deb", 
replace="lsd_{{version}}_amd64.deb"},
 ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/CHANGELOG.md new/lsd-0.23.1/CHANGELOG.md
--- old/lsd-0.23.0/CHANGELOG.md 2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/CHANGELOG.md 2022-09-13 05:25:33.000000000 +0200
@@ -4,6 +4,14 @@
 The format is based on [Keep a 
Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic 
Versioning](https://semver.org/spec/v2.0.0.html).
 
+## [Unreleased]
+
+## 0.23.1 - 2022-09-13
+
+### Fixed
+- Fix tab completion for paths in ZSH from 
[duhdugg](https://github.com/duhdugg)
+- Fix POSIX-compatible exit status from [duhdugg](https://github.com/duhdugg)
+
 ## [0.23.0] - 2022-09-05
 ### Added
 - Add icon for Zstandard from [nix6839](https://github.com/nix6839)
@@ -348,7 +356,10 @@
 - Change the component alignment by using term_grid
 
 
-[0.23.0]: https://github.com/Peltoche/lsd/compare/0.22.0...HEAD
+
+[Unreleased]: https://github.com/Peltoche/lsd/compare/0.23.1...HEAD
+[0.23.1]:  https://github.com/Peltoche/lsd/compare/0.23.0...0.23.1
+[0.23.0]: https://github.com/Peltoche/lsd/compare/0.22.0...0.23.0
 [0.22.0]: https://github.com/Peltoche/lsd/compare/0.21.0...0.22.0
 [0.21.0]: https://github.com/Peltoche/lsd/compare/0.20.1...0.21.0
 [0.20.1]: https://github.com/Peltoche/lsd/compare/0.20.0...0.20.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/Cargo.lock new/lsd-0.23.1/Cargo.lock
--- old/lsd-0.23.0/Cargo.lock   2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/Cargo.lock   2022-09-13 05:25:33.000000000 +0200
@@ -414,7 +414,7 @@
 
 [[package]]
 name = "lsd"
-version = "0.23.0"
+version = "0.23.1"
 dependencies = [
  "assert_cmd",
  "assert_fs",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/Cargo.toml new/lsd-0.23.1/Cargo.toml
--- old/lsd-0.23.0/Cargo.toml   2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/Cargo.toml   2022-09-13 05:25:33.000000000 +0200
@@ -8,7 +8,7 @@
 name = "lsd"
 readme = "./README.md"
 repository = "https://github.com/Peltoche/lsd";
-version = "0.23.0"
+version = "0.23.1"
 edition = "2021"
 
 [[bin]]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/README.md new/lsd-0.23.1/README.md
--- old/lsd-0.23.0/README.md    2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/README.md    2022-09-13 05:25:33.000000000 +0200
@@ -35,9 +35,10 @@
 | NetBSD or any `pkgsrc` platform | `pkgin install lsd` or `cd 
/usr/pkgsrc/sysutils/lsd && make install`                                       
       |
 | Windows                         | `scoop install lsd`                        
                                                                       |
 | Android (via Termux)            | `pkg install lsd`                          
                                                                       |
-| Ubuntu/Debian based distro      | `sudo dpkg -i lsd_0.23.0_amd64.deb` get 
`.deb` file from [release page](https://github.com/Peltoche/lsd/releases) |
+| Ubuntu/Debian based distro      | `sudo dpkg -i lsd_0.23.1_amd64.deb` get 
`.deb` file from [release page](https://github.com/Peltoche/lsd/releases) |
 | Solus                           | `eopkg it lsd`                             
                                                                       |
 | Void Linux                      | `sudo xbps-install lsd`                    
                                                                       |
+| openSUSE                        | `sudo zypper install lsd`                  
                                                                       |
 
 ### From source
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/rustfmt.toml new/lsd-0.23.1/rustfmt.toml
--- old/lsd-0.23.0/rustfmt.toml 1970-01-01 01:00:00.000000000 +0100
+++ new/lsd-0.23.1/rustfmt.toml 2022-09-13 05:25:33.000000000 +0200
@@ -0,0 +1,3 @@
+# use empty config file to ensure that `rustfmt` will always use 
+# the default configuration when formatting code
+# even if there is a `rustfmt.toml` file in parent directories
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/src/app.rs new/lsd-0.23.1/src/app.rs
--- old/lsd-0.23.0/src/app.rs   2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/src/app.rs   2022-09-13 05:25:33.000000000 +0200
@@ -1,10 +1,15 @@
-use clap::{App, Arg};
+use clap::{App, Arg, ValueHint};
 
 pub fn build() -> App<'static> {
     App::new("lsd")
         .version(env!("CARGO_PKG_VERSION"))
         .about(env!("CARGO_PKG_DESCRIPTION"))
-        .arg(Arg::with_name("FILE").multiple(true).default_value("."))
+        .arg(
+            Arg::with_name("FILE")
+                .multiple(true)
+                .default_value(".")
+                .value_hint(ValueHint::AnyPath),
+        )
         .arg(
             Arg::with_name("all")
                 .short('a')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/src/core.rs new/lsd-0.23.1/src/core.rs
--- old/lsd-0.23.0/src/core.rs  2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/src/core.rs  2022-09-13 05:25:33.000000000 +0200
@@ -6,7 +6,7 @@
 };
 use crate::icon::{self, Icons};
 use crate::meta::Meta;
-use crate::{print_error, print_output, sort};
+use crate::{print_error, print_output, sort, ExitCode};
 use std::path::PathBuf;
 
 #[cfg(not(target_os = "windows"))]
@@ -83,14 +83,16 @@
         }
     }
 
-    pub fn run(self, paths: Vec<PathBuf>) {
-        let mut meta_list = self.fetch(paths);
+    pub fn run(self, paths: Vec<PathBuf>) -> ExitCode {
+        let (mut meta_list, exit_code) = self.fetch(paths);
 
         self.sort(&mut meta_list);
-        self.display(&meta_list)
+        self.display(&meta_list);
+        exit_code
     }
 
-    fn fetch(&self, paths: Vec<PathBuf>) -> Vec<Meta> {
+    fn fetch(&self, paths: Vec<PathBuf>) -> (Vec<Meta>, ExitCode) {
+        let mut exit_code = ExitCode::OK;
         let mut meta_list = Vec::with_capacity(paths.len());
         let depth = match self.flags.layout {
             Layout::Tree { .. } => self.flags.recursion.depth,
@@ -103,6 +105,7 @@
                 Ok(meta) => meta,
                 Err(err) => {
                     print_error!("{}: {}.", path.display(), err);
+                    exit_code.set_if_greater(ExitCode::MajorIssue);
                     continue;
                 }
             };
@@ -111,12 +114,14 @@
                 self.flags.layout == Layout::Tree || self.flags.display != 
Display::DirectoryOnly;
             if recurse {
                 match meta.recurse_into(depth, &self.flags) {
-                    Ok(content) => {
+                    Ok((content, path_exit_code)) => {
                         meta.content = content;
                         meta_list.push(meta);
+                        exit_code.set_if_greater(path_exit_code);
                     }
                     Err(err) => {
                         print_error!("lsd: {}: {}\n", path.display(), err);
+                        exit_code.set_if_greater(ExitCode::MinorIssue);
                         continue;
                     }
                 };
@@ -131,7 +136,7 @@
             }
         }
 
-        meta_list
+        (meta_list, exit_code)
     }
 
     fn sort(&self, metas: &mut Vec<Meta>) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/src/display.rs 
new/lsd-0.23.1/src/display.rs
--- old/lsd-0.23.0/src/display.rs       2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/src/display.rs       2022-09-13 05:25:33.000000000 +0200
@@ -602,6 +602,7 @@
             .unwrap()
             .recurse_into(42, &flags)
             .unwrap()
+            .0
             .unwrap();
         sort(&mut metas, &sort::assemble_sorters(&flags));
         let output = tree(
@@ -633,6 +634,7 @@
             .unwrap()
             .recurse_into(42, &flags)
             .unwrap()
+            .0
             .unwrap();
         let output = tree(
             &metas,
@@ -672,6 +674,7 @@
             .unwrap()
             .recurse_into(42, &flags)
             .unwrap()
+            .0
             .unwrap();
         let output = tree(
             &metas,
@@ -710,6 +713,7 @@
             .unwrap()
             .recurse_into(42, &flags)
             .unwrap()
+            .0
             .unwrap();
         let output = tree(
             &metas,
@@ -739,6 +743,7 @@
             .unwrap()
             .recurse_into(1, &flags)
             .unwrap()
+            .0
             .unwrap();
         let output = grid(
             &metas,
@@ -771,6 +776,7 @@
             .unwrap()
             .recurse_into(1, &flags)
             .unwrap()
+            .0
             .unwrap();
         let output = grid(
             &metas,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/src/main.rs new/lsd-0.23.1/src/main.rs
--- old/lsd-0.23.0/src/main.rs  2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/src/main.rs  2022-09-13 05:25:33.000000000 +0200
@@ -42,6 +42,21 @@
 use crate::flags::Flags;
 use std::path::PathBuf;
 
+#[derive(PartialEq, Eq, PartialOrd, Copy, Clone)]
+pub enum ExitCode {
+    OK,
+    MinorIssue,
+    MajorIssue,
+}
+impl ExitCode {
+    pub fn set_if_greater(&mut self, code: ExitCode) {
+        let self_i32 = *self as i32;
+        let code_i32 = code as i32;
+        if self_i32 < code_i32 {
+            *self = code;
+        }
+    }
+}
 /// Macro used to avoid panicking when the lsd method is used with a pipe and
 /// stderr close before our program.
 #[macro_export]
@@ -115,5 +130,6 @@
     let flags = Flags::configure_from(&matches, &config).unwrap_or_else(|err| 
err.exit());
     let core = Core::new(flags);
 
-    core.run(inputs);
+    let exit_code = core.run(inputs);
+    std::process::exit(exit_code as i32);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/src/meta/mod.rs 
new/lsd-0.23.1/src/meta/mod.rs
--- old/lsd-0.23.0/src/meta/mod.rs      2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/src/meta/mod.rs      2022-09-13 05:25:33.000000000 +0200
@@ -27,7 +27,7 @@
 pub use crate::icon::Icons;
 
 use crate::flags::{Display, Flags, Layout};
-use crate::print_error;
+use crate::{print_error, ExitCode};
 
 use std::io::{self, Error, ErrorKind};
 use std::path::{Component, Path, PathBuf};
@@ -50,30 +50,34 @@
 }
 
 impl Meta {
-    pub fn recurse_into(&self, depth: usize, flags: &Flags) -> 
io::Result<Option<Vec<Meta>>> {
+    pub fn recurse_into(
+        &self,
+        depth: usize,
+        flags: &Flags,
+    ) -> io::Result<(Option<Vec<Meta>>, ExitCode)> {
         if depth == 0 {
-            return Ok(None);
+            return Ok((None, ExitCode::OK));
         }
 
         if flags.display == Display::DirectoryOnly && flags.layout != 
Layout::Tree {
-            return Ok(None);
+            return Ok((None, ExitCode::OK));
         }
 
         match self.file_type {
             FileType::Directory { .. } => (),
             FileType::SymLink { is_dir: true } => {
                 if flags.layout == Layout::OneLine {
-                    return Ok(None);
+                    return Ok((None, ExitCode::OK));
                 }
             }
-            _ => return Ok(None),
+            _ => return Ok((None, ExitCode::OK)),
         }
 
         let entries = match self.path.read_dir() {
             Ok(entries) => entries,
             Err(err) => {
                 print_error!("{}: {}.", self.path.display(), err);
-                return Ok(None);
+                return Ok((None, ExitCode::MinorIssue));
             }
         };
 
@@ -91,6 +95,8 @@
             content.push(parent_meta);
         }
 
+        let mut exit_code = ExitCode::OK;
+
         for entry in entries {
             let entry = entry?;
             let path = entry.path();
@@ -111,6 +117,7 @@
                 Ok(res) => res,
                 Err(err) => {
                     print_error!("{}: {}.", path.display(), err);
+                    exit_code.set_if_greater(ExitCode::MinorIssue);
                     continue;
                 }
             };
@@ -126,9 +133,13 @@
             // check dereferencing
             if flags.dereference.0 || !matches!(entry_meta.file_type, 
FileType::SymLink { .. }) {
                 match entry_meta.recurse_into(depth - 1, flags) {
-                    Ok(content) => entry_meta.content = content,
+                    Ok((content, rec_exit_code)) => {
+                        entry_meta.content = content;
+                        exit_code.set_if_greater(rec_exit_code);
+                    }
                     Err(err) => {
                         print_error!("{}: {}.", path.display(), err);
+                        exit_code.set_if_greater(ExitCode::MinorIssue);
                         continue;
                     }
                 };
@@ -137,7 +148,7 @@
             content.push(entry_meta);
         }
 
-        Ok(Some(content))
+        Ok((Some(content), exit_code))
     }
 
     pub fn calculate_total_size(&mut self) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lsd-0.23.0/tests/integration.rs 
new/lsd-0.23.1/tests/integration.rs
--- old/lsd-0.23.0/tests/integration.rs 2022-09-05 11:23:06.000000000 +0200
+++ new/lsd-0.23.1/tests/integration.rs 2022-09-13 05:25:33.000000000 +0200
@@ -8,6 +8,8 @@
 
 #[cfg(unix)]
 use std::os::unix::fs;
+#[cfg(unix)]
+use std::os::unix::fs::PermissionsExt;
 
 #[test]
 fn test_runs_okay() {
@@ -642,6 +644,45 @@
 }
 
 #[test]
+fn test_cannot_access_file_exit_status() {
+    let dir = tempdir();
+    let does_not_exist = dir.path().join("does_not_exist");
+
+    let status = cmd()
+        .arg("-l")
+        .arg("--ignore-config")
+        .arg(does_not_exist)
+        .status()
+        .unwrap()
+        .code()
+        .unwrap();
+
+    assert_eq!(status, 2)
+}
+
+#[cfg(unix)]
+#[test]
+fn test_cannot_access_subdir_exit_status() {
+    let tmp = tempdir();
+
+    let readonly = std::fs::Permissions::from_mode(0o400);
+    tmp.child("d/subdir/onemore").create_dir_all().unwrap();
+
+    std::fs::set_permissions(tmp.child("d").path().join("subdir"), 
readonly).unwrap();
+
+    let status = cmd()
+        .arg("--tree")
+        .arg("--ignore-config")
+        .arg(tmp.child("d").path())
+        .status()
+        .unwrap()
+        .code()
+        .unwrap();
+
+    assert_eq!(status, 1)
+}
+
+#[test]
 fn test_date_custom_format_supports_nanos_with_length() {
     let dir = tempdir();
     dir.child("one").touch().unwrap();

++++++ lsd.obsinfo ++++++
--- /var/tmp/diff_new_pack.BFLVae/_old  2022-09-13 15:11:22.448977920 +0200
+++ /var/tmp/diff_new_pack.BFLVae/_new  2022-09-13 15:11:22.452977932 +0200
@@ -1,5 +1,5 @@
 name: lsd
-version: 0.23.0
-mtime: 1662369786
-commit: 80a2bb26c8e6421ccb37302ed8833e38bf8b1f08
+version: 0.23.1
+mtime: 1663039533
+commit: 84fedc6f44d1928239b8e489b1e2acc83e26cd71
 

++++++ vendor.tar.xz ++++++
/work/SRC/openSUSE:Factory/lsd/vendor.tar.xz 
/work/SRC/openSUSE:Factory/.lsd.new.2083/vendor.tar.xz differ: char 26, line 1

Reply via email to