Line 0
Link Here
|
|
|
1 |
--- ./pkg_libchk.orig 2012-12-12 19:38:36.000000000 +0100 |
2 |
+++ ./pkg_libchk 2012-12-12 19:40:22.000000000 +0100 |
3 |
@@ -23,6 +23,8 @@ |
4 |
|
5 |
readonly name=pkg_libchk |
6 |
readonly version=1.6.1 |
7 |
+readonly osname=`uname -s` |
8 |
+readonly pkgng=`make -VWITH_PKGNG` |
9 |
|
10 |
# Use a line break as delimiter. |
11 |
IFS=' |
12 |
@@ -206,7 +208,7 @@ |
13 |
# We cannot handle non-native binaries, |
14 |
# so assume everything is in order. |
15 |
if ! readelf -e "$1" 2>&1 | \ |
16 |
- grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $OSTYPE\$" \ |
17 |
+ grep -E "^[[:space:]]*OS/ABI:[[:space:]]*UNIX - $osname\$" \ |
18 |
> /dev/null |
19 |
then |
20 |
return 2 |
21 |
@@ -405,10 +407,17 @@ |
22 |
|
23 |
# Get the packages to work on. |
24 |
test -z "$packages" && packages="-a" |
25 |
-packages="$(pkg_info -E $packages)" |
26 |
-test -z "$recursive" -a -z "$Recursive" || packages="$packages |
27 |
-$(pkg_info -q $recursive $Recursive "$packages" 2> /dev/null | \ |
28 |
-sed -E 's|^@pkgdep[[:space:]]*||1')" |
29 |
+if [ "$pkgng" = "yes" ]; then |
30 |
+ packages="$(pkg info -q $packages)" |
31 |
+ test -z "$recursive" -a -z "$Recursive" || packages="$packages |
32 |
+ $(pkg info -q $recursive $Recursive "$packages" 2> /dev/null | \ |
33 |
+ sed -E 's|^@pkgdep[[:space:]]*||1')" |
34 |
+else |
35 |
+ packages="$(pkg_info -E $packages)" |
36 |
+ test -z "$recursive" -a -z "$Recursive" || packages="$packages |
37 |
+ $(pkg_info -q $recursive $Recursive "$packages" 2> /dev/null | \ |
38 |
+ sed -E 's|^@pkgdep[[:space:]]*||1')" |
39 |
+fi |
40 |
|
41 |
# Create the regexp to match ldd output |
42 |
match_expr="$compat=> not found|dependency .+ not found" |
43 |
@@ -420,9 +429,15 @@ |
44 |
# Check each selected package. |
45 |
for package in $packages; { |
46 |
package_num="$(($package_num + 1))" |
47 |
- test $origin \ |
48 |
- && package_name="$(pkg_info -qo "$package")" \ |
49 |
- || package_name="$package" |
50 |
+ if [ "$pkgng" = "yes" ]; then |
51 |
+ test $origin \ |
52 |
+ && package_name="$(pkg info -qo "$package")" \ |
53 |
+ || package_name="$package" |
54 |
+ else |
55 |
+ test $origin \ |
56 |
+ && package_name="$(pkg_info -qo "$package")" \ |
57 |
+ || package_name="$package" |
58 |
+ fi |
59 |
|
60 |
# Print what we're doing. |
61 |
statusSet "Starting job $package_num of $package_amount: $package_name" |
62 |
@@ -432,7 +447,12 @@ |
63 |
# Remember freeing the semaphore. |
64 |
trap 'semaphoreFree jobs' EXIT |
65 |
|
66 |
- files="$(pkg_info -qL "$package")" |
67 |
+ files="" |
68 |
+ if [ "$pkgng" = "yes" ]; then |
69 |
+ files="$(pkg info -lq "$package")" |
70 |
+ else |
71 |
+ files="$(pkg_info -qL "$package")" |
72 |
+ fi |
73 |
# Get the programs libraries in case it doesn't use the |
74 |
# operating system to find its libraries. |
75 |
libraries="$(echo "$files" | grep -E '\.so[\.0-9]*$')" |