Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libwhich for openSUSE:Factory checked in at 2022-12-04 14:58:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libwhich (Old) and /work/SRC/openSUSE:Factory/.libwhich.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libwhich" Sun Dec 4 14:58:43 2022 rev:2 rq:1039881 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libwhich/libwhich.changes 2020-03-29 14:28:34.150185666 +0200 +++ /work/SRC/openSUSE:Factory/.libwhich.new.1835/libwhich.changes 2022-12-04 14:59:11.360558897 +0100 @@ -1,0 +2,6 @@ +Sat Dec 3 21:08:56 UTC 2022 - Dirk Müller <dmuel...@suse.com> + +- update to 1.2.0: + * Now UTF-8 on Windows! + +------------------------------------------------------------------- Old: ---- libwhich-1.1.0.tar.gz New: ---- libwhich-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libwhich.spec ++++++ --- /var/tmp/diff_new_pack.ZlV7Vq/_old 2022-12-04 14:59:11.848561708 +0100 +++ /var/tmp/diff_new_pack.ZlV7Vq/_new 2022-12-04 14:59:11.856561755 +0100 @@ -1,7 +1,7 @@ # # spec file for package libwhich # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libwhich -Version: 1.1.0 +Version: 1.2.0 Release: 0 Summary: Which for Dynamic Libraries License: MIT ++++++ libwhich-1.1.0.tar.gz -> libwhich-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libwhich-1.1.0/.appveyor.yml new/libwhich-1.2.0/.appveyor.yml --- old/libwhich-1.1.0/.appveyor.yml 2019-06-07 06:35:59.000000000 +0200 +++ new/libwhich-1.2.0/.appveyor.yml 2022-10-31 21:31:01.000000000 +0100 @@ -40,7 +40,7 @@ artifact: libwhich-$(PLATFORM).exe description: '' auth_token: - secure: Fg66sWbBzKnl2o9bFLgUABqgbeN9luVMLcdlQEKmpwIcSBfAmvrH+j2nZG7VCYAq + secure: 'FbWlTswo50x/YT+rC6cIc5M7PcwYB2weI/Td7k1dX5jtQfepfvIbOnj7ILmH3POK' draft: true prerelease: false on: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libwhich-1.1.0/.github/workflows/CI.yml new/libwhich-1.2.0/.github/workflows/CI.yml --- old/libwhich-1.1.0/.github/workflows/CI.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/libwhich-1.2.0/.github/workflows/CI.yml 2022-10-31 21:31:01.000000000 +0100 @@ -0,0 +1,34 @@ +name: CI +on: + pull_request: + branches: + - master + push: + branches: + - master + tags: '*' +jobs: + test: + name: Test ${{ join(matrix.*, ' - ') }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + arch: x64 + - os: ubuntu-latest + arch: x64 + - os: ubuntu-latest + arch: x86 + steps: + - name: Setup macOS + if: ${{ runner.os == 'macOS' }} + run: brew install gnu-sed + - uses: actions/checkout@v3 + - name: Build + run: make + - name: Test + env: + SED: ${{ runner.os == 'macOS' && 'gsed' || '' }} + run: ./test-libwhich.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libwhich-1.1.0/.travis.yml new/libwhich-1.2.0/.travis.yml --- old/libwhich-1.1.0/.travis.yml 2019-06-07 06:35:59.000000000 +0200 +++ new/libwhich-1.2.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -language: c - -notifications: - email: false - -matrix: - include: - - os: linux - - os: osx - env: SED=./sed/gsed - -before_install: - - ls; - [ $TRAVIS_OS_NAME != osx ] || - [ -e sed/gsed ] || - (curl http://mirror.us-midwest-1.nexcess.net/gnu/sed/sed-4.4.tar.xz | tar x && - ([ -d sed ] || mkdir sed) && - pushd sed-4.4 && - ./configure && - make && - cp sed/sed ../sed/gsed && - popd && - rm -rf sed-4.4) - -cache: - directories: - - $TRAVIS_BUILD_DIR/sed - -script: - - make - - ./test-libwhich.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libwhich-1.1.0/Makefile new/libwhich-1.2.0/Makefile --- old/libwhich-1.1.0/Makefile 2019-06-07 06:35:59.000000000 +0200 +++ new/libwhich-1.2.0/Makefile 2022-10-31 21:31:01.000000000 +0100 @@ -1,5 +1,10 @@ default: libwhich +prefix := /usr +bindir := $(prefix)/bin + +INSTALL := install + TARGET = $(shell uname) override CFLAGS := -Wall -pedantic -O2 $(CFLAGS) override LDFLAGS := $(LDFLAGS) @@ -10,7 +15,7 @@ $(CFLAGS) override LDFLAGS := -municode -mconsole -ffreestanding -nostdlib \ --disable-auto-import --disable-runtime-pseudo-reloc \ - -lntdll -lkernel32 -lpsapi \ + -lntdll -lkernel32 \ $(LDFLAGS) else override CFLAGS := -std=gnu99 -D_GNU_SOURCE $(CFLAGS) @@ -36,4 +41,8 @@ check: libwhich ./test-libwhich.sh -.PHONY: clean check default +install: libwhich + mkdir -p $(DESTDIR)$(bindir) + $(INSTALL) -m755 libwhich $(DESTDIR)$(bindir)/libwhich + +.PHONY: clean check default install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libwhich-1.1.0/libwhich.c new/libwhich-1.2.0/libwhich.c --- old/libwhich-1.1.0/libwhich.c 2019-06-07 06:35:59.000000000 +0200 +++ new/libwhich-1.2.0/libwhich.c 2022-10-31 21:31:01.000000000 +0100 @@ -5,7 +5,7 @@ #define WIN32_LEAN_AND_MEAN #define PSAPI_VERSION 2 // for EnumProcessModulesEx #include <windows.h> -#include <psapi.h> +#include <psapi.h> // for EnumProcessModulesEx #define T(str) L##str #define main wmain // avoid magic behavior for the name "main" in gcc int main(int argc, const WCHAR **argv); @@ -19,22 +19,38 @@ FILE *stderr = &_stderr; int _fwrite(const WCHAR *str, size_t nchars, FILE *out) { DWORD written; + if (nchars == 0) + return 0; if (out->isconsole) { - if (WriteConsole(out->fd, str, nchars, &written, NULL)) + if (WriteConsoleW(out->fd, str, nchars, &written, NULL)) return written; } else { - if (WriteFile(out->fd, str, sizeof(WCHAR) * nchars, &written, NULL)) - return written; + size_t u8len = WideCharToMultiByte(CP_UTF8, 0, str, nchars, NULL, 0, NULL, NULL); + char *u8str = (char*)HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, u8len); + if (!WideCharToMultiByte(CP_UTF8, 0, str, nchars, u8str, u8len, NULL, NULL)) + return 0; + if (WriteFile(out->fd, u8str, u8len, &written, NULL)) { + HeapFree(GetProcessHeap(), 0, u8str); + return nchars; + } + HeapFree(GetProcessHeap(), 0, u8str); } return -1; } +size_t wcslen(const WCHAR *str) +{ + size_t len = 0; + while (*str++) + len++; + return len; +} int fputs(const WCHAR *str, FILE *out) { return _fwrite(str, wcslen(str), out); } int putc(WCHAR c, FILE *out) { - return _fwrite(&c, 1, out); + return _fwrite(&c, 1, out) == -1 ? -1 : c; } int putchar(WCHAR c) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libwhich-1.1.0/test-libwhich.sh new/libwhich-1.2.0/test-libwhich.sh --- old/libwhich-1.1.0/test-libwhich.sh 2019-06-07 06:35:59.000000000 +0200 +++ new/libwhich-1.2.0/test-libwhich.sh 2022-10-31 21:31:01.000000000 +0100 @@ -5,9 +5,13 @@ # xargs # stat # GNU sed (normal sed doesn't support escape sequences) -# iconv (Windows-only) # libz (aka zlib1) shared library (or a stub built from `make libz.so`) +# This can be run in emulation environments by setting the appropriate flags +# make check TARGET=WINNT CC=x86_64-w64-mingw32-gcc \ +# STAT="winepath -u" LIBWHICH="wine ./libwhich.exe" + + if [ -z "$TARGET" ]; then TARGET=`uname` fi @@ -25,12 +29,14 @@ if [ -z "$XARGS" ]; then XARGS=xargs fi -if [ "$TARGET" = "WINNT" ]; then -ICONV="iconv -f utf16le -t utf8" -else -ICONV="cat" +if [ -z "$STAT" ]; then +STAT=stat +fi +if [ -z "$LIBWHICH" ]; then +LIBWHICH=./libwhich fi + S=`$SED --version 2> /dev/null | $GREP "GNU sed"` if [ $? -ne 0 ] || [ -z "$S" ]; then echo 'ERROR: need to point the `SED` environment variable a version of GNU sed (`gsed`)' @@ -42,16 +48,16 @@ # set pipefail, if possible (running in bash), for additional error detection (set -o pipefail) 2>/dev/null && set -o pipefail -# implement `mispipe "$@" "$ICONV"` for a posix shell -dotest() { ( ( ( ( (exec 4>&- 3>&-; "$@"); echo $? >&3; ) | $ICONV >&4; ) 3>&1; ) | (read xs; exit $xs); ) 4>&1; } +dotest() { "$@"; } +echo() { `which echo` "$@"; } ## tests for failures ## -S=`dotest ./libwhich` +S=`dotest $LIBWHICH` [ $? -eq 1 ] || exit 1 echo RESULT: $S [ "$S" = "expected 1 argument specifying library to open (got 0)" ] || exit 1 -S=`dotest ./libwhich '' 2` +S=`dotest $LIBWHICH '' 2` [ $? -eq 1 ] || exit 1 echo RESULT: $S [ "$S" = "expected first argument to specify an output option: @@ -59,12 +65,12 @@ -a all dependencies -d direct dependencies" ] || exit 1 -S=`dotest ./libwhich 1 2\ 3 '4 5'` +S=`dotest $LIBWHICH 1 2\ 3 '4 5'` [ $? -eq 1 ] || exit 1 echo RESULT: $S [ "$S" = "expected 1 argument specifying library to open (got 3)" ] || exit 1 -S=`dotest ./libwhich not_a_library` +S=`dotest $LIBWHICH not_a_library` [ $? -eq 1 ] || exit 1 echo RESULT: $S S1=`echo $S | $SED -e 's!^failed to open library: .*\<not_a_library\>.*$!ok!'` @@ -76,49 +82,59 @@ ### tests for script usages ### -dotest ./libwhich -a libz.$SHEXT | $XARGS -0 echo > /dev/null # make sure the files are valid (suppress stdout) +dotest $LIBWHICH -a libz.$SHEXT | $XARGS -0 echo > /dev/null # make sure the files are valid (suppress stdout) -S=`dotest ./libwhich -p libz.$SHEXT` +S=`dotest $LIBWHICH -p libz.$SHEXT` echo RESULT: $S [ -n "$S" ] || exit 1 -S=$(dotest ./libwhich -a libz.$SHEXT | $GREP -aF "$S") # make sure -p appears in the -a list +S=$(dotest $LIBWHICH -a libz.$SHEXT | $GREP -aF "$S") # make sure -p appears in the -a list echo RESULT: $S [ -n "$S" ] || exit 1 -S=`dotest ./libwhich -a libz.$SHEXT | $SED -e 's/\x00.*//'` # get an existing (the first) shared library path +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 [ -n "$S" ] || exit 1 -stat "$S" +if [ "$TARGET" = "Darwin" ]; then +[ "$S" = "/usr/lib/libSystem.B.dylib" ] || exit 1 +else +$STAT "$S" +fi LIB=$S # save it for later usage -S=`dotest ./libwhich -p "$LIB"` # test for identity +S=`dotest $LIBWHICH -p "$LIB"` # test for identity echo RESULT: $S [ "$S" = "$LIB" ] || exit 1 -S=`dotest ./libwhich -a "$LIB" | ${XARGS} -0 echo` # use xargs echo to turn \0 into spaces +S=`dotest $LIBWHICH -a "$LIB" | ${XARGS} -0 echo` # use xargs echo to turn \0 into spaces echo RESULT: "$S" [ -n "$S" ] || exit 1 -S=`dotest ./libwhich -d "$LIB" | ${XARGS} -0 echo` # check that it didn't load anything else +S=`dotest $LIBWHICH -d "$LIB" | ${XARGS} -0 echo` # check that it didn't load anything else echo RESULT: $S [ -z "$S" ] || exit 1 ### tests for command line ### -S=`dotest ./libwhich "$LIB"` +S=`dotest $LIBWHICH "$LIB"` echo RESULT: $S -S1=`! echo "$S" | $GREP '^+'` +S1a=`! echo "$S" | $GREP '^+'` # see that we didn't get a line starting with + [ $? -eq 0 ] || exit 1 -[ -z "$S1" ] || 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!'` +S2=`echo $S | $SED -e 's!^library: [^ ]\+ dependencies: .*$!ok!'` fi -[ "$S2" = "ok" ] || exit 1 +[ "$S2" = "ok" ] || exit 1 # see that the general format is as expected -S=`dotest ./libwhich libz.$SHEXT` +S=`dotest $LIBWHICH libz.$SHEXT` echo RESULT: $S S1a=`echo "$S" | $GREP '^+'` if [ "$TARGET" = "WINNT" ]; then @@ -126,14 +142,14 @@ else S1b=`echo "$S" | $GREP '^+ /.*libz.*'` fi -[ -n "$S1a" ] || exit 1 -[ "$S1a" = "$S1b" ] || exit 1 +[ -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!'` +S2=`echo $S | $SED -e 's!^library: /[^ ]*libz[^ ]* dependencies: .*libz.*$!ok!'` fi -[ "$S2" = "ok" ] || exit 1 +[ "$S2" = "ok" ] || exit 1 # see the general format is as expected ## finished successfully ## echo "SUCCESS"