-
Notifications
You must be signed in to change notification settings - Fork 315
/
Copy pathgzip.yaml
161 lines (144 loc) · 3.96 KB
/
gzip.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package:
name: gzip
version: "1.13"
epoch: 30
description: "GNU data compression program"
copyright:
- license: GPL-3.0-or-later
dependencies:
runtime:
- merged-bin
- wolfi-baselayout
environment:
contents:
packages:
- autoconf
- automake
- build-base
- busybox
- ca-certificates-bundle
- coreutils
- gettext-dev
- texinfo
- xz
pipeline:
- uses: git-checkout
with:
repository: https://git.savannah.gnu.org/git/gzip.git
tag: v${{package.version}}
expected-commit: 0ff67062bc123d07dfb1f05c78231107aa9d1869
- runs: |
./bootstrap
- name: Configure
runs: |
export DEFS="NO_ASM"
./configure \
--host=${{host.triplet.gnu}} \
--target=${{host.triplet.gnu}} \
--prefix=/usr \
--datadir=/usr/share
- uses: autoconf/make
- uses: autoconf/make-install
- runs: |
ln -sf /usr/bin/gunzip ${{targets.destdir}}/usr/bin/uncompress
- uses: strip
subpackages:
- name: "gzip-doc"
description: "gzip documentation"
pipeline:
- uses: split/manpages
- uses: split/infodir
test:
pipeline:
- uses: test/docs
dependencies:
runtime:
- merged-bin
- wolfi-baselayout
update:
enabled: true
release-monitor:
identifier: 1290
test:
environment:
contents:
packages:
- bash
- coreutils
- findutils
pipeline:
- name: "Verify command availability and versions"
runs: |
gzip --version
gunzip --version
zcat --version
- name: "Test basic file compression"
runs: |
# Create test file
echo "This is a test file with repeated content" > testfile
cp testfile testfile.orig
# Test compression
gzip testfile
[ -f testfile.gz ]
[ ! -f testfile ]
# Test decompression and verify content
gunzip testfile.gz
cmp testfile testfile.orig
- name: "Test stdin/stdout operations"
runs: |
echo "Testing pipeline compression" | gzip | gunzip | grep "Testing pipeline compression"
- name: "Test multiple file compression"
runs: |
# Create multiple test files
echo "file1" > file1
echo "file2" > file2
echo "file3" > file3
# Compress multiple files
gzip file1 file2 file3
[ -f file1.gz ] && [ -f file2.gz ] && [ -f file3.gz ]
- name: "Test compression levels"
runs: |
# Create larger test file
dd if=/dev/zero bs=1M count=1 > largefile
# Test different compression levels
gzip -1 -c largefile > fast.gz
gzip -9 -c largefile > best.gz
# Best compression should be smaller
[ $(stat -c %s best.gz) -le $(stat -c %s fast.gz) ]
- name: "Test zcat functionality"
runs: |
echo "zcat test content" > zcattest
gzip zcattest
zcat zcattest.gz | grep "zcat test content"
- name: "Test force compression"
runs: |
echo "force test" > forcefile
gzip forcefile
echo "new content" > forcefile
gzip -f forcefile
gunzip forcefile.gz
grep "new content" forcefile
- name: "Test keeping original file"
runs: |
echo "keep test" > keepfile
gzip -k keepfile
[ -f keepfile ] && [ -f keepfile.gz ]
- name: "Test recursive compression"
runs: |
mkdir -p testdir/subdir
echo "file1" > testdir/file1
echo "file2" > testdir/subdir/file2
gzip -r testdir
[ -f testdir/file1.gz ]
[ -f testdir/subdir/file2.gz ]
- name: "Test uncompress compatibility"
runs: |
echo "uncompress test" > compressfile
gzip compressfile
uncompress compressfile.gz
grep "uncompress test" compressfile
- name: "Test integrity check"
runs: |
echo "integrity test" > integrityfile
gzip integrityfile
gzip -t integrityfile.gz