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

Bug#818962: fix the php-script-but-no-phpX-cli-dep error



On Wed, 12 Oct 2016 21:24:00 +0200
Mathieu Parent <math.parent@gmail.com> wrote:

> Hello lintian maintainers,
> 
> Can you please review the attached patch?
>

Hi Mathieu,

first of all, thanks for working on that.

I am not a lintian developer, but I am the one of the first person to
have noticed the problem, I'll add some comments and questions below.

I think a variant of this should really go in before the next stable
debian release.

Thanks,
   Antonio


> From efa0b0d42840867152958227251c147917e21fec Mon Sep 17 00:00:00 2001
> From: Mathieu Parent <Mathieu.PARENT@nantesmetropole.fr>
> Date: Thu, 3 Mar 2016 10:50:36 +0100
> Subject: [PATCH] There is now a php-cli package

Describe better the issue in the short commit message, like for
instance:

"Error when a package has a php script but does not depend on php-cli"

This is what Ondřej Surý thinks lintian should do.

And maybe add some more details in the long commit message, something
like

"Furthermore, when adding the missing dependency packages must not
depend on phpX-cli but rather on php-cli"

And maybe add a link to this bug report number.

> 
> ---
>  checks/scripts.desc                        | 11 +++++------
>  data/scripts/versioned-interpreters        |  2 +-
>  t/tests/legacy-scripts/debian/debian/rules |  4 ++--
>  t/tests/legacy-scripts/tags                |  2 +-
>  4 files changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/checks/scripts.desc b/checks/scripts.desc
> index 12a642b..cd7dfb4 100644
> --- a/checks/scripts.desc
> +++ b/checks/scripts.desc
> @@ -220,13 +220,12 @@ Info: Packages that use mawk scripts must depend on the mawk package.
>  Tag: php-script-but-no-phpX-cli-dep

Shouldn't this become "php-script-but-no-php-cli-dep" ?

>  Severity: important
>  Certainty: certain
> -Info: Packages with PHP scripts must depend on a phpX-cli package such as
> - php5-cli.  Note that a dependency on a php-cgi package (such as php5-cgi)
> - is needlessly strict and forces the user to install a package that isn't
> - needed.
> +Info: Packages with PHP scripts must depend on the php-cli package.
> + Note that a dependency on a php-cgi package (such as php7.0-cgi) is needlessly
> + strict and forces the user to install a package that isn't needed.
>   .
> - In some cases a weaker relationship, such as Suggests or Recommends, will
> - be more appropriate.
> + In some cases a weaker relationship, such as Suggests or Recommends, will be
> + more appropriate.
>   .
>   Lintian can only recognize phpX-cli dependencies for values of X that it
>   knows are available in the archive.  You will get this warning if you
> diff --git a/data/scripts/versioned-interpreters b/data/scripts/versioned-interpreters
> index fff44c2..3b2fa00 100644
> --- a/data/scripts/versioned-interpreters
> +++ b/data/scripts/versioned-interpreters
> @@ -73,7 +73,7 @@ guile   => /usr/bin, guile-([\d.]+), guile-$1, 1.6 1.8,
>  jruby   => /usr/bin, jruby([\d.]+), jruby$1, 1.0 1.1 1.2
>  lua     => /usr/bin, lua([\d.]+), lua$1, 40 50 5.1 5.2
>  octave  => /usr/bin, octave([\d.]+), octave$1, 3.0 3.2
> -php     => /usr/bin, php(\d+), php$1-cli, 5, @NO_DEFAULT_DEPS@
> +php     => /usr/bin, php([\d.]+), php$1-cli, 7.0, php-cli

Does this actually _forbid_ php7.0-cli dependencies?
I am asking because I don't know the meaning of the fields in this file.

>  pike    => /usr/bin, pike([\d.]+), pike$1 | pike$1-core, 7.6 7.8, @NO_DEFAULT_DEPS@
>  python  => /usr/bin, python([\d.]+), python$1:any | python$1-minimal:any, 2.7, @SKIP_UNVERSIONED@
>  ruby    => /usr/bin, ruby([\d.]+), ruby$1, 1.8 1.9, @SKIP_UNVERSIONED@
> diff --git a/t/tests/legacy-scripts/debian/debian/rules b/t/tests/legacy-scripts/debian/debian/rules
> index 25b6f9e..a615bd6 100755
> --- a/t/tests/legacy-scripts/debian/debian/rules
> +++ b/t/tests/legacy-scripts/debian/debian/rules
> @@ -63,8 +63,8 @@ binary-indep:
>  	install -m 755 init-lsb-other $(tmp)/etc/init.d/lsb-other
>  
>  	install -m 755 phpfoo $(tmp)/usr/share/scripts/
> -	sed 's/php$$/php5/' phpfoo > $(tmp)/usr/share/scripts/php5foo
> -	chmod 755 $(tmp)/usr/share/scripts/php5foo
> +	sed 's/php$$/php7.0/' phpfoo > $(tmp)/usr/share/scripts/php7.0foo
> +	chmod 755 $(tmp)/usr/share/scripts/php7.0foo
>

What does this test do? Can we skip it if we do not want to allow
phpX-cli dependencies?

>  	echo "#!/usr/bin/perl" >> $(tmp)/usr/share/scripts/foobar.in
>  	chmod 644 $(tmp)/usr/share/scripts/foobar.in
> diff --git a/t/tests/legacy-scripts/tags b/t/tests/legacy-scripts/tags
> index 0436902..d93069d 100644
> --- a/t/tests/legacy-scripts/tags
> +++ b/t/tests/legacy-scripts/tags
> @@ -14,7 +14,7 @@ E: scripts: init.d-script-needs-depends-on-lsb-base etc/init.d/skeleton (line 40
>  E: scripts: missing-dep-for-interpreter jruby => jruby | jruby1.0 | jruby1.1 | jruby1.2 (usr/bin/jruby-broken)
>  E: scripts: missing-dep-for-interpreter lefty => graphviz (usr/bin/lefty-foo)
>  E: scripts: package-installs-python-bytecode usr/lib/python2.3/site-packages/test.pyc
> -E: scripts: php-script-but-no-phpX-cli-dep usr/share/scripts/php5foo
> +E: scripts: php-script-but-no-phpX-cli-dep usr/share/scripts/php7.0foo
>  E: scripts: php-script-but-no-phpX-cli-dep usr/share/scripts/phpfoo

php-script-but-no-php-cli-dep

I mean, it should not mention phpX-cli anymore, but just php-cli.

And we should not allow php7.0-cli deps.

>  E: scripts: python-script-but-no-python-dep usr/bin/py2foo
>  E: scripts: python-script-but-no-python-dep usr/bin/pyfoo
> -- 
> 2.9.3
> 


-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


Reply to: