Adding Octave support

Antonio Terceiro terceiro at
Sat Sep 2 15:43:39 UTC 2017


On Fri, Sep 01, 2017 at 09:49:26PM +0200, Rafael Laboissière wrote:
> Dear autodep8 maintainers,
> I added preliminary support in autodep8 for the Octave-Forge [1] packages
> maintained by the Debian Octave Group [2].  It is in the 'octave' branch of
> the Git repository for autodep8.  I put my changes into a branch because I
> am not sure about the development policy.  Please tell me whether I can
> merge my branch into master.

Thanks for looking into this. Adding support new classes of packages will help
us increase the test coverage in Debian, and the overall quality of the

I have looked at the code, and I have a few comments about it. Keep in
mind that I am completely clueless about specifics of octave packages,
so if I say something that doesn't make sense, please let me know.

I will paste your current changes here so that I can comment:

> diff --git a/support/octave/detect b/support/octave/detect
> new file mode 100755
> index 0000000..60b3d19
> --- /dev/null
> +++ b/support/octave/detect
> @@ -0,0 +1,12 @@
> +#!/bin/sh
> +
> +### Select only the packages from Octave-Forge that are maintained through
> +### the octave-pkg-dev tools.  This restriction is necessary because the
> +### autopkgtest command relies on the infrastructure provided by the
> +### octave-pkg-dev package, namely the use of a CDBS-based debian/rules
> +### that accepts the 'check-pkg' target.
> +
> +test -f debian/rules									\
> +    && grep --quiet '^include /usr/share/cdbs/1/class/$' debian/rules	\
> +    && grep-dctrl --quiet -F Source -r '^octave-.*$' debian/control			\
> +    && test -f DESCRIPTION

I don't like how this works at the moment. These tests should be for the
installed package, and should not rely on the build infrastructure.

> diff --git a/support/octave/generate b/support/octave/generate
> new file mode 100755
> index 0000000..d53257d
> --- /dev/null
> +++ b/support/octave/generate
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +
> +cat <<EOF
> +Test-Command: debian/rules check-pkg
> +Depends: @, octave-pkg-dev (>= 1.5.0)
> +Restrictions: allow-stderr
> +EOF

Making the tests depend on octave-pkg-dev will pull a lot of build
infrastructure into the test environment, such as debhelper,
build-essential. That is a problem because it can mask missing
dependencies (i.e. your package works on the test environment even
though it wouldn't work for a regular user installing it).

Look for example how it is done for Perl: the test shared test helper
code is in a specific package (pkg-perl-autopkgtest) with minimal
dependencies, so the tests can be executed without any development tools

> I have two questions:
> a) Should I just include the octave section into or should I run
> to generate it?

it's better to run `make update-examples` to do that for you.

> b) I am unsure what should go into test/ file.  Could you
> please give me some hints here, please?

it should contain "unit"-style tests for your language, i.e. tests that
produce sample minimal source packages that should be handled by your
support and then checks if the package is correcly detected, and that he
test control content generated is the correct one. There are several
examples in the tests for languages that are already supported.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <>

More information about the autopkgtest-devel mailing list