Package: reprepro
Version: 4.12.4-1
Severity: wishlist
Tags: patch

Hey,

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.

Attached patch adds the ability to ignore an arch all package included in a
.changes file if this is already present (from another build).

-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (101, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.7-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages reprepro depends on:
ii  libarchive12   3.0.4-2
ii  libbz2-1.0     1.0.6-4
ii  libc6          2.13-38
ii  libdb5.1       5.1.29-5
ii  libgpg-error0  1.10-3.1
ii  libgpgme11     1.2.0-1.4
ii  zlib1g         1:1.2.7.dfsg-13

Versions of packages reprepro recommends:
ii  apt  0.9.7.7

Versions of packages reprepro suggests:
pn  gnupg-agent      <none>
pn  inoticoming      <none>
pn  lzip             <none>
ii  xz-utils [lzma]  5.1.1alpha+20120614-2

-- no debconf information
>From daffe8c0c12bc1766028d6a80c207edb48bbac98 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] 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.
---
 checkin.c       |    6 ++++++
 docs/reprepro.1 |    4 ++++
 ignore.h        |    3 ++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/checkin.c b/checkin.c
index e2cf01a..e423b58 100644
--- a/checkin.c
+++ b/checkin.c
@@ -919,6 +919,12 @@ 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"))
+			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 779ffc7..096bb4e 100644
--- a/docs/reprepro.1
+++ b/docs/reprepro.1
@@ -2254,6 +2254,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/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.7.10.4

Reply via email to