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

Re: Best practice for cleaning autotools-generated files?



On Thu, Mar 17, 2011 at 11:01:44AM -0300, Henrique de Moraes Holschuh wrote:
> On Thu, 17 Mar 2011, Andreas Tille wrote:
> > Assume please the following:
> > 
> >   1. Unpack upstream source, copy debian/ dir into it
> >   2. make -f debian/rules clean
> 
> You should have looked for a get-orig-sources target, first.  You just
> skipped any orig source conditioning the maintainer had to do.

I assumed I'm the maintainer (and have either written such a target or
know about it)
 
> Let's assume none was required.

Yes.  If it is assumed anyway in most cases it is to just change the
upstream source for whatever reason.  In this case I would also fix the
issues I have mentioned.  So assuming none is required is the only case
we really need to discuss here.
 
> >   3. store the resulting build dir into a temporary dir say dir1
> >   4. debuild
> >   5. store a backup of your *.dsc + *diff*
> >   6. make -f debian/rules clean
> >   7. Now compare the build dir with dir1
> >       --> you get a diff (for whatever reason there are several
> >           examples - most of them because of broken clean targets
> >           which do not clean up autogenerated files)
> 
> The packaging is broken, maybe in a minor way.

I agree that it is minor.  However, I try to care also for minor issues.

> It depends on whether it
> retools properly and will present the same differences no matter how many
> times you rebuild, or do a different thing at every rebuild.

It does different things between the first and all other builds (while
the later will probably not lead to remarkable changes any more - except
if some autogenerated files might contain time stamps inside the code).
 
> > I would consider this a situation which should be avoided if possible.
> 
> Sure, but it has nothing to do with using non-reversible transformations
> during the build (such as removing files or retooling in-place).
> 
> It has everything to do with not doing a througout job in "debian/rules
> clean", and not fixing/working around bugs in the upstream build system.

Yes.  You can make backup copies of all affected files and put them
right into place inside your clean target.  That's perfectly doable but
is this really worth the effort?  I would prefer to fix the upstream
tarball in a way that these stupid cases will not happen (if such a
change is easily doable and in cases were upstream just has forgotten
to call make distclean it is).

So the question boils down to:  Fixing up upstream cruft in
get-orig-source or in clean target?

Kind regards

        Andreas.

-- 
http://fam-tille.de


Reply to: