[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dh_install vs. dh_movefiles

On Tue, Sep 25, 2007 at 04:32:06PM +0200, Magnus Holmgren wrote:
> dh_movefiles(1) says that "dh_install is a much better program, and you are 
> recommended to use it instead". Accordingly, I've changed the packages I've 
> adopted from using dh_movefiles to "dh_install --sourcedir=debian/tmp". But 
> it's not entirely clear to me just _how_ dh_install is so much better. And is 
> dh_movefiles deprecated?

It's useful for targets in debian/rules to be idempotent, so that you
can fix a bug and just run 'fakeroot debian/rules binary' without having
to do the build or install again; in fact, I'm sure policy used to
require that, though I can't find it there now. Using dh_movefiles can
make this more difficult, whereas if you use dh_install then the files
are definitely still where the install target put them and you don't
have to muck around to make sure that target gets re-run.

See the changelog for debhelper 4.0.0 for the bugs in dh_movefiles that
were basically fixed by the introduction of dh_install.

TBH, the main reason I prefer dh_install is that it just works more like
the rest of debhelper, and so it's easier to grasp immediately what's
going on.

> I think it can be practical if you need to put some 
> files in one package and the rest in a main package. Since you can't 
> specify "all files in /usr/share/foo except these: ...", you have to 
> basically list them one by one otherwise (or use hacks 
> like "usr/share/foo/{[!b]*,?[!a]*,??[!z]*}", or delete the duplicates 
> afterwards).

Or often dh_install -X is good enough. But that's true ...

> Accidentally overlapping .files lists can cause files to end up in the wrong 
> packages, whereas lintian can detect if the same file is in more than one 
> package. (And one must of course make sure that dh_movefiles operates on the 
> packages in the correct order if using deliberately overlapping lists.)

I must admit I find this sort of use of dh_movefiles to be very
confusing to follow when I encounter it in other people's debian/rules

Colin Watson                                       [cjwatson@debian.org]

Reply to: