From 86ab143271ecb866a8cce1db2234e5d0d587dbd3 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Thu, 27 Jun 2024 13:52:07 +0200 Subject: [PATCH] fix(package): ignore all files that start with a dot --- server/src/repo/package.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/src/repo/package.rs b/server/src/repo/package.rs index 70466ba..996f933 100644 --- a/server/src/repo/package.rs +++ b/server/src/repo/package.rs @@ -13,8 +13,6 @@ use libarchive::{ }; use sea_orm::ActiveValue::Set; -const IGNORED_FILES: [&str; 5] = [".BUILDINFO", ".INSTALL", ".MTREE", ".PKGINFO", ".CHANGELOG"]; - #[derive(Debug, Clone)] pub struct Package { pub path: PathBuf, @@ -158,11 +156,9 @@ impl Package { let entry = entry?; let path_name = entry.pathname(); - if !IGNORED_FILES.iter().any(|p| p == &path_name) { + if !path_name.starts_with('.') { files.push(PathBuf::from(path_name)); - } - - if path_name == ".PKGINFO" { + } else if path_name == ".PKGINFO" { info = Some(PkgInfo::parse(entry)?); } }