Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(breaking change) bump crystal support to 1.6.0 #1

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: ['opened', 'reopened', 'synchronize', 'ready_for_review']


jobs:
build:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:0.34.0-alpine
image: crystallang/crystal:1.6.0-alpine

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install dependencies
run: apk add --no-cache libarchive-dev
- name: Test
Expand Down
11 changes: 7 additions & 4 deletions src/archive.cr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Archive
class Entry
getter filename : String
getter size : LibC::SizeT
getter info : Crystal::System::FileInfo
getter info : ::File::Info

property file : File?

Expand Down Expand Up @@ -75,7 +75,7 @@ module Archive
name = String.new char_ptr

stat = LibArchive.archive_entry_stat(e).value
info = Crystal::System::FileInfo.new stat
info = ::File::Info.new stat
entry = Entry.new name, size, info

yield entry
Expand Down Expand Up @@ -154,12 +154,15 @@ module Archive
# This is useful when checking the integrity of the archive.
def check
reader do |r|
all_zero_files = false
r.entries do |e|
next unless e.info.file?
e.file = self
e.read
break
data = e.read
break if data.size > 0
all_zero_files = true
end
raise Error.new "No file entries found in the archive" if all_zero_files
end
end
end
Expand Down
1 change: 1 addition & 0 deletions src/libarchive.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ lib LibArchive
type Archive = Void*
type ArchiveEntry = Void*

# https://github.com/libarchive/libarchive/blob/819a50a0436531276e388fc97eb0b1b61d2134a3/libarchive/archive.h#L190
enum Status
EOF = 1
OK = 0
Expand Down
Loading