Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have set up a working pbuilder toolchain for building Debian packages in i386 and amd64 varieties for Ubuntu. I am using reprepro to manage my own private apt repository and dupload to upload .changes, .dsc, .deb, .orig.tar.gz and .debian.tar.gz files into it. All of this is well documented and it works.

But I am failing to upload the i386 version of one package together with the amd64 version of the same package. Reprepro complains with the following message:

File "pool/main/p/package/package_1.0.dsc" is already registered with different checksums!

The source of the generated i368 and amd64 binary packages are exactly the same and have not been modified by me. How can it be that there is a different checksum?

I investigated and discovered that the checksum difference of the .dsc file is because it contains a differing checksum of the file package_1.0.debian.tar.gz.

Further investigations showed that the package_1.0.debian.tar.gz file has indeed different checksums every time dpkg-buildpackage is invoked by the debian build toolchain. The reason is that it changes the modification time of the /debian subdirectory of a Debian package. The tar program unfortunately includes the modification time into the resulting archive, leading to different checksums every time the toolchain is run.

So, my question is: How can I prevent dpkg-buildpackage from modifying the modification date of the /debian directory when building a Debian package?

If I could do that, the checksum of the files package_1.0.debian.tar.gz and package_1.0.dsc would stay constant, and I could painlessly upload to reprepro.

share|improve this question
add comment

2 Answers

I'm not in exactly the same situation as you, but hopefully my answer can point to what you need.

Rather than using pbuilder I'm currently using multiple chroots for building packages on amd64 and i386. I generate the .dsc outside of the chroots using debuild -S, then copy the appropriate files to the chroots. Not the best way of doing it I realise.

Inside the first chroot I run dpkg-buildpackage -b to build the binary packages. In the second chroot I run dpkg-buildpackage -B, to only build the architecture dependent packages - i.e. those that aren't duplicated.

When I use reprepro to push the packages to my repo, the .debs from the first chroot (i386) with target "all" are copied to all architectures as well as the i386 debs being copied to i386. When I push the packages from the second chroot (amd64), the remaining architecture dependent debs or amd64 are copied across.

share|improve this answer
add comment

You could try overriding tar command and adding --mtime=some_fixed_time argument to it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.