On 2019/05/10 09:30, Andrew Hewus Fresh wrote:
> p5-Ref-Util-XS could use TEST_DEPENDS=devel/p5-Readonly, as an XS module
> is not a candidate for PKG_ARCH=* so that needs to be removed

This teaches portcheck to look for plists containing shared/static
libraries that are marked PKG_ARCH=*. Any comments/ok?


Index: portcheck
===================================================================
RCS file: /cvs/ports/infrastructure/bin/portcheck,v
retrieving revision 1.126
diff -u -p -r1.126 portcheck
--- portcheck   16 Nov 2018 10:08:38 -0000      1.126
+++ portcheck   13 May 2019 11:56:39 -0000
@@ -851,10 +851,12 @@ sub_checks() {
                        make "${make_args[@]}" show="$vars" | {
                                local comment fullpkgname modules pkg_arch
                                local wantlib perm_pkg_cdrom perm_pkg_ftp
+                               local arch_independent=false
                                read -r comment
                                read -r fullpkgname
                                read -r modules
                                read -r pkg_arch
+                               [[ $pkg_arch == "*" ]] && arch_independent=true
                                read -r wantlib
                                read -r wantlib_ss
                                read -r perm_pkg_cdrom
@@ -865,7 +867,7 @@ sub_checks() {
                                            "COMMENT${subpkg%-}, please"
                                fi
 
-                               if [[ $pkg_arch == "*" && -n $wantlib ]]; then
+                               if $arch_independent && [[ -n $wantlib ]]; then
                                        if [[ $subpkg != - || -n $wantlib_ss 
]]; then
                                                err "${portref}non-empty 
$wantlib_var for" \
                                                    "arch-independent package"
@@ -881,7 +883,8 @@ sub_checks() {
                                            print-plist-with-depends || true) \
                                            </dev/null |&
                                        check_plist "$portref" "$fullpkgname" \
-                                           "$flavor" "${subpkg%-}" "$modules"
+                                           "$flavor" "${subpkg%-}" "$modules" \
+                                           "$arch_independent"
                                        check_lib_depends "$portref" "$subpkg" \
                                            "$modules" "$wantlib"
                                        wait
@@ -935,6 +938,8 @@ sub_checks() {
 #
 #   * @rcscript items and pkg-readmes have @mode, @owner and @group reset.
 #
+#   * PKG_ARCH is not set to * if a library is present.
+#
 check_plist() {
        $debugging && echo "CALLED: check_plist($*)" >&2
 
@@ -943,6 +948,7 @@ check_plist() {
        local flavor_list=$1; shift
        local subpkg=$1; shift
        local modules_list=$1; shift
+       local arch_independent=$1; shift
 
        local flavor is_static=false
        for flavor in $flavor_list; do
@@ -982,6 +988,7 @@ check_plist() {
 
        local qml_found=false qt5_qml_found=false non_qt5_qml_found=false
        local qt4_dep=false qt5_dep=false qt5declarative_dep=false
+       local lib_found=false
 
        local owner_set=false group_set=false mode_set=false
        local readme_seen=false
@@ -1071,6 +1078,7 @@ check_plist() {
                        ;;
                lib/qt5/qml/*)
                        qml_found=true
+                       lib_found=true
                        qt5_qml_found=true
                        ;;
                */qmldir)
@@ -1078,6 +1086,10 @@ check_plist() {
                        non_qt5_qml_found=true
                        ;;
 
+               *.so|*.a|*.so.*)
+                       lib_found=true
+                       ;;
+
                share/dbus-1/system-services/*)
                        dbus_suid_dep_needed=true
                        ;;
@@ -1204,6 +1216,9 @@ check_plist() {
        $qt5_dep && ! $qt4_dep && $non_qt5_qml_found &&
                err "${portref}depends on Qt5 but installs QML files" \
                    "outside PREFIX/lib/qt5/qml/"
+
+       $lib_found && $arch_independent &&
+               err "${portref}arch-independent package contains library files"
 
        # dbus,-suid
        if $dbus_suid_dep_needed && ! $dbus_suid_dep && ! $is_dbus_suid; then

Reply via email to