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

Re: debian/rules clean as root or non-root?



On 2010-02-10 21:37 +0100, Goswin von Brederlow wrote:

> Sven Joachim <svenjoac@gmx.de> writes:
>
>> On 2010-02-10 19:02 +0100, Goswin von Brederlow wrote:
>>
>>> I often see sources where debian/rules clean aborts claiming it needs to
>>> be run as root. So then I run it with fakeroot. But if the source was
>>> previously build as root then running fakeroot debian/rules clean might
>>> not be enough. I think the existing dh_testroot helper is insufficient
>>> and anoying for the job.
>>
>> It is both insufficient and unnecessary, I don't use it in my packages.
>> Neither does "dh clean", BTW.
>
> If you build the package as real root and it creates a new directory
> (like installing into debian/package/ always does) then you can not
> clean without being real root. So the check isn't unnecessary.

Yes, and dh_clean will almost certainly fail in such a situation.
Unless, maybe, you went to the insanity of running the build target with
real root rights.

>> You run it, and if it fails you probably need real root rights.  Is
>> there a real problem with that simple approach?
>
> And how many source do you know where clean will always properly report
> errors?

Mine will, since I do not ignore errors in the clean target in my
packages.  And I certainly will not build $RANDOMPACKAGE as root anyway.

> If you did run only debian/rules build as root the error might
> get ignored and lost in the output.

Why would anyone want to run the build target as root?  If you do that,
even running the clean target as root might not give you a state where
you can build the package as a normal user again.

Sven


Reply to: