forked from vieter-v/vieter
Ignore certain files from archive
parent
d4b7a25c06
commit
0ed2c9f854
|
@ -31,8 +31,11 @@ pub fn pkg_info(pkg_path string) ?(string, []string) {
|
|||
for C.archive_read_next_header(a, &entry) == C.ARCHIVE_OK {
|
||||
pathname := C.archive_entry_pathname(entry)
|
||||
|
||||
unsafe {
|
||||
files << cstring_to_vstring(pathname)
|
||||
ignored_names := [c'.BUILDINFO', c'.INSTALL', c'.MTREE', c'.PKGINFO', c'.CHANGELOG']
|
||||
if ignored_names.all(C.strcmp(it, pathname) != 0) {
|
||||
unsafe {
|
||||
files << cstring_to_vstring(pathname)
|
||||
}
|
||||
}
|
||||
|
||||
if C.strcmp(pathname, c'.PKGINFO') == 0 {
|
||||
|
|
|
@ -105,7 +105,7 @@ fn reader_to_file(mut reader io.BufferedReader, length int, path string) ? {
|
|||
|
||||
fn main() {
|
||||
// archive.list_filenames()
|
||||
res := pkg.read_pkg('test/jjr-joplin-desktop-2.6.10-4-x86_64.pkg.tar.zst') or {
|
||||
res := pkg.read_pkg('test/homebank-5.5.1-1-x86_64.pkg.tar.zst') or {
|
||||
eprintln(err.msg)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue