File repackage-nomd5.diff of Package rpm

--- lib/psm.c.orig	2010-03-11 15:37:37.000000000 +0000
+++ lib/psm.c	2010-03-11 16:38:04.000000000 +0000
@@ -1708,6 +1708,7 @@ psm->te->h = headerLink(fi->h);
 	if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)	break;
 
 	if (psm->goal == PSM_PKGINSTALL) {
+	    rpmtransFlags oldtsflags;
 
 	    if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB)	break;
 
@@ -1735,6 +1736,10 @@ psm->te->h = headerLink(fi->h);
 		break;
 	    }
 
+	    /* auto-add NOMD5 for repackaged packages */
+	    oldtsflags = rpmtsFlags(ts);
+	    if (headerIsEntry(fi->h, RPMTAG_REMOVETID))
+		(void) rpmtsSetFlags(ts, oldtsflags | RPMTRANS_FLAG_NOMD5);
 	    rc = fsmSetup(fi->fsm, FSM_PKGINSTALL, ts, fi,
 			psm->cfd, NULL, &psm->failedFile);
 	    (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_UNCOMPRESS),
@@ -1742,6 +1747,8 @@ psm->te->h = headerLink(fi->h);
 	    (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DIGEST),
 			fdstat_op(psm->cfd, FDSTAT_DIGEST));
 	    xx = fsmTeardown(fi->fsm);
+	    if (headerIsEntry(fi->h, RPMTAG_REMOVETID))
+		(void) rpmtsSetFlags(ts, oldtsflags);
 
 	    saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
 	    xx = Fclose(psm->cfd);