Bug#508307: lintian: wrong interpreter-without-predep

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#508307: lintian: wrong interpreter-without-predep

Salvo Tomaselli-3
Package: lintian
Version: 2.1.1
Severity: normal

In a package i am using a python postinst script and lintian complains because python is not among the dependencies... But it is!

You can download the source from here
svn checkout http://galileo.dmi.unict.it/svn/relational/trunk/ relational
and "make debian" to generate the package.




-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (101, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.27-6.slh.5-sidux-686 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lintian depends on:
ii  binutils            2.18.1~cvs20080103-7 The GNU assembler, linker and bina
ii  diffstat            1.46-1               produces graph of changes introduc
ii  dpkg-dev            1.14.23              Debian package development tools
pi  file                4.26-1               Determines file type using "magic"
ii  gettext             0.17-6               GNU Internationalization utilities
ii  intltool-debian     0.35.0+20060710.1    Help i18n of RFC822 compliant conf
ii  libipc-run-perl     0.80-2               Perl module for running processes
ii  libparse-debianchan 1.1.1-2              parse Debian changelogs and output
ii  libtimedate-perl    1.1600-9             Time and date functions for Perl
ii  liburi-perl         1.37+dfsg-1          Manipulates and accesses URI strin
ii  man-db              2.5.2-3              on-line manual pager
ii  perl [libdigest-sha 5.10.0-18            Larry Wall's Practical Extraction

lintian recommends no packages.

Versions of packages lintian suggests:
pn  binutils-multiarch            <none>     (no description available)
pn  libtext-template-perl         <none>     (no description available)
ii  man-db                        2.5.2-3    on-line manual pager

-- no debconf information



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#508307: lintian: wrong interpreter-without-predep

Adam D Barratt
On Tue, 2008-12-09 at 21:36 +0100, Salvo Tomaselli wrote:
> In a package i am using a python postinst script and lintian
> complains because python is not among the dependencies... But it is!

Actually, the reported problem is that python isn't a *pre*dependency,
as the description of the tag indicates - and to which the "predep" in
the tag name is a clue. :-)

It might seem like Lintian is being overly picky here, as in the normal
case one can safely assume that dependencies are present when the
postinst is called, but there are cases where this is not true - where
there is a dependency loop between the packages and both have postinsts,
there is no guarantee as to which order the postinsts will be executed
in. Since Lintian checks packages in isolation, it has no way of knowing
whether such a loop exists (and of course a loop could be later
introduced by another package).

The description of that tag could do with some love, however; it
currently contains an attempted reference to the old Packaging Manual,
which was merged in to Policy several years ago.

Regards,

Adam



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#508307: wrong interpreter-without-predep

Russ Allbery-2
Policy folks,

The question here is about Lintian's check interpreter-without-predep,
which requires that any package that uses a non-base interpreter for any
maintainer script declare a pre-dependency, not just a dependency, on that
interpreter.

The current description of that tag says:

Info: The package contains a control script that uses an unusual
 interpreter, but does not declare a pre-dependency on the package that
 provides this interpreter.
 .
 A perusal of &packaging; section 6.2 shows that any of the control
 scripts can be called while the package is not configured.  Therefore, a
 pre-dependency is required to ensure that the interpreter is always
 available when the script is invoked.
 .
 Please do not add a pre-dependency without following the policy for doing
 so. (Policy section 3.5).

"Adam D. Barratt" <[hidden email]> writes:

> It might seem like Lintian is being overly picky here, as in the normal
> case one can safely assume that dependencies are present when the
> postinst is called, but there are cases where this is not true - where
> there is a dependency loop between the packages and both have postinsts,
> there is no guarantee as to which order the postinsts will be executed
> in. Since Lintian checks packages in isolation, it has no way of knowing
> whether such a loop exists (and of course a loop could be later
> introduced by another package).

I reviewed the section on maintainer scripts, and while preinst certainly
requires a Pre-Depends for any non-base interpreter and postrm can't use a
non-base interpreter at all (due to purge), I think dependency loop
breakage is the only case when postinst or prerm scripts can be called
without all dependencies being configured.

Given that, I think Lintian may be too conservative here.  Dependency
loops are an issue, but they're also rare and maintainers should have some
idea that they might exist.  When they exist, I think they can be treated
as normal bugs.  Adding Pre-Depends due to the possibility of loops
showing up someday seems like a bad idea.  Asking everyone to use standard
interpreters for maintainer scripts sounds like a better idea, but there's
a separate Lintian tag for that anyway which reflects it's not a
requirement.

Given that, my inclination here is to modify Lintian to ban unusual
interpreters for postrm scripts, require Pre-Depends for preinst scripts,
and only require Depends for postinst and prerm scripts.  However, I'd
like to have that checked by other people on the debian-policy list,
particularly those here who also work on dpkg.  Is my analysis correct?

--
Russ Allbery ([hidden email])               <http://www.eyrie.org/~eagle/>



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#508307: wrong interpreter-without-predep

Steve Langasek
On Fri, Dec 26, 2008 at 11:01:24PM -0800, Russ Allbery wrote:
> > It might seem like Lintian is being overly picky here, as in the normal
> > case one can safely assume that dependencies are present when the
> > postinst is called, but there are cases where this is not true - where
> > there is a dependency loop between the packages and both have postinsts,
> > there is no guarantee as to which order the postinsts will be executed
> > in. Since Lintian checks packages in isolation, it has no way of knowing
> > whether such a loop exists (and of course a loop could be later
> > introduced by another package).

> I reviewed the section on maintainer scripts, and while preinst certainly
> requires a Pre-Depends for any non-base interpreter and postrm can't use a
> non-base interpreter at all (due to purge), I think dependency loop
> breakage is the only case when postinst or prerm scripts can be called
> without all dependencies being configured.

> Given that, I think Lintian may be too conservative here.  Dependency
> loops are an issue, but they're also rare and maintainers should have some
> idea that they might exist.  When they exist, I think they can be treated
> as normal bugs.  Adding Pre-Depends due to the possibility of loops
> showing up someday seems like a bad idea.  Asking everyone to use standard
> interpreters for maintainer scripts sounds like a better idea, but there's
> a separate Lintian tag for that anyway which reflects it's not a
> requirement.

> Given that, my inclination here is to modify Lintian to ban unusual
> interpreters for postrm scripts, require Pre-Depends for preinst scripts,
> and only require Depends for postinst and prerm scripts.  However, I'd
> like to have that checked by other people on the debian-policy list,
> particularly those here who also work on dpkg.  Is my analysis correct?

I agree with this.  While a dependency loop can cause a package's postinst
to be called before its dependencies are configured, dpkg always breaks such
dependency loops in favor of packages without a postinst, and adding a
Pre-Depends would not fix this anyway if the nature of the circular
dependency is that the other package also needs this package in its own
postinst.  So lintian should not generally be advising to use Pre-Depends
for an interpreter used in the postinst.

--
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[hidden email]                                     [hidden email]



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#508307: wrong interpreter-without-predep

Russ Allbery-2
Steve Langasek <[hidden email]> writes:

> I agree with this.  While a dependency loop can cause a package's
> postinst to be called before its dependencies are configured, dpkg
> always breaks such dependency loops in favor of packages without a
> postinst, and adding a Pre-Depends would not fix this anyway if the
> nature of the circular dependency is that the other package also needs
> this package in its own postinst.  So lintian should not generally be
> advising to use Pre-Depends for an interpreter used in the postinst.

Thanks!

I've overhauled this for the next version of Lintian and also reworked
some of the tags around maintainer script interpreters to fix severities
and add better and more relevant descriptions.

--
Russ Allbery ([hidden email])               <http://www.eyrie.org/~eagle/>



--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]