pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/sysutils/yazi
Module Name: pkgsrc
Committed By: wiz
Date: Sat Jan 17 07:37:53 UTC 2026
Modified Files:
pkgsrc/sysutils/yazi: Makefile distinfo
pkgsrc/sysutils/yazi/patches:
patch-yazi-fs_src_provider_local_casefold.rs
Log Message:
yazi: use upstream version of build fix
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 pkgsrc/sysutils/yazi/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/sysutils/yazi/distinfo
cvs rdiff -u -r1.1 -r1.2 \
pkgsrc/sysutils/yazi/patches/patch-yazi-fs_src_provider_local_casefold.rs
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/sysutils/yazi/Makefile
diff -u pkgsrc/sysutils/yazi/Makefile:1.33 pkgsrc/sysutils/yazi/Makefile:1.34
--- pkgsrc/sysutils/yazi/Makefile:1.33 Wed Jan 14 15:20:41 2026
+++ pkgsrc/sysutils/yazi/Makefile Sat Jan 17 07:37:52 2026
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.33 2026/01/14 15:20:41 wiz Exp $
+# $NetBSD: Makefile,v 1.34 2026/01/17 07:37:52 wiz Exp $
DISTNAME= yazi-26.1.4
+PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_GITHUB:=sxyazi/}
GITHUB_TAG= v${PKGVERSION_NOREV}
Index: pkgsrc/sysutils/yazi/distinfo
diff -u pkgsrc/sysutils/yazi/distinfo:1.28 pkgsrc/sysutils/yazi/distinfo:1.29
--- pkgsrc/sysutils/yazi/distinfo:1.28 Wed Jan 14 15:20:41 2026
+++ pkgsrc/sysutils/yazi/distinfo Sat Jan 17 07:37:52 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.28 2026/01/14 15:20:41 wiz Exp $
+$NetBSD: distinfo,v 1.29 2026/01/17 07:37:52 wiz Exp $
BLAKE2s (addr2line-0.25.1.crate) = cc5c422ec48ccef5c2c46379d2f600644609490afafea5020f2020815d1146e6
SHA512 (addr2line-0.25.1.crate) = c400f3b6ccaff8a1c0d7d82c708a1784b8fd5ba64b6e420e85819d59b1cadb55fa59c852925093b921469f272d1d5140cf12f013ae75d1e1bc85021097df8fc2
@@ -1662,4 +1662,4 @@ Size (zune-inflate-0.2.54.crate) = 37973
BLAKE2s (zune-jpeg-0.5.8.crate) = f69e39a60414e91f95a1bc5d295cbbd79c0f4e31142d6864a6f330996e78fa88
SHA512 (zune-jpeg-0.5.8.crate) = b6d213f149f582d92137e615287ea389239c04859a06bb128c19b4f77f6a23ed0d40de4593d9073c31a4d5a573a4fd3c727ca2f0cefcacf995e23d74ad17d227
Size (zune-jpeg-0.5.8.crate) = 84366 bytes
-SHA1 (patch-yazi-fs_src_provider_local_casefold.rs) = 8752bc7a210ba4f4888be29abcc8e45335f2a649
+SHA1 (patch-yazi-fs_src_provider_local_casefold.rs) = b5316974e560e0180d0e40f1b3fbe93c68f778ea
Index: pkgsrc/sysutils/yazi/patches/patch-yazi-fs_src_provider_local_casefold.rs
diff -u pkgsrc/sysutils/yazi/patches/patch-yazi-fs_src_provider_local_casefold.rs:1.1 pkgsrc/sysutils/yazi/patches/patch-yazi-fs_src_provider_local_casefold.rs:1.2
--- pkgsrc/sysutils/yazi/patches/patch-yazi-fs_src_provider_local_casefold.rs:1.1 Wed Jan 14 15:20:41 2026
+++ pkgsrc/sysutils/yazi/patches/patch-yazi-fs_src_provider_local_casefold.rs Sat Jan 17 07:37:52 2026
@@ -1,21 +1,152 @@
-$NetBSD: patch-yazi-fs_src_provider_local_casefold.rs,v 1.1 2026/01/14 15:20:41 wiz Exp $
+$NetBSD: patch-yazi-fs_src_provider_local_casefold.rs,v 1.2 2026/01/17 07:37:52 wiz Exp $
-libc on NetBSD does not provide O_SYMLINK.
-Workaround for
-https://github.com/sxyazi/yazi/issues/3497
+fix build on NetBSD
+https://github.com/sxyazi/yazi/pull/3506
---- yazi-fs/src/provider/local/casefold.rs.orig 2026-01-14 15:13:02.540343017 +0000
+--- yazi-fs/src/provider/local/casefold.rs.orig 2026-01-04 04:35:06.000000000 +0000
+++ yazi-fs/src/provider/local/casefold.rs
-@@ -122,10 +122,10 @@ fn final_path(path: &Path) -> io::Result<PathBuf> {
- fn final_path(path: &Path) -> io::Result<PathBuf> {
- use std::{ffi::{CStr, CString, OsString}, os::{fd::{AsRawFd, FromRawFd, OwnedFd}, unix::ffi::{OsStrExt, OsStringExt}}};
+@@ -10,13 +10,7 @@ pub(super) async fn casefold(path: impl AsRef<Path>) -
+ tokio::task::spawn_blocking(move || casefold_impl(path)).await?
+ }
+
+-#[cfg(any(
+- target_os = "macos",
+- target_os = "netbsd",
+- target_os = "openbsd",
+- target_os = "freebsd",
+- target_os = "windows"
+-))]
++#[cfg(any(target_os = "macos", target_os = "windows", target_os = "freebsd"))]
+ fn casefold_impl(path: PathBuf) -> io::Result<PathBuf> {
+ let mut it = path.components();
+ let mut parts = vec![];
+@@ -47,7 +41,6 @@ fn casefold_impl(path: PathBuf) -> io::Result<PathBuf>
+ }
-- use libc::{F_GETPATH, O_RDONLY, O_SYMLINK, PATH_MAX};
-+ use libc::{F_GETPATH, O_RDONLY, PATH_MAX};
+ #[cfg(any(target_os = "linux", target_os = "android"))]
+-#[allow(irrefutable_let_patterns)]
+ fn casefold_impl(path: PathBuf) -> io::Result<PathBuf> {
+ use std::{ffi::{CString, OsStr, OsString}, fs::File, os::{fd::{AsRawFd, FromRawFd}, unix::{ffi::{OsStrExt, OsStringExt}, fs::MetadataExt}}};
- let cstr = CString::new(path.as_os_str().as_bytes())?;
-- let fd = match unsafe { libc::open(cstr.as_ptr(), O_RDONLY | O_SYMLINK) } {
-+ let fd = match unsafe { libc::open(cstr.as_ptr(), O_RDONLY) } {
- ret if ret < 0 => return Err(io::Error::last_os_error()),
- ret => unsafe { OwnedFd::from_raw_fd(ret) },
+@@ -65,14 +58,8 @@ fn casefold_impl(path: PathBuf) -> io::Result<PathBuf>
};
+
+ // Fast path: if the `/proc/self/fd/N` matches
+- if let Ok(p) = std::fs::read_link(format!("/proc/self/fd/{}", file.as_raw_fd()))
+- && let path = path.as_os_str()
+- && let Some(b) = p.as_os_str().as_bytes().get(..path.len())
+- && b.eq_ignore_ascii_case(path.as_bytes())
+- {
+- let mut b = p.into_os_string().into_vec();
+- b.truncate(path.len());
+- return Ok(PathBuf::from(OsString::from_vec(b)));
++ if let Some(p) = try_from_fd(file.as_raw_fd(), path) {
++ return Ok(p);
+ }
+
+ // Fast path: if the file isn't a symlink
+@@ -113,12 +100,64 @@ fn casefold_impl(path: PathBuf) -> io::Result<PathBuf>
+ }
+ }
+
+-#[cfg(any(
+- target_os = "macos",
+- target_os = "netbsd",
+- target_os = "openbsd",
+- target_os = "freebsd"
+-))]
++#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
++#[allow(irrefutable_let_patterns)]
++fn casefold_impl(path: PathBuf) -> io::Result<PathBuf> {
++ use std::{ffi::{CString, OsStr, OsString}, fs::File, os::{fd::{AsRawFd, FromRawFd}, unix::{ffi::{OsStrExt, OsStringExt}, fs::MetadataExt}}};
++
++ use libc::{O_NOFOLLOW, O_RDONLY};
++
++ let cstr = CString::new(path.into_os_string().into_vec())?;
++ let path = Path::new(OsStr::from_bytes(cstr.as_bytes()));
++ let Some((parent, name)) = path.parent().zip(path.file_name()) else {
++ return Ok(PathBuf::from(OsString::from_vec(cstr.into_bytes())));
++ };
++
++ // Fast path: if it's not a symlink
++ if let fd = unsafe { libc::open(cstr.as_ptr(), O_RDONLY | O_NOFOLLOW) }
++ && fd >= 0
++ && let file = unsafe { File::from_raw_fd(fd) }
++ {
++ if let Some(p) = try_from_fd(file.as_raw_fd(), path) {
++ return Ok(p);
++ } else if let Some(n) = path.canonicalize()?.file_name() {
++ return Ok(parent.join(n));
++ } else {
++ return Err(io::Error::other("Cannot get filename"));
++ }
++ };
++
++ // Fallback: scan the directory for matching inodes
++ let (meta, mut names) = (std::fs::symlink_metadata(path)?, vec![]);
++ for entry in std::fs::read_dir(parent)? {
++ let entry = entry?;
++ let n = entry.file_name(); // TODO: use `file_name_ref()` when stabilized
++
++ if n == name {
++ return Ok(PathBuf::from(OsString::from_vec(cstr.into_bytes())));
++ } else if let m = entry.metadata()?
++ && m.ino() == meta.ino()
++ && m.dev() == meta.dev()
++ {
++ names.push(n);
++ }
++ }
++
++ if names.len() == 1 {
++ // No hardlink that shares the same inode
++ Ok(parent.join(&names[0]))
++ } else if let mut it = names.iter().enumerate().filter(|&(_, n)| n.eq_ignore_ascii_case(name))
++ && let Some((i, _)) = it.next()
++ && it.next().is_none()
++ {
++ // Case-insensitive match
++ Ok(parent.join(&names[i]))
++ } else {
++ Err(io::Error::from(io::ErrorKind::NotFound))
++ }
++}
++
++#[cfg(any(target_os = "macos", target_os = "freebsd"))]
+ fn final_path(path: &Path) -> io::Result<PathBuf> {
+ use std::{ffi::{CStr, CString, OsString}, os::{fd::{AsRawFd, FromRawFd, OwnedFd}, unix::ffi::{OsStrExt, OsStringExt}}};
+
+@@ -177,4 +216,33 @@ fn final_path(path: &Path) -> io::Result<PathBuf> {
+ Either::Right(len) => inner(&file, &mut vec![0u16; len as usize])?
+ .left_or_err(|| io::Error::new(io::ErrorKind::InvalidData, "path too long")),
+ }
++}
++
++#[cfg(any(
++ target_os = "linux",
++ target_os = "android",
++ target_os = "netbsd",
++ target_os = "openbsd"
++))]
++fn try_from_fd(fd: std::os::fd::RawFd, needle: &Path) -> Option<PathBuf> {
++ use std::{ffi::OsString, os::unix::ffi::{OsStrExt, OsStringExt}};
++
++ #[cfg(any(target_os = "linux", target_os = "android"))]
++ let cand = format!("/proc/self/fd/{fd}");
++ #[cfg(target_os = "netbsd")]
++ let cand = format!("/proc/curproc/fd/{fd}");
++ #[cfg(target_os = "openbsd")]
++ let cand = format!("/dev/fd/{fd}");
++
++ if let Ok(p) = std::fs::read_link(cand)
++ && let needle = needle.as_os_str()
++ && let Some(b) = p.as_os_str().as_bytes().get(..needle.len())
++ && b.eq_ignore_ascii_case(needle.as_bytes())
++ {
++ let mut b = p.into_os_string().into_vec();
++ b.truncate(needle.len());
++ return Some(PathBuf::from(OsString::from_vec(b)));
++ }
++
++ None
+ }
Home |
Main Index |
Thread Index |
Old Index