Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 1998 00:29:54 +0200
From:      Stefan Esser <se@FreeBSD.ORG>
To:        Warner Losh <imp@village.org>, Mark Murray <mark@grondar.za>
Cc:        hackers@FreeBSD.ORG, Stefan Esser <se@FreeBSD.ORG>
Subject:   Re: ctm question
Message-ID:  <19980430002954.10328@mi.uni-koeln.de>
In-Reply-To: <199804280606.AAA01869@harmony.village.org>; from Warner Losh on Tue, Apr 28, 1998 at 12:06:16AM -0600
References:  <199804280603.IAA19498@greenpeace.grondar.za> <199804280606.AAA01869@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1998-04-28 00:06 -0600, Warner Losh <imp@village.org> wrote:
> In message <199804280603.IAA19498@greenpeace.grondar.za> Mark Murray writes:
> : You are SOL. A partially applied CTM delta breaks everything :-(
> 
> I'm thinking about hacking ctm to have a mode that ignores the delta
> if the md5 already matches the new md5 in the ctm package.  That way
> if there is a mismatch with the old one, it will try to apply it, keep
> quiet about the ones that are up to date and whine (but not die) if
> there is one that doesn't match either of the md5's.  This would let
> me recover from 95% of the partially applied CTM delta problems I've
> run into over the years.  It would at least let me KNOW what is
> corrupted and take whatever action I need to to recover.
> 
> I've not even looked at the code, nor at the ctmmd5 stuff that chuck
> pointed me at.  Would there be any interest in this?
> 
> Warner

Well, I already implemented this, a long time ago ...

I had the same problem of a partially applied delta some
time last year, and decided to make ctm check both the
pre and post MD5 for a possible match. Don't remember,
whether the "force" option is required for this feature,
haven't needed it for quite some time :)

Please check out the following patch:

Index: /usr/src/usr.sbin/ctm/ctm/ctm_pass2.c
===================================================================
RCS file: /usr/cvs/src/usr.sbin/ctm/ctm/ctm_pass2.c,v
retrieving revision 1.16
diff -r1.16 ctm_pass2.c
157c157,163
< 			    if(j & CTM_Q_MD5_Force) {
---
> 			    GETFIELDCOPY(md5,sep);
> 			    if(md5 != NULL && strcmp(tmp,md5) == 0) {
> 				fprintf(stderr,"  %s: %s already applied.\n",
> 					sp->Key,name);
> 				match = CTM_FILTER_DISABLE;
> /*				ret |= Exit_Forcible; /* XXX Testing Only */
> 			    } else if(j & CTM_Q_MD5_Force) {
168,170c174,177
< 		    }
< 		    if(j & CTM_Q_MD5_After) {
< 			GETFIELDCOPY(md5,sep);
---
> 		    } else if(j & CTM_Q_MD5_After) {
> 			if(md5 == NULL) {
> 			    GETFIELDCOPY(md5,sep);
> 			}

Regards, STefan

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980430002954.10328>