package reprepro
tags 697630 + patch
thanks

On Tue, 08 Jan 2013 at 23:11:55 +0100, Bernhard R. Link wrote:
> * Sjoerd Simons <sjo...@debian.org> [130107 20:33]:
> > With our usage of reprepro we get .changes files form multiple builders
> > (different architecture), all of them build arch dependent and arch
> > independent. This unfortunately means reprepro will error out as soon as a
> > second buld of an arch all package is received.
> 
> Thanks for your patch, but I fear it is not that easy.
[...]
> This only does not copy the file, and even takes the contents from the
> old file (I don't know if that is good and ugly or bad and ugly, most
> likely something of both), but the checksum is still the one from the
> new file.

Here's a later version of Sjoerd's patch, which seems to address this.
We've been using it for a while and it appears to work fine in practice.

Regards,
    S
>From 5bb0db554d7865e8e86e09648a94b92298892bfb Mon Sep 17 00:00:00 2001
From: Sjoerd Simons <sjoerd.sim...@collabora.co.uk>
Date: Mon, 7 Jan 2013 19:07:58 +0100
Subject: [PATCH 1/2] Add ability to ignore updates of arch all packages

When receiving builds from multiple architectures where all
architectures build architecture-indepent package including changes
files will fail because of the arch all packages. Add an ignore option
(updatedarchall) to ignore inclusion of these files.

This patch only applies this ignore to the "include" command.

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697630
---
 checkin.c       | 11 +++++++++++
 docs/reprepro.1 |  4 ++++
 files.c         |  2 +-
 files.h         |  2 ++
 ignore.h        |  3 ++-
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/checkin.c b/checkin.c
index 1884273..02ba279 100644
--- a/checkin.c
+++ b/checkin.c
@@ -918,6 +918,17 @@ static retvalue changes_checkfiles(const char *filename, struct changes *changes
 			return RET_ERROR_OOM;
 		/* do not copy yet, but only check if it could be included */
 		r = files_canadd(e->filekey, e->checksums);
+
+		if (e->architecture_into == architecture_all &&
+			r == RET_ERROR_WRONG_MD5 &&
+			IGNORING (updatedarchall,
+"Trying to update an arch all package with a different checksum\n")) {
+			/* Hack replace the checksums with those in the
+			 * database */
+			checksums_free (e->checksums);
+			files_get_checksums (e->filekey, &e->checksums);
+			r = RET_NOTHING;
+		}
 		if (RET_WAS_ERROR(r))
 			return r;
 		/* If is was already there, remember that */
diff --git a/docs/reprepro.1 b/docs/reprepro.1
index d9ff1a3..a55aa79 100644
--- a/docs/reprepro.1
+++ b/docs/reprepro.1
@@ -2372,6 +2372,10 @@ Accept expired signatures with expired keys.
 .B revokedkey \fR(I hope you know what you do)
 Accept signatures with revoked keys.
 (Only if the revoked key is explicitly requested).
+.B updatedarchall
+When asked to include a architecture all package into a repository which
+already includes that same file with a different checksum ignore the request.
+Useful when getting multiple builds include architecture independent packages
 .SH GUESSING
 When including a binary or source package without explicitly
 declaring a component with
diff --git a/files.c b/files.c
index 0d2174f..bbf43ff 100644
--- a/files.c
+++ b/files.c
@@ -38,7 +38,7 @@
 #include "pool.h"
 #include "database_p.h"
 
-static retvalue files_get_checksums(const char *filekey, /*@out@*/struct checksums **checksums_p) {
+retvalue files_get_checksums(const char *filekey, /*@out@*/struct checksums **checksums_p) {
 	const char *checksums;
 	size_t checksumslen;
 	retvalue r;
diff --git a/files.h b/files.h
index 2dceeb2..4b6fd36 100644
--- a/files.h
+++ b/files.h
@@ -17,6 +17,8 @@ struct checksumsarray;
 
 /* Add file's md5sum to database */
 retvalue files_add_checksums(const char *, const struct checksums *);
+/* Retrieve files checksums */
+retvalue files_get_checksums(const char *filekey, /*@out@*/struct checksums **checksums_p);
 
 /* remove file's md5sum from database */
 retvalue files_remove(const char * /*filekey*/);
diff --git a/ignore.h b/ignore.h
index 5a64288..5d78518 100644
--- a/ignore.h
+++ b/ignore.h
@@ -36,7 +36,8 @@
 	IGN(wrongarchitecture) \
 	IGN(oldfile) \
 	IGN(longkeyid) \
-	IGN(missingfile)
+	IGN(missingfile) \
+	IGN(updatedarchall)
 
 
 enum ignore {
-- 
1.8.4.4

Reply via email to