package reprepro
tags 697630 - patch
thanks

* Simon McVittie <simon.mcvit...@collabora.co.uk> [131126 17:44]:
> 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.

[...]
> +.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

That's not what this patc does. It's rather:

When asked to include a architecture all package into a repository which
already includes the same file (in the same or another distribution),
the package will be included with the information for the Packages
file (like description or the dependencies apt sees) from the new
package, while the file (which is then all dpkg sees) is taken from
the already existing package. This can be useful if multiple builds
create an architecture all package (i.e. if all using dpkg-buildpackage
-b instead of dpkg-buildpackage -B), but great care has to be taken
has to be taken to not end up with conflicting information [...]

The more I try to describe it, the more I think this is not something
I want to have.

How about something like the following instead (it would have the
disadvantage of not adding the arch all package at all if the
conflicting package is in another distribution, but better no package
than a package where content and index might be not match):


diff --git a/checkin.c b/checkin.c
index 1884273..8a1d456 100644
--- a/checkin.c
+++ b/checkin.c
@@ -880,12 +880,13 @@ static retvalue changes_check(const struct distribution 
*distribution, const cha
 }
 
 static retvalue changes_checkfiles(const char *filename, struct changes 
*changes) {
-       struct fileentry *e;
+       struct fileentry *e, **pe;
        retvalue r;
 
        r = RET_NOTHING;
 
-       for (e = changes->files; e != NULL ; e = e->next) {
+       pe = &changes->files;
+       while ((e = *pe) != NULL) {
                //TODO: decide earlier which files to include
                if (e->type == fe_BYHAND) {
                        /* byhand files might have the same name and not
@@ -918,6 +919,21 @@ 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 (r == RET_ERROR_WRONG_MD5 &&
+                   e->architecture_into == architecture_all &&
+                   IGNORABLE(conflictingarchall)) {
+                       struct fileentry *removedentry;
+
+                       fprintf(stderr,
+"Ignoring '%s' as --ignore=ignoreconflictingarchall given and there is already 
a file with different contents of that name.",
+                               e->name);
+
+                       removedentry = e;
+                       *pe = removedentry->next;
+                       removedentry->next = NULL;
+                       freeentries(removedentry);
+                       continue;
+               }
                if (RET_WAS_ERROR(r))
                        return r;
                /* If is was already there, remember that */
@@ -943,6 +959,7 @@ static retvalue changes_checkfiles(const char *filename, 
struct changes *changes
                        }
                        free(fullfilename);
                }
+               pe = &e->next;
        }
 
        return RET_OK;
diff --git a/ignore.h b/ignore.h
index 5a64288..d2c0c5d 100644
--- a/ignore.h
+++ b/ignore.h
@@ -36,7 +36,8 @@
        IGN(wrongarchitecture) \
        IGN(oldfile) \
        IGN(longkeyid) \
-       IGN(missingfile)
+       IGN(missingfile) \
+       IGN(conflictingarchall)
 
 
 enum ignore {


        Bernhard R. Link
-- 
F8AC 04D5 0B9B 064B 3383  C3DA AFFC 96D1 151D FFDC


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to