[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 02/02: c/shared-libs: Accept triggering ldconfig instead of invoking it



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 5468a38e208e7041279fa6b68ab7116a38263865
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Sep 10 21:53:39 2015 +0200

    c/shared-libs: Accept triggering ldconfig instead of invoking it
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/shared-libs.desc | 29 ++++++++++++++++++++++-------
 checks/shared-libs.pm   | 27 +++++++++++++++++++++++----
 debian/changelog        |  3 +++
 3 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/checks/shared-libs.desc b/checks/shared-libs.desc
index f3d9c89..e168413 100644
--- a/checks/shared-libs.desc
+++ b/checks/shared-libs.desc
@@ -110,14 +110,14 @@ Tag: preinst-calls-ldconfig
 Severity: normal
 Certainty: certain
 Info: The preinst script calls ldconfig.  Calls to ldconfig should only be
- in postinst and postrm scripts.
+ in postinst and postrm scripts (or via a noawait trigger).
 Ref: policy 8.1.1
 
 Tag: prerm-calls-ldconfig
 Severity: normal
 Certainty: certain
 Info: The prerm script calls ldconfig.  Calls to ldconfig should only
- be in postinst and postrm scripts.
+ be in postinst and postrm scripts (or via a noawait trigger).
 Ref: policy 8.1.1
 
 Tag: postrm-unsafe-ldconfig
@@ -214,8 +214,12 @@ Ref: policy 8.1.1, #204975
 Tag: udeb-postinst-must-not-call-ldconfig
 Severity: important
 Certainty: certain
-Info: The postinst script calls ldconfig, which is an error in udebs.
- ldconfig is not available and not needed in debian-installer
+Info: The udeb invokes ldconfig on install, which is an error in udebs.
+ .
+ ldconfig is not available and not needed in debian-installer.
+ .
+ Note that this tag may (despite what the name suggests) be issued if
+ the udeb uses a dpkg trigger to invoke ldconfig.
 
 Tag: postrm-has-useless-call-to-ldconfig
 Severity: minor
@@ -225,6 +229,9 @@ Info: The postrm script calls ldconfig even though no shared libraries are
  .
  Note this may be triggered by a bug in debhelper, that causes it to
  auto-generate an ldconfig snippet for packages that does not need it.
+ .
+ This tag may (despite what the name suggests) be issued if the package
+ uses a dpkg trigger.
 Ref: policy 8.1.1, #204975
 
 Tag: postinst-must-call-ldconfig
@@ -232,15 +239,23 @@ Severity: serious
 Certainty: certain
 Info: The package installs shared libraries in a directory controlled by
  the dynamic library loader. Therefore, the package must call "ldconfig" in
- its postinst script.
+ during installation.
+ .
+ This should either be done via a <tt>activate-noawait ldconfig</tt>
+ trigger or by calling "ldconfig" directly in the postinst script on
+ the "configure" step.
 Ref: policy 8.1.1
 
 Tag: postrm-should-call-ldconfig
 Severity: important
 Certainty: certain
 Info: The package installs shared libraries in a directory controlled by
- the dynamic library loader. Therefore, the package should call "ldconfig"
- in its postrm script.
+ the dynamic library loader. Therefore, the package must call "ldconfig" in
+ during removal.
+ .
+ This should either be done via a <tt>activate-noawait ldconfig</tt>
+ trigger or by calling "ldconfig" directly in the postrm script on
+ the "remove" step.
 Ref: policy 8.1.1
 
 Tag: sharedobject-in-library-directory-missing-soname
diff --git a/checks/shared-libs.pm b/checks/shared-libs.pm
index 27dcdaf..3549f2f 100644
--- a/checks/shared-libs.pm
+++ b/checks/shared-libs.pm
@@ -29,7 +29,7 @@ use List::MoreUtils qw(any none);
 use Lintian::Data;
 use Lintian::Relation;
 use Lintian::Tags qw(tag);
-use Lintian::Util qw(fail);
+use Lintian::Util qw(fail strip);
 
 # Libraries that should only be used in the presence of certain capabilities
 # may be located in subdirectories of the standard ldconfig search path with
@@ -633,6 +633,7 @@ sub run {
     }
 
     my $we_call_postinst=0;
+    my $we_trigger_ldconfig = 0;
     if (my $postinst = $info->control_index_resolved_path('postinst')) {
         if ($postinst->is_open_ok) {
             # Decide if we call ldconfig
@@ -642,14 +643,32 @@ sub run {
         }
     }
 
+    if (my $triggers = $info->control_index_resolved_path('triggers')) {
+        if ($triggers->is_open_ok) {
+            # Determine if the package had an ldconfig trigger
+            my $fd = $triggers->open;
+            while (my $line = <$fd>) {
+                strip($line);
+                $line =~ tr/ \t/ /s;
+                if ($line eq 'activate-noawait ldconfig') {
+                    $we_trigger_ldconfig=1;
+                    last;
+                }
+            }
+            close($fd);
+        }
+    }
+
     if ($type eq 'udeb') {
         tag 'udeb-postinst-must-not-call-ldconfig'
-          if $we_call_postinst;
+          if $we_call_postinst or $we_trigger_ldconfig;
     } else {
         tag 'postinst-has-useless-call-to-ldconfig'
-          if $we_call_postinst and not $must_call_ldconfig;
+          if ($we_trigger_ldconfig or $we_call_postinst)
+          and not $must_call_ldconfig;
         tag 'postinst-must-call-ldconfig', $must_call_ldconfig
-          if not $we_call_postinst and $must_call_ldconfig;
+          if not($we_call_postinst or $we_trigger_ldconfig)
+          and $must_call_ldconfig;
     }
 
     my $multiarch = $info->field('multi-arch') // 'no';
diff --git a/debian/changelog b/debian/changelog
index 2f16f2c..1cb53ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -49,6 +49,9 @@ lintian (2.5.37) UNRELEASED; urgency=medium
       packaging.  (Closes: #793503)
   * checks/scripts.pm:
     + [BR] Fix Unescaped left brace in regex.  (Closes: #788926)
+  * checks/shared-libs.{desc,pm}:
+    + [NT] Accept an "activate-noawait ldconfig" trigger instead of
+      explicit calls to "ldconfig".
   * checks/testsuite.pm:
     + [AB] Split up restrictions, features and tests by comma as well as
       space. (Closes: #798359, #792418)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: