Debian Bug report logs - #245554
dh_install: man page should mention dh_exec for renamings

version graph

Package: debhelper; Maintainer for debhelper is Debhelper Maintainers <debhelper-devel@lists.alioth.debian.org>; Source for debhelper is src:debhelper.

Reported by: Yann Dirson <dirson@debian.org>

Date: Fri, 23 Apr 2004 19:18:01 UTC

Severity: wishlist

Found in version 4.2.8

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#245554; Package debhelper. Full text and rfc822 format available.

Acknowledgement sent to Yann Dirson <dirson@debian.org>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Yann Dirson <dirson@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dh_install: no way to rename files while installing
Date: Fri, 23 Apr 2004 21:08:42 +0200
Package: debhelper
Version: 4.2.8
Severity: wishlist

When files have to be installed with another name than the source one,
dh_install is not sufficient, one has to rename the files afterwards.

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 ?

I also thought about using some more heuristics instead, such as "when the
2nd component has the same suffix as the 1st one, it's not a dir, it's a
renaming".  That one should be sufficient in many cases, and would make
transition from v4 to v5 require less work, but I feel it's somewhat DWIM
and may cause problems: files without a suffix could not be renamed that
way, for example.

-- 
Yann Dirson    <ydirson@altern.org> |    Why make M$-Bill richer & richer ?
Debian-related: <dirson@debian.org> |   Support Debian GNU/Linux:
Pro:    <yann.dirson@fr.alcove.com> |  Freedom, Power, Stability, Gratuity
     http://ydirson.free.fr/        | Check <http://www.debian.org/>



Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#245554; Package debhelper. (Fri, 11 Jan 2013 16:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Axel Beckert <abe@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Fri, 11 Jan 2013 16:15:03 GMT) Full text and rfc822 format available.

Message #10 received at 245554@bugs.debian.org (full text, mbox):

From: Axel Beckert <abe@debian.org>
To: 245554@bugs.debian.org
Subject: Re: Bug#245554: dh_install: no way to rename files while installing
Date: Fri, 11 Jan 2013 17:11:25 +0100
Hi,

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. :-)

> When files have to be installed with another name than the source one,
> dh_install is not sufficient, one has to rename the files afterwards.

Yeah, either that or go back to "install ...".

> 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.

> I also thought about using some more heuristics instead, such as "when the
> 2nd component has the same suffix as the 1st one, it's not a dir, it's a
> renaming".  That one should be sufficient in many cases, and would make
> transition from v4 to v5 require less work, but I feel it's somewhat DWIM
> and may cause problems: files without a suffix could not be renamed that
> way, for example.

Yep.

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,
dh_installrename or dh_renameinstall, which looks for a file list
named debian/rename. This file will have a similar semantic like
debian/install, except that will treat the trailing path component of
the second argument as the same type (file or directory) as the given
first component. No wildcards allowed -- unless you want reimplement
mmv. :-)

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

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5



Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#245554; Package debhelper. (Sat, 12 Jan 2013 15:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gergely Nagy <algernon@balabit.hu>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sat, 12 Jan 2013 15:57:03 GMT) Full text and rfc822 format available.

Message #15 received at 245554@bugs.debian.org (full text, mbox):

From: Gergely Nagy <algernon@balabit.hu>
To: Axel Beckert <abe@debian.org>
Cc: 245554@bugs.debian.org
Subject: Re: Bug#245554: dh_install: no way to rename files while installing
Date: Sat, 12 Jan 2013 16:54:43 +0100
Axel Beckert <abe@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]




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#245554; Package debhelper. (Sat, 12 Jan 2013 21:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Axel Beckert <abe@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sat, 12 Jan 2013 21:15:03 GMT) Full text and rfc822 format available.

Message #20 received at 245554@bugs.debian.org (full text, mbox):

From: Axel Beckert <abe@debian.org>
To: Gergely Nagy <algernon@balabit.hu>
Cc: 245554@bugs.debian.org, Yann Dirson <dirson@debian.org>
Subject: Re: Bug#245554: dh_install: no way to rename files while installing
Date: Sat, 12 Jan 2013 22:12:47 +0100
Control: retitle -1 dh_install: man page should mention dh_exec for renamings

Hi,

Gergely Nagy 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

Yay! Thanks for that pointer, I didn't know that.

Maybe debhelper should suggest dh-exec like it does with dh-make? At
least it should mention it in the dh_install man-page.

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

Perfect. Retitling this bug report then. Thanks again for the pointer.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5



Changed Bug title to 'dh_install: man page should mention dh_exec for renamings' from 'dh_install: no way to rename files while installing' Request was from Axel Beckert <abe@debian.org> to 245554-submit@bugs.debian.org. (Sat, 12 Jan 2013 21:15:03 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 19:39:14 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.