2

I've overridden dh_auto_install: target in debian/rule file. Now, all my built components installed in debian/tmp.

I prepared package.install for every package of my set but I have this issue:

Package A should contains scripts with two files.

Package B should contains scripts dir too but without two files that will be in package A.

Of cause it's possible to set files in scripts dir in debian/B.install file. But scripts dir contains huge count of files and put every of it will take a more time.

Is it possible to exclude some particular files in package.install file?

1 Answer 1

3

Is it possible to exclude some particular files in package.install file?

Not directly, but there are at least three ways of achieving what you’re after. (Since you mention overriding dh_install, I’m guessing you’re using short-dh style rules.)

  1. dh_install copies files from debian/tmp to their target. Its predecessor, dh_movefiles, moves them; it’s deprecated but can still be used in this kind of situation. The way to do this is to list package A before package B in debian/control (so it’s processed first, assuming both have the same architecture), rename A.install to A.files, and override dh_install so that it runs dh_movefiles first:

    override_dh_install:
            dh_movefiles
            dh_install
    

    This will move the files for A out of debian/tmp, so your B.install file can then list scripts and B will have all the files that are left in scripts.

    The dh sequences skip dh_movefiles so there’s nothing special to do to avoid its running twice.

  2. debhelper configuration files can be executable, so you could replace B.install with a script which lists scripts’ contents and filters out anything that’s in A.install.

  3. Another approach would be to add a step after dh_install which removes anything in A from B; something like

    override_dh_install:
            dh_install
            cd debian/A/scripts; find . -type f -exec rm -f ../B/scripts/{} \;
    

    (untested).

1
  • Many thank's! Great answer as always! I didn't know that debhelper configuration files may be executable. Possibly I omit this fact when was reading "Debian New Maintainers' Guide". Strange that this feature isn't exists in any of debhelper utility. RPM spec files instead has %exclude macro for %files section to achieve this target. Commented May 24, 2018 at 16:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .