[1/9] test-installation: refactor skipping the unwanted libraries

Message ID 20260919100444.2316950-2-xry111@xry111.site (mailing list archive)
State Superseded
Delegated to: Adhemerval Zanella Netto
Headers
Series Make test-installation.pl work |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

Xi Ruoyao Sept. 19, 2026, 10:04 a.m. UTC
  Make it easier to add more items.  No functional change.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
 scripts/test-installation.pl | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
  

Comments

Adhemerval Zanella Netto Sept. 24, 2026, 4:40 p.m. UTC | #1
On 19/09/26 07:04, Xi Ruoyao wrote:
> Make it easier to add more items.  No functional change.
> 
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>


> ---
>  scripts/test-installation.pl | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
> index a87fb056cc..57897a9efd 100755
> --- a/scripts/test-installation.pl
> +++ b/scripts/test-installation.pl
> @@ -115,19 +115,21 @@ while (<SOVERSIONS>) {
>    if (/^lib/) {
>      ($name, $version)= /^lib(.*)\.so-version=\.(.*)$/;
>      # Filter out some libraries we don't want to link:
> -    # - nss_ldap since it's not yet available
> -    # - libdb1 since it conflicts with libdb
> -    # - libthread_db since it contains unresolved references
> -    # - it's just a test NSS module
> -    # - We don't provide the libgcc so we don't test it
> -    # - libmvec if it wasn't built
> +    @skip = (
> +      # conflicts with libdb
> +      "db1",
> +      # contains unresolved references
> +      "thread_db",
> +      # is just a test NSS module
> +      "nss_test1",
> +      # are not provided by glibc
> +      "libgcc_s", "nss_ldap",
> +    );
> +    next if (grep { $_ eq $name } @skip);
> +    # libmvec if it wasn't built
>      next if ($build_mathvec == 0 && $name eq "mvec");
> -    if ($name ne "nss_ldap" && $name ne "db1"
> -	&& $name ne "thread_db"
> -	&& $name ne "nss_test1" && $name ne "libgcc_s") {
> -      $link_libs .= " -l$name";
> -      $versions{$name} = $version;
> -    }
> +    $link_libs .= " -l$name";
> +    $versions{$name} = $version;
>    } elsif ($LD_SO ne "") {
>      ($ld_so_name, $ld_so_version) = split ('\.so\.', $LD_SO);
>    } else {

Minor nit: @skip is now rebuilt on every iteration. I think it 
could be defined once.  Not a blocker.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
  

Patch

diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
index a87fb056cc..57897a9efd 100755
--- a/scripts/test-installation.pl
+++ b/scripts/test-installation.pl
@@ -115,19 +115,21 @@  while (<SOVERSIONS>) {
   if (/^lib/) {
     ($name, $version)= /^lib(.*)\.so-version=\.(.*)$/;
     # Filter out some libraries we don't want to link:
-    # - nss_ldap since it's not yet available
-    # - libdb1 since it conflicts with libdb
-    # - libthread_db since it contains unresolved references
-    # - it's just a test NSS module
-    # - We don't provide the libgcc so we don't test it
-    # - libmvec if it wasn't built
+    @skip = (
+      # conflicts with libdb
+      "db1",
+      # contains unresolved references
+      "thread_db",
+      # is just a test NSS module
+      "nss_test1",
+      # are not provided by glibc
+      "libgcc_s", "nss_ldap",
+    );
+    next if (grep { $_ eq $name } @skip);
+    # libmvec if it wasn't built
     next if ($build_mathvec == 0 && $name eq "mvec");
-    if ($name ne "nss_ldap" && $name ne "db1"
-	&& $name ne "thread_db"
-	&& $name ne "nss_test1" && $name ne "libgcc_s") {
-      $link_libs .= " -l$name";
-      $versions{$name} = $version;
-    }
+    $link_libs .= " -l$name";
+    $versions{$name} = $version;
   } elsif ($LD_SO ne "") {
     ($ld_so_name, $ld_so_version) = split ('\.so\.', $LD_SO);
   } else {