# unzip (BRINTOS-151) — Info-ZIP UnZip 6.0: list, test, extract, pipe, plus the # zipinfo/funzip/zipgrep companions. The fixture archive ships prebuilt in data/ # (a.txt deflated, b.txt stored, dir/c.txt nested) because zip is a separate # package and the suite must not depend on it being installed. . "$BST_LIB" require unzip unzip/present ar="$BST_DATA/unzip-sample.zip" line="the quick brown fox jumps over the lazy dog 0123456789" # Info-ZIP UnZip 6.0, not the busybox applet: update-alternatives priority 100 # must have won the /usr/bin/unzip link (busybox registers it at 50). check_out unzip/version "UnZip 6.00" sh -c "unzip -v 2>&1" check_out unzip/infozip "Info-ZIP" sh -c "unzip -v 2>&1" # list without extraction check_out unzip/list-a "a.txt" unzip -l "$ar" check_out unzip/list-nested "dir/c.txt" unzip -l "$ar" # integrity test walks every member's CRC check_out unzip/test "No errors detected" unzip -t "$ar" tmp=${TMPDIR:-/tmp}/bst-unzip.$$ mkdir "$tmp" 2>/dev/null # full extraction: deflated, stored, and nested members land with their content check unzip/extract sh -c "cd '$tmp' && unzip -q '$ar'" check_out unzip/content-deflated "$line" cat "$tmp/a.txt" check_out unzip/content-stored "second member" cat "$tmp/b.txt" check_out unzip/content-nested "nested member" cat "$tmp/dir/c.txt" # pipe a single member to stdout check_out unzip/pipe "second member" unzip -p "$ar" b.txt # companions installed by the same package check_out unzip/zipinfo "a.txt" zipinfo -1 "$ar" check_out unzip/funzip "$line" sh -c "funzip < '$ar'" check_out unzip/zipgrep "second member" zipgrep second "$ar" rm -rf "$tmp"