debian/rules being +x, dpkg and life

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

debian/rules being +x, dpkg and life

Louis-Philippe Véronneau-3
Hello, policy mailing list!

I recently sent a package to my usual sponsor to be reviewed and they
came back telling me I should +x debian/rules.

Looking at the Debian Policy, 4.9 says:

> This file [debian/rules] must be an executable makefile

But then 3.3 goes on and says:

> The "dpkg-source" program will automatically make the "debian/rules"
> file executable (see below).

There is also no lintian warning about debian/rules needing to be
executable.

When building the package with debian/rules in mode 644, dpkg-source
indeed fixes it:

> dpkg-buildpackage: warning: debian/rules is not executable; fixing
> that

I'm thus wondering, in my VCS:

* do I have to make debian/rules executable ?
* should I make debian/rules executable ?

If the answer to any of those two questions is 'yes', why should I since
dpkg-source will fix that for me automagically ?

Thanks in advance!


NB: I'm not subscribed to this list, so if you want me to see your
replies, please don't forget to CC me!

--
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁  Louis-Philippe Véronneau
  ⢿⡄⠘⠷⠚⠋   [hidden email] / veronneau.org
  ⠈⠳⣄


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: debian/rules being +x, dpkg and life

Sean Whitton
Hello,

On Tue 25 Jun 2019 at 10:50pm -0400, Louis-Philippe Véronneau wrote:

> Hello, policy mailing list!
>
> I recently sent a package to my usual sponsor to be reviewed and they
> came back telling me I should +x debian/rules.
>
> Looking at the Debian Policy, 4.9 says:
>
>> This file [debian/rules] must be an executable makefile
>
> But then 3.3 goes on and says:
>
>> The "dpkg-source" program will automatically make the "debian/rules"
>> file executable (see below).
>
> There is also no lintian warning about debian/rules needing to be
> executable.
>
> When building the package with debian/rules in mode 644, dpkg-source
> indeed fixes it:
>
>> dpkg-buildpackage: warning: debian/rules is not executable; fixing
>> that
>
> I'm thus wondering, in my VCS:
>
> * do I have to make debian/rules executable ?
> * should I make debian/rules executable ?
>
> If the answer to any of those two questions is 'yes', why should I since
> dpkg-source will fix that for me automagically ?
It says 'must' which technically means your package is RC-buggy if
d/rules is not executable.  Stepping back, why /not/ commit it as
executable to your VCS?  It might help someone someday.

I think the comment about dpkg-source is there because with the 1.0
source package format, you couldn't store the file with execute
permissions within the .dsc, so it's a necessary step.

--
Sean Whitton

signature.asc (847 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: debian/rules being +x, dpkg and life

Bill Allombert-4
In reply to this post by Louis-Philippe Véronneau-3
On Tue, Jun 25, 2019 at 10:50:13PM -0400, Louis-Philippe Véronneau wrote:
> I'm thus wondering, in my VCS:
>
> * do I have to make debian/rules executable ?

I do not see any reason not to do it.

> * should I make debian/rules executable ?

Yes.

> If the answer to any of those two questions is 'yes', why should I since
> dpkg-source will fix that for me automagically ?

dpkg-source make debian/rules executable when extracting the source
package, but it does not change the local copy. When using a VCS you
never use dpkg-source to extract the source package (only to build it)
so you have to set it yourself in your local copy.
If you record it in the VCS, the VCS will make sure the bit is always
set.

There are cicrumstances when it is helpful to run some targets manually,
for example debian/rules clean.

Cheers,
--
Bill. <[hidden email]>

Imagine a large red swirl here.