fix(package): ignore all files that start with a dot

pull/11/head
Jef Roosens 2024-06-27 13:52:07 +02:00
parent e3b0f4f0a1
commit 86ab143271
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 2 additions and 6 deletions

View File

@ -13,8 +13,6 @@ use libarchive::{
}; };
use sea_orm::ActiveValue::Set; use sea_orm::ActiveValue::Set;
const IGNORED_FILES: [&str; 5] = [".BUILDINFO", ".INSTALL", ".MTREE", ".PKGINFO", ".CHANGELOG"];
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Package { pub struct Package {
pub path: PathBuf, pub path: PathBuf,
@ -158,11 +156,9 @@ impl Package {
let entry = entry?; let entry = entry?;
let path_name = entry.pathname(); 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)); files.push(PathBuf::from(path_name));
} } else if path_name == ".PKGINFO" {
if path_name == ".PKGINFO" {
info = Some(PkgInfo::parse(entry)?); info = Some(PkgInfo::parse(entry)?);
} }
} }