Axel Beckert <a...@debian.org> writes:

> Yann Dirson wrote:
>> Subject: dh_install: no way to rename files while installing
>
> Yep, that's a little bit annoying, so I herewith second this wishlist
> bug report. :-)

For what its worth, this can already be easily solved if you use dh >= 9
and dh-exec. Just make your .install file executable, add
#!/usr/bin/dh-exec to the top, and you can use "source => dest", like
this:

#!/usr/bin/dh-exec
debian/default.conf => /etc/my-package/start.conf

>> What about, for v5 compat level, changing the semantics of the .install
>> files, to interpret the 2nd member of each clause as a dir only when it has
>> a trailing slash, and interpret entries with no trailing slash as full
>> filenames ?
>
> That sounds sane, but that'll also mean that all present
> debian/install files will have a different semantic in the future.

Depending on a trailing / is horribly annoying, to say the least. Please
don't do that. Not only is it annoying, it will break the vast majority
of debian/install files, which do not have a trailing / at the end of
the second component. Granted, the breakage comes after upping the
compat level, but still - if a 'solution' needs changes in the vast
majority of the packages, that is no solution at all.

> I had another heuristic in mind: If all but the last component in the
> target exist and are directories, treat the tail of the target as
> file. Not sure how many trouble that will cause for a migration.
>
> Maybe, it's better to add a new dh_ helper tool named dh_rename,

Check dh-exec, really. It solves the problem in a neat way, does not
introduce a new helper, but builds on an executable .install. It is 100%
backwards compatible, and only needs changes in the .install file if you
really need to do the rename. Everything else is left untouched.

Transition from .install to dh-exec+.install needs 4 steps:

 1) Add a dh-exec build-dep (it's in wheezy, and is easily backportable
    to squeeze too, if that's your thing)
 2) Make the appropriate .install file executable
 3) Add a #!/usr/bin/dh-exec she-bang
 4) Add any "source => dest" lines

Done. Takes next to no time at all.

> Typical, slightly generalized examples where I ran into the missing of
> such a feature:
>
> blafasel.conf.example  etc/blafasel.conf
> example.conf         etc/package.conf
> somesh7                      bin/somesh
> foobar.sh            usr/bin/foobar

All of these are trivial to solve with dh-exec, and it is already in the
archive!

-- 
|8]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to