--- pkg_libchk.orig 2009-04-19 17:57:16.000000000 +0200 +++ pkg_libchk 2013-06-26 22:01:57.000000000 +0200 @@ -23,6 +23,8 @@ readonly name=pkg_libchk readonly version=1.6.1 +readonly osname=`uname -s` +readonly pkgng=`make -f /usr/share/mk/bsd.port.mk -V WITH_PKGNG` # Use a line break as delimiter. IFS=' @@ -206,7 +208,7 @@ dependencyMissing() { # We cannot handle non-native binaries, # so assume everything is in order. if ! readelf -e "$1" 2>&1 | \ - grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $OSTYPE\$" \ + grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $osname\$" \ > /dev/null then return 2 @@ -405,10 +407,17 @@ statusSet 'Preparing ...' # Get the packages to work on. test -z "$packages" && packages="-a" -packages="$(pkg_info -E $packages)" -test -z "$recursive" -a -z "$Recursive" || packages="$packages -$(pkg_info -q $recursive $Recursive "$packages" 2> /dev/null | \ -sed -E 's|^@pkgdep[[:space:]]*||1')" +if [ -n "$pkgng" ]; then + packages="$(pkg info -q $packages)" + test -z "$recursive" -a -z "$Recursive" || packages="$packages + $(pkg info -q $recursive $Recursive "$packages" 2> /dev/null | \ + sed -E 's|^@pkgdep[[:space:]]*||1')" +else + packages="$(pkg_info -E $packages)" + test -z "$recursive" -a -z "$Recursive" || packages="$packages + $(pkg_info -q $recursive $Recursive "$packages" 2> /dev/null | \ + sed -E 's|^@pkgdep[[:space:]]*||1')" +fi # Create the regexp to match ldd output match_expr="$compat=> not found|dependency .+ not found" @@ -420,9 +429,15 @@ package_num=0 # Check each selected package. for package in $packages; { package_num="$(($package_num + 1))" - test $origin \ - && package_name="$(pkg_info -qo "$package")" \ - || package_name="$package" + if [ -n "$pkgng" ]; then + test $origin \ + && package_name="$(pkg info -qo "$package")" \ + || package_name="$package" + else + test $origin \ + && package_name="$(pkg_info -qo "$package")" \ + || package_name="$package" + fi # Print what we're doing. statusSet "Starting job $package_num of $package_amount: $package_name" @@ -432,7 +447,12 @@ for package in $packages; { # Remember freeing the semaphore. trap 'semaphoreFree jobs' EXIT - files="$(pkg_info -qL "$package")" + files="" + if [ -n "$pkgng" ]; then + files="$(pkg info -lq "$package")" + else + files="$(pkg_info -qL "$package")" + fi # Get the programs libraries in case it doesn't use the # operating system to find its libraries. libraries="$(echo "$files" | grep -E '\.so[\.0-9]*$')"