Bug#869363: gradle-helper-plugin: Incorrect usage of doit_in_builddir in gradle.pm (Debhelper Buildsystem)

Adrian Bunk bunk at debian.org
Sun Jul 23 12:24:50 UTC 2017


reassign 869363 gradle-debian-helper 1.5.1
thanks

On Sat, Jul 22, 2017 at 07:14:11PM +0200, Niels Thykier wrote:
> Package: gradle-helper-plugin
> Version: 1.5.1
> Severity: important
> 
> Hi,
> 
> There is bug in gradle.pm that is hidden by bug in Dh_lib.  I intend
> to fix the latter soon, which will cause issues in gradle.pm once that
> happens.  This bug is here:
> 
> 
> > sub clean {
> > 	my $this=shift;
> > 
> > 	$this->doit_in_builddir("find . -wholename .*build/tmp | xargs echo | sed -e 's^build/tmp^build^g' | xargs rm -Rf");
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 	$this->doit_in_builddir("find . -wholename .*build/debian | xargs echo | sed -e 's^build/tmp^build^g' | xargs rm -Rf");
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 	$this->doit_in_builddir("rm", "-Rf", "$this->{cwd}/.gradle", "$this->{cwd}/buildSrc/.gradle", ".m2");
> > }
> 
> 
> The "doit_in_builddir" method calls "print_and_doit", which in turn
> calls "doit".  The API of doit intends for it to *not* fork a shell,
> but the above only works in a shell call.
> 
> I will introduce a "complex_doit_in_builddir" in debhelper/10.7, which
> you can use instead.  You should be able to support both the new call
> plus work with older versions of debhelper by relying on "can" a la:
> 
> """
>   if ($this->can('complex_doit_in_builddir')) {
>     $this->complex_doit_in_builddir(...);
>     $this->complex_doit_in_builddir(...);
>   } else {
>     $this->doit_in_builddir(...);
>     $this->doit_in_builddir(...);
>   }
> """
> 
> Thanks,
> ~Niels




More information about the pkg-java-maintainers mailing list