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

seeking approval for reprepro 3.5.2-3



I've prepared reprepro 3.5.2-3 incorporating the fixes in reprepro 3.6.1.
As 3.6.1 is in experimental, this could go via unstable if approved.

It fixes three bugs, all not in the BTS:

- Ctrl-C support for some operations got lost in 3.3. This causes a
  locked database if the user is too impatient.
- the reoverride command was totally broken in multiple ways
  (causing an assertion in some cases, reporting out of memory
   erroneously otherwise, putting things in an uncommon position
   and ignoring section and priority which are for override the most
   intresting, because of blindly c&p code from elsewhere).
- interaction with libbz2 had a bug in dealing with libbz2 needing
  multiple calls to finish compression. (It returns BZ_FINISH_OK
  instead of BZ_RUN_OK then. Dunno if something in libbz2 changed
  or some user just had very bad luck to run into this. It causes
  reprepro to abort when trying to export an distribution).

The debdiff follows (files permuted to make it easier to read):

diff -u reprepro-3.5.2/debian/changelog reprepro-3.5.2/debian/changelog
--- reprepro-3.5.2/debian/changelog
+++ reprepro-3.5.2/debian/changelog
@@ -1,3 +1,12 @@
+reprepro (3.5.2-3) unstable; urgency=low
+
+  * backport some bugfixes of 3.6.1 to 3.5.2:
+  - readd Ctrl-C support to file database operations
+  - fix reoverride command (LP: 206663)
+  - fix error in handling libbz2 return codes
+
+ -- Bernhard R. Link <brlink@debian.org>  Mon, 18 Aug 2008 11:55:46 +0200
+
 reprepro (3.5.2-2) unstable; urgency=low
 
   * backport some bugfixes of 3.6.0 to 3.5.2:
only in patch2:
unchanged:
--- reprepro-3.5.2.orig/files.c
+++ reprepro-3.5.2/files.c
@@ -476,6 +476,10 @@
 		result = RET_NOTHING;
 		while( cursor_nexttemp(database->checksums, cursor,
 					&filekey, &checksum) ) {
+			if( interrupted() ) {
+				RET_UPDATE(result, RET_ERROR_INTERRUPTED);
+				break;
+			}
 			r = action(privdata, filekey);
 			RET_UPDATE(result, r);
 		}
@@ -489,6 +493,10 @@
 	result = RET_NOTHING;
 	while( cursor_nexttemp(database->oldmd5sums, cursor,
 				&filekey, &checksum) ) {
+		if( interrupted() ) {
+			RET_UPDATE(result, RET_ERROR_INTERRUPTED);
+			break;
+		}
 		r = action(privdata, filekey);
 		RET_UPDATE(result,r);
 	}
only in patch2:
unchanged:
--- reprepro-3.5.2.orig/override.h
+++ reprepro-3.5.2/override.h
@@ -31,5 +31,7 @@
  * incorporates otherreplaces, or frees them on error */
 /*@null@*/struct fieldtoadd *override_addreplacefields(const struct overrideinfo *override,
 		/*@only@*/struct fieldtoadd *otherreplaces);
+/* as above, but all fields. and may return NULL if there are no overrides */
+retvalue override_allreplacefields(const struct overrideinfo *, /*@out@*/struct fieldtoadd **);
 
 #endif
only in patch2:
unchanged:
--- reprepro-3.5.2.orig/override.c
+++ reprepro-3.5.2/override.c
@@ -277,3 +277,20 @@
 
 }
 
+retvalue override_allreplacefields(const struct overrideinfo *override, struct fieldtoadd **fields_p) {
+	int i;
+	struct fieldtoadd *fields = NULL;
+
+	assert( override != NULL );
+
+	for( i = 0 ; i+1 < override->fields.count ; i+=2 ) {
+			fields = addfield_new(
+				override->fields.values[i],override->fields.values[i+1],
+				fields);
+			if( fields == NULL )
+				return RET_ERROR_OOM;
+
+	}
+	*fields_p = fields;
+	return RET_OK;
+}
only in patch2:
unchanged:
--- reprepro-3.5.2.orig/binaries.c
+++ reprepro-3.5.2/binaries.c
@@ -268,6 +268,7 @@
 	const struct overrideinfo *o;
 	struct fieldtoadd *fields;
 	char *newchunk;
+	retvalue r;
 
 	if( interrupted() )
 		return RET_ERROR_INTERRUPTED;
@@ -276,10 +277,10 @@
 	if( o == NULL )
 		return RET_NOTHING;
 
-	fields = override_addreplacefields(o,NULL);
-	if( fields == NULL )
-		return RET_ERROR_OOM;
-	newchunk = chunk_replacefields(controlchunk,fields,"Description");
+	r = override_allreplacefields(o, &fields);
+	if( RET_WAS_ERROR(r) )
+		return r;
+	newchunk = chunk_replacefields(controlchunk, fields, "Filename");
 	addfield_free(fields);
 	if( newchunk == NULL )
 		return RET_ERROR_OOM;
only in patch2:
unchanged:
--- reprepro-3.5.2.orig/sources.c
+++ reprepro-3.5.2/sources.c
@@ -328,6 +328,7 @@
 	const struct overrideinfo *o;
 	struct fieldtoadd *fields;
 	char *newchunk;
+	retvalue r;
 
 	if( interrupted() )
 		return RET_ERROR_INTERRUPTED;
@@ -336,10 +337,10 @@
 	if( o == NULL )
 		return RET_NOTHING;
 
-	fields = override_addreplacefields(o,NULL);
-	if( fields == NULL )
-		return RET_ERROR_OOM;
-	newchunk = chunk_replacefields(controlchunk,fields,"Files");
+	r = override_allreplacefields(o, &fields);
+	if( RET_WAS_ERROR(r) )
+		return r;
+	newchunk = chunk_replacefields(controlchunk, fields, "Directory");
 	addfield_free(fields);
 	if( newchunk == NULL )
 		return RET_ERROR_OOM;
only in patch2:
unchanged:
--- reprepro-3.5.2.orig/target.c
+++ reprepro-3.5.2/target.c
@@ -704,7 +704,7 @@
 	retvalue result, r;
 	const char *package, *controlchunk;
 
-	assert(target->packages!=NULL);
+	assert(target->packages==NULL);
 	assert(distribution!=NULL);
 
 	if( verbose > 1 ) {
only in patch2:
unchanged:
--- reprepro-3.5.2.orig/release.c
+++ reprepro-3.5.2/release.c
@@ -907,9 +907,12 @@
 		bzret = BZ2_bzCompress(&f->bzstream,BZ_FINISH);
 		f->bz_waiting_bytes = BZBUFSIZE - f->bzstream.avail_out;
 
-		if( bzret == BZ_RUN_OK || bzret == BZ_STREAM_END ) {
+		/* BZ_RUN_OK most likely is not possible here, but BZ_FINISH_OK
+		 * is returned when it cannot be finished in one step.
+		 * but better safe then sorry... */
+		if( (bzret == BZ_RUN_OK || bzret == BZ_FINISH_OK || bzret == BZ_STREAM_END)
+		    && f->bz_waiting_bytes > 0 ) {
 			retvalue r;
-			assert( f->bz_waiting_bytes != 0 );
 			r = writetofile(&f->f[ic_bzip2],
 					(const unsigned char*)f->bzoutputbuffer,
 					f->bz_waiting_bytes);
@@ -918,7 +921,7 @@
 				return r;
 			f->bz_waiting_bytes = 0;
 		}
-	} while( bzret == BZ_RUN_OK );
+	} while( bzret == BZ_RUN_OK || bzret == BZ_FINISH_OK );
 
 	if( bzret != BZ_STREAM_END ) {
 		fprintf(stderr,"Error from bzlib's bzCompress: "


Hochachtungsvoll,
	Bernhard R. Link


Reply to: