Skip to content

Commit

Permalink
(breaking change) bump crystal support to 1.6.0 (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrsandeep authored Dec 18, 2024
1 parent 97c2a34 commit 6a9fb60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
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

0 comments on commit 6a9fb60

Please sign in to comment.