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

Re: Dealing with get-orig-source and md5sum



David Paleino wrote:

> Hello mentors,
> I'm packaging a svn snapshot of a Mono assembly, for which no released tarball
> is present.
> As per Policy 3.8.0, I wrote in debian/README.Debian-source how to get a
> tarball to start the build, i.e. "./debian/rules get-orig-source".
> 
> This is my get-orig-source target (please tell me if and how it can be
> improved), with some variables defined in the very beginning of the makefile:
> 
> ---8<---
> VERSION=$(shell parsechangelog | grep ^Version | awk -F": " '{print $$2}' |
> cut -d"-" -f1) REV=$(shell echo $(VERSION) | awk -F"~svn" '{print $$2}')
> GOS_TMP=$(CURDIR)/get-orig-source-tmp

AFAIK, get-orig-source shouldn't rely on other files to do it's job. I have
always hardcoded the version or date to make the checkout from, to ensure that
only debian/rules is used, and that it can be used from anywhere
(eg, ../src/package/debian/rules get-orig-source).

> 
> [..]
> 
> get-orig-source:
> rm -rf $(GOS_TMP) && mkdir $(GOS_TMP)
> svn co -r $(REV) svn://anonsvn.mono-project.com/source/trunk/Mono.Nat
> $(GOS_TMP)/mono-nat-sharp-$(VERSION)

You can use svn export and skip the next instruction.

> find $(GOS_TMP)/mono-nat-sharp-$(VERSION) 
> -name ".svn" -type d | xargs rm -rf 


> cd $(GOS_TMP) && tar zcf 
> mono-nat-sharp_$(VERSION).orig.tar.gz mono-nat-sharp-$(VERSION)/ mv
> $(GOS_TMP)/mono-nat-sharp_$(VERSION).orig.tar.gz $(CURDIR)/../ rm -rf
> $(GOS_TMP) echo "The original source tarball is located at $(CURDIR)/../ ."

Policy 4.9 says it should be left at the current directory.

> --->8---
> 
> Now, the fact is that the resulting tarball has very different md5sums at
> each run -- and I found no way to have the same exact md5sum of the
> .orig.tar.gz that would be uploaded to Debian:
> 
> $ date -R
> Thu, 19 Jun 2008 23:12:36 +0200
> $ debian/rules get-orig-source &>/dev/null
> $ md5sum ../mono-nat-sharp_0.1~svn106158.orig.tar.gz
> 2826da659bb5a5ab5867c8ca11b6f7fe  ../mono-nat-sharp_0.1~svn106158.orig.tar.gz
> $ debian/rules get-orig-source &>/dev/null
> $ md5sum ../mono-nat-sharp_0.1~svn106158.orig.tar.gz
> 54db2bdb1131f7b3e5a1a73d495bd737  ../mono-nat-sharp_0.1~svn106158.orig.tar.gz
> $ date -R
> Thu, 19 Jun 2008 23:13:06 +0200
> $
> 
> I thought that this could be related to timestamps -- but I found no option in
> `man tar` to remove timestamps from archived files (I thought that, removing
> timestamps, the files would have been all the same).
> I can also confirm that the files in the archives are always the same (checked
> with `tar -tf` and diffing the lists).
> 
> What can I do here?

AFAIK the problem is not tar, but gzip. If I read correctly man gzip, your
solution would be to use tar first, and then gzip -9n. 


-- 

  Felipe Sateler


Reply to: