Prevent the creation of empty omf/* folder

Bug #714891 reported by Emilien Klein on 2011-02-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I've set up a project called Nautilus Image Manipulator [1], using Quickly [2]. By default the script uses to install the program.

When running debuild to generate a Debian package, lintian (quality control for Debian packages) complains about the creation of an empty directory "usr/share/omf/nautilus-image-manipulator/". This is the actual output of Lintian:

$ lintian -i -I --show-overrides nautilus-image-manipulator_0.2-1_i386.changes
I: nautilus-image-manipulator: package-contains-empty-directory usr/share/omf/nautilus-image-manipulator/
N: This package installs an empty directory. This might be intentional but
N: it's normally a mistake. If it is intentional, add a lintian override.
N: If a package ships with or installs empty directories, you can remove
N: them in debian/rules by calling:
N: $ find path/to/base/dir -type d -empty -delete
N: Severity: wishlist, Certainty: possible

Looking at the output of debuild, I noticed that the usr/share/omf/nautilus-image-manipulator/ folder gets created by the setup script (it is not included in the source tarball).
Looking on the Internet, I found this discussion [3] possibly linking DistUtilsExtra with this empty folder creation. I went digging through the code of DistUtilsExtra and think that I have located the origin of this problem in build_help.get_data_files() located in DistUtilsExtra/command/

data_files is initialized empty ( = []), then there is a for loop that would add files (but in my case no eligible files are encountered, so "data_files" stays empty), and at the end the following line appends to the "empty" structure:

data_files.append((os.path.join('share', 'omf', name), glob(omf_pattern)))

I believe this should be preceded by a "if" condition, so that this only gets appended if data_files is not empty.
Is my analysis wrong? Is there a good reason to be creating this empty directory if there is no "omf" file (whatever these files are supposed to be...)?

Thanks for looking into that.


Emilien Klein (emilien-klein) wrote :

Has this also been fixed by r241 [0] committed by Martin Pitt? The part about adding omf files is now conditional. I believe this bug can be closed.


Martin Pitt (pitti) wrote :

Indeed r241 fixed this as a by-product.

Changed in python-distutils-extra:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers