#797726 stdeb: "py2dsc-deb --no-pythonX-scripts=True" exits with error due to wrong indent in patch

#797726#5
Date:
2015-09-02 01:22:58 UTC
From:
To:
When called with --no-python2-scripts=True and/or --no-python3-scripts=True,
py2dsc-deb stops with error and fails to generate a deb package.  For example:

    $ pypi-download python-ly
    OK: python-ly-0.9.2.tar.gz

    $ py2dsc-deb --no-python2-scripts=True python-ly-0.9.2.tar.gz
    ...
    dpkg-buildpackage: source changed by Anthony Fok <foka@debian.org>
     dpkg-source --before-build python-ly-0.9.2
     fakeroot debian/rules clean
    debian/rules:10: *** missing separator (did you mean TAB instead of 8
spaces?).  Stop.
    dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit
status 2
    Traceback (most recent call last):
      File "setup.py", line 68, in <module>
        classifiers = classifiers,
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.7/dist-packages/stdeb/command/sdist_dsc.py", line
140, in run
        remove_expanded_source_dir=self.remove_expanded_source_dir,
      File "/usr/lib/python2.7/dist-packages/stdeb/util.py", line 1397, in
build_dsc
        dpkg_genchanges(cwd=fullpath_repackaged_dirname)
      File "/usr/lib/python2.7/dist-packages/stdeb/util.py", line 538, in
dpkg_genchanges
        process_command(args,cwd=cwd)
      File "/usr/lib/python2.7/dist-packages/stdeb/util.py", line 183, in
process_command
        check_call(args, cwd=cwd)
      File "/usr/lib/python2.7/dist-packages/stdeb/util.py", line 46, in
check_call
        raise CalledProcessError(retcode)
    stdeb.util.CalledProcessError: 2
    ERROR running: /usr/bin/python setup.py --command-packages stdeb.command
sdist_dsc --dist-dir=/tmp/deb_dist --use-premade-distfile=/tmp/python-
ly-0.9.2.tar.gz --no-python2-scripts=True bdist_deb
ERROR in deb_dist/tmp_py2dsc/python-ly-0.9.2
    $

It turns out that, with --no-pythonX-scripts=True, the following snippet
is added to debian/rules:

    override_dh_auto_install:
        dh_auto_install
            rm -rf debian/python-python-ly/trash

where the "dh_auto_install" line is indented with 4 spaces instead of a TAB,
leading to the error.  Attached is a suggested patch to fix the incorrect
indentation in stdeb-0.8.5/debian/patches/use_pybuild_buildsystem.patch

Cheers,
Anthony