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

Re: checksumming debian/rules



-=| Tim Retout, Thu, Jul 30, 2009 at 04:38:16PM +0200 |=-
> On Thu, 2009-07-30 at 13:52 +0300, Damyan Ivanov wrote:
> >  * auto-updating d/rules after checksumming:
> >    - dh-make-perl to create d/rules with the checksum tag
> >    - dh-make-perl to update d/rules only if its checksum matches 
> >      a known generated one
> >    - tim takes care of this
> 
> I've been thinking about this.  Updating debian/rules when the checksum
> matches a known generated one could be done by dh-make-perl without
> needing to add a checksum tag in the file itself.

I agree. There is no point of adding a header containing a checksum 
that is easily calculated.

> [...]
> So first, what I have done is to build a tree of sha1sums of the
> existing debian/rules files, using a bash one-liner like this:
> 
> mkdir ../hashes
> sha1sum */debian/rules | while read line; do hash=`echo $line | cut -d' ' -f1`; \
>    file=`echo $line | cut -d ' ' -f3`; cp -n $file ../hashes/$hash; done
> 
> And I built some other files to show how frequently-used each version of
> debian/rules was, and to provide a mapping of sha1sum back to the
> packages which use each version.  Note that running these commands is
> very quick indeed, even over the whole of svn trunk.
> 
> In my copy of trunk from a few days ago, there are 765 different
> debian/rules files.  Some of these are quite similar (just whitespace
> differences)... but a lot are obviously just customized, or previous
> standard versions.  The most popular rules file is used in just 112
> packages.
> 
> You can use 'wc -l * | sort -n' in the hashes directory to show how long
> each rules file is; the longest two are 248 and 252 lines (both using
> yada).
> 
> Anyway, it's still possible to hack dh-make-perl to update rules files
> automatically, but given some of the numbers above, I think it might be
> better to just use checksums to do mass updates outside of dh-make-perl?
> It's still possible to do, of course, but there are 765 checksums to
> study to see whether they can be updated automatically.

Can this number (700+) be reduced? What about if the sha1 is 
calculated after stripping all whitespace?

> In my opinion, it's more cost-effective to migrate to three line dh7
> files (with and without quilt) first, and then hack dh-make-perl if we
> ever migrate away from that (assuming we can get 1000+ packages using
> two standard rules files).  Even then, mass commits are easier, assuming
> we can test the changes properly.

My only hesitation about this is that going over 1000 packages one by 
one will take a lot of effort if done in one push. Converting only 
when preparing new upload will both be less tedious and easier to 
test. This is not to stop you or anyone else who wants to do it :)

(There is already a TODO on dh-make-perl about adding --only option to 
--refresh which can help with mass-replacing)

-- 
dam

Attachment: signature.asc
Description: Digital signature


Reply to: