>>> libwhich: Building testing/libwhich 1.2.0-r0 (using abuild 3.10.0_rc1-r2) started Sat, 26 Nov 2022 01:29:20 +0000 >>> libwhich: Checking sanity of /home/buildozer/aports/testing/libwhich/APKBUILD... >>> libwhich: Analyzing dependencies... >>> libwhich: Installing for build: build-base sed zlib-dev (1/3) Installing sed (4.9-r0) (2/3) Installing zlib-dev (1.2.13-r0) (3/3) Installing .makedepends-libwhich (20221126.012921) Executing busybox-1.35.0-r29.trigger OK: 380 MiB in 106 packages >>> libwhich: Cleaning up srcdir >>> libwhich: Cleaning up pkgdir >>> libwhich: Fetching https://distfiles.alpinelinux.org/distfiles/edge/libwhich-1.2.0.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 146 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 404 >>> libwhich: Fetching https://github.com/vtjnash/libwhich/archive/v1.2.0/libwhich-1.2.0.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 7681 0 7681 0 0 9543 0 --:--:-- --:--:-- --:--:-- 9543 >>> libwhich: Fetching https://distfiles.alpinelinux.org/distfiles/edge/libwhich-1.2.0.tar.gz >>> libwhich: Checking sha512sums... libwhich-1.2.0.tar.gz: OK >>> libwhich: Unpacking /var/cache/distfiles/edge/libwhich-1.2.0.tar.gz... gcc -std=gnu99 -D_GNU_SOURCE -Wall -pedantic -O2 -Os -fomit-frame-pointer -Os -fomit-frame-pointer -c -o libwhich.o libwhich.c gcc libwhich.o -o libwhich -ldl -Wl,--as-needed,-O1,--sort-common ./test-libwhich.sh # set pipefail, if possible (running in bash), for additional error detection (set -o pipefail) 2>/dev/null && set -o pipefail dotest() { "$@"; } echo() { `which echo` "$@"; } ## tests for failures ## S=`dotest $LIBWHICH` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: expected 1 argument specifying library to open (got 0) [ "$S" = "expected 1 argument specifying library to open (got 0)" ] || exit 1 S=`dotest $LIBWHICH '' 2` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: expected first argument to specify an output option: -p library path -a all dependencies -d direct dependencies [ "$S" = "expected first argument to specify an output option: -p library path -a all dependencies -d direct dependencies" ] || exit 1 S=`dotest $LIBWHICH 1 2\ 3 '4 5'` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: expected 1 argument specifying library to open (got 3) [ "$S" = "expected 1 argument specifying library to open (got 3)" ] || exit 1 S=`dotest $LIBWHICH not_a_library` [ $? -eq 1 ] || exit 1 echo RESULT: $S RESULT: failed to open library: Error loading shared library not_a_library: No such file or directory S1=`echo $S | $SED -e 's!^failed to open library: .*\.*$!ok!'` echo "$S1" ok [ "$S1" = "ok" ] || exit 1 ## tests for successes ## set -e # exit on error ### tests for script usages ### dotest $LIBWHICH -a libz.$SHEXT | $XARGS -0 echo > /dev/null # make sure the files are valid (suppress stdout) S=`dotest $LIBWHICH -p libz.$SHEXT` echo RESULT: $S RESULT: /lib/libz.so [ -n "$S" ] || exit 1 S=$(dotest $LIBWHICH -a libz.$SHEXT | $GREP -aF "$S") # make sure -p appears in the -a list echo RESULT: $S RESULT: /lib/libz.so [ -n "$S" ] || exit 1 S=`dotest $LIBWHICH -a libz.$SHEXT | $SED -e 's/^[^\\/]*\x00//' | $SED -e 's/\x00.*//'` # get an existing (the first real) shared library path echo RESULT: $S RESULT: /lib/ld-musl-i386.so.1 [ -n "$S" ] || exit 1 if [ "$TARGET" = "Darwin" ]; then [ "$S" = "/usr/lib/libSystem.B.dylib" ] || exit 1 else $STAT "$S" fi File: /lib/ld-musl-i386.so.1 Size: 628420 Blocks: 1232 IO Block: 4096 regular file Device: fd01h/64769d Inode: 28313026 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2022-11-25 19:10:40.138099307 +0000 Modify: 2022-11-10 18:24:00.000000000 +0000 Change: 2022-11-10 18:32:32.572186790 +0000 LIB=$S # save it for later usage S=`dotest $LIBWHICH -p "$LIB"` # test for identity echo RESULT: $S RESULT: /lib/ld-musl-i386.so.1 [ "$S" = "$LIB" ] || exit 1 S=`dotest $LIBWHICH -a "$LIB" | ${XARGS} -0 echo` # use xargs echo to turn \0 into spaces echo RESULT: "$S" RESULT: /lib/ld-musl-i386.so.1 [ -n "$S" ] || exit 1 S=`dotest $LIBWHICH -d "$LIB" | ${XARGS} -0 echo` # check that it didn't load anything else echo RESULT: $S RESULT: [ -z "$S" ] || exit 1 ### tests for command line ### S=`dotest $LIBWHICH "$LIB"` echo RESULT: $S RESULT: library: /lib/ld-musl-i386.so.1 dependencies: /lib/ld-musl-i386.so.1 S1a=`! echo "$S" | $GREP '^+'` # see that we didn't get a line starting with + [ $? -eq 0 ] || exit 1 [ -z "$S1a" ] || exit 1 if [ "$TARGET" = "WINNT" ]; then S1b=`echo "$S" | $GREP '^ [A-Za-z]:\\\\'` else S1b=`echo "$S" | $GREP '^ /'` fi [ -n "$S1b" ] || exit 1 # see that we did get an absolute path if [ "$TARGET" = "WINNT" ]; then S2=`echo $S | $SED -e 's!^library: [A-Za-z]:\\\\[^ ]\+ dependencies: [A-Za-z]:\\\\.*!ok!'` else S2=`echo $S | $SED -e 's!^library: [^ ]\+ dependencies: .*$!ok!'` fi [ "$S2" = "ok" ] || exit 1 # see that the general format is as expected S=`dotest $LIBWHICH libz.$SHEXT` echo RESULT: $S RESULT: library: /lib/libz.so dependencies: /lib/ld-musl-i386.so.1 + /lib/libz.so S1a=`echo "$S" | $GREP '^+'` if [ "$TARGET" = "WINNT" ]; then S1b=`echo "$S" | $GREP '^+ [A-Za-z]:\\\\.*\(libz\|msvcrt\).*'` else S1b=`echo "$S" | $GREP '^+ /.*libz.*'` fi [ -n "$S1a" ] || exit 1 # see that we did get a path starting with +, [ "$S1a" = "$S1b" ] || exit 1 # and that it's an absolute path to libz (or dependency) if [ "$TARGET" = "WINNT" ]; then S2=`echo $S | $SED -e 's!^library: [A-Za-z]:\\\\[^ ]*libz[^ ]* dependencies: [A-Za-z]:\\\\.*libz.*$!ok!'` else S2=`echo $S | $SED -e 's!^library: /[^ ]*libz[^ ]* dependencies: .*libz.*$!ok!'` fi [ "$S2" = "ok" ] || exit 1 # see the general format is as expected ## finished successfully ## echo "SUCCESS" SUCCESS >>> libwhich: Entering fakeroot... mkdir -p /home/buildozer/aports/testing/libwhich/pkg/libwhich/usr/bin install -m755 libwhich /home/buildozer/aports/testing/libwhich/pkg/libwhich/usr/bin/libwhich >>> libwhich*: Running postcheck for libwhich >>> libwhich*: Preparing package libwhich... >>> libwhich*: Stripping binaries >>> libwhich*: Scanning shared objects >>> libwhich*: Tracing dependencies... so:libc.musl-x86.so.1 >>> libwhich*: Package size: 28.0 KB >>> libwhich*: Compressing data... >>> libwhich*: Create checksum... >>> libwhich*: Create libwhich-1.2.0-r0.apk >>> libwhich: Build complete at Sat, 26 Nov 2022 01:29:23 +0000 elapsed time 0h 0m 3s >>> libwhich: Cleaning up srcdir >>> libwhich: Cleaning up pkgdir >>> libwhich: Uninstalling dependencies... (1/3) Purging .makedepends-libwhich (20221126.012921) (2/3) Purging sed (4.9-r0) Executing sed-4.9-r0.post-deinstall (3/3) Purging zlib-dev (1.2.13-r0) Executing busybox-1.35.0-r29.trigger OK: 380 MiB in 103 packages >>> libwhich: Updating the testing/x86 repository index... >>> libwhich: Signing the index...