melange icon indicating copy to clipboard operation
melange copied to clipboard

feat: support unzip with fetch

Open tuananh opened this issue 2 years ago • 3 comments

tuananh avatar Nov 09 '22 06:11 tuananh

We use busybox which uses libarchive by default. Doesn't libarchive already support extracting zip files?

kaniini avatar Nov 16 '22 15:11 kaniini

I got this error

2022/11/17 02:39:07 melange (test-pkg/x86_64): Length: 96107 (94K) [application/zip]
2022/11/17 02:39:07 melange (test-pkg/x86_64): Saving to: 'docbook-xml-4.4.zip'
2022/11/17 02:39:07 melange (test-pkg/x86_64):
2022/11/17 02:39:07 melange (test-pkg/x86_64):      0K .......... .......... .......... .......... .......... 53%  346K 0s
2022/11/17 02:39:07 melange (test-pkg/x86_64):     50K .......... .......... .......... .......... ...       100%  787K=0.2s
2022/11/17 02:39:07 melange (test-pkg/x86_64):
2022/11/17 02:39:07 melange (test-pkg/x86_64): 2022-11-17 02:39:07 (469 KB/s) - 'docbook-xml-4.4.zip' saved [96107/96107]
2022/11/17 02:39:07 melange (test-pkg/x86_64):
2022/11/17 02:39:07 melange (test-pkg/x86_64): docbook-xml-4.4.zip: OK
2022/11/17 02:39:07 melange (test-pkg/x86_64): tar: invalid tar magic
2022/11/17 02:39:07 melange (test-pkg/x86_64): warning: read |0: file already closed

the melange build file is here

package:
  name: test-pkg
  version: 0.1.0
  epoch: 0
  description: A test pkg
  target-architecture:
    - all
  copyright:
    - paths:
        - "*"
      attestation: TODO
      license: MIT
environment:
  contents:
    repositories:
    - https://dl-cdn.alpinelinux.org/alpine/edge/main
    packages:
      - busybox
      - ca-certificates-bundle

pipeline:
  - uses: fetch
    with:
      uri: https://www.docbook.org/xml/4.4/docbook-xml-4.4.zip
      expected-sha256: 02f159eb88c4254d95e831c51c144b1863b216d909b5ff45743a1ce6f5273090

tuananh avatar Nov 17 '22 02:11 tuananh

Looking forward to this PR to bring Gradle package in the Wofli, which is a .zip file.

Dentrax avatar Nov 23 '22 14:11 Dentrax

the issue from what I've figured out is busybox doesn't support automatic resolution of archive types unlike gnu tar so we'd need a if check for every type of archive we intend to support :/

Lunarequest avatar Dec 08 '22 08:12 Lunarequest