From owner-freebsd-current Fri Sep 27 12:12:26 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA12476 for current-outgoing; Fri, 27 Sep 1996 12:12:26 -0700 (PDT) Received: from vector.jhs.no_domain (slip139-92-42-20.ut.nl.ibm.net [139.92.42.20]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id MAA12255; Fri, 27 Sep 1996 12:12:06 -0700 (PDT) Received: from vector.jhs.no_domain (localhost [127.0.0.1]) by vector.jhs.no_domain (8.7.5/8.6.9) with ESMTP id RAA20468; Fri, 27 Sep 1996 17:57:34 +0200 (MET DST) Message-Id: <199609271557.RAA20468@vector.jhs.no_domain> To: A JOSEPH KOSHY cc: phk@freebsd.org, freebsd-current@freebsd.org Subject: Re: ctm & disc full From: "Julian H. Stacey" Reply-To: "Julian H. Stacey" Organization: Vector Systems Ltd. Mailer: EXMH 1.6.7, PGP available X-Address: Holz Strasse 27d, 80469 Munich, Germany X-Phone: +49.89.268616 X-Fax: +49.89.2608126 X-Web: http://www.freebsd.org/~jhs/ In-reply-to: Your message of "Wed, 25 Sep 1996 09:26:48 +0500." <199609250426.AA112135608@fakir.india.hp.com> Date: Fri, 27 Sep 1996 17:57:33 +0200 Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, Reference: > From: A JOSEPH KOSHY > > There are a couple of new options in -current CTM that may help you: > > -B filename backups whatever would be modified to `filename' before > applying any patches. > > -l shows what would be touched > > -e regex specify `include' and `exclude' regexes which you can > -x regex use to touch parts of the source tree Ah, Thanks Joseph, -B wasn't in my /usr/sbin tree from 1 Sep, so I've recompiled & installed the new stuff. > Something like the following would be helpful > > cd your-source-directory > > for i in somewhere/ctm-files*.gz; do > > ctm -B $i.back -v -v $i # apply CTM patch > > if [ $? = 0 ]; then # all ok > rm -f $i.back > else > echo "ctm patch $i failed." > exit 1 > fi > > done > Hey that sounds good ! > So if you do encounter problems you could > > Run: > ctm -l ctm-file.gz > list-of-files-that-change > > Then: > ctm -e exp -x exp -e exp ... ctm-file.gz > > to selectively update what got missed out. > > OR: > restore from the backup file and re-apply the Ctm patch. > > Hope this helps, > Koshy Right, I'm modifying my shell script now to do this, Thanks Koshy But I need that -B available to ctm_rmail & it's not there ... so I've added it, patch attached. (also available as http://www.freebsd.org/~jhs/src/bsd/fixes/FreeBSD/src/generic/\ usr.sbin/ctm/ctm_rmail/ctm_rmail.c.backup.diff ) ------------- This allows ctm_rmail -B backup_dir to pass the -B backup_dir down to ctm -B backup_dir I didn't bother to test it, i've simply compiled & installed it on my (jhs@freebsd.org) system 960927. *** old/src/usr.sbin/ctm/ctm_rmail/ctm_rmail.c Fri Sep 27 18:19:04 1996 --- new/src/usr.sbin/ctm/ctm_rmail/ctm_rmail.c Fri Sep 27 18:51:17 1996 *************** *** 28,33 **** --- 28,34 ---- char *piece_dir = NULL; /* Where to store pieces of deltas. */ char *delta_dir = NULL; /* Where to store completed deltas. */ char *base_dir = NULL; /* The tree to apply deltas to. */ + char *backup_dir = NULL; /* The tree to make backups in. */ int delete_after = 0; /* Delete deltas after ctm applies them. */ int apply_verbose = 0; /* Run with '-v' */ int set_time = 0; /* Set the time of the files that is changed. */ *************** *** 62,68 **** err_prog_name(argv[0]); ! OPTIONS("[-Dfuv] [-p piecedir] [-d deltadir] [-b basedir] [-l log] [file ...]") FLAG('D', delete_after) FLAG('f', fork_ctm) FLAG('u', set_time) --- 63,69 ---- err_prog_name(argv[0]); ! OPTIONS("[-Dfuv] [-p piecedir] [-d deltadir] [-b basedir] [-B backup_dir] [-l log] [file ...]") FLAG('D', delete_after) FLAG('f', fork_ctm) FLAG('u', set_time) *************** *** 71,76 **** --- 72,78 ---- STRING('d', delta_dir) STRING('b', base_dir) STRING('l', log_file) + STRING('B', backup_dir) ENDOPTS if (delta_dir == NULL) *************** *** 198,206 **** if (stat(fname, &sb) < 0) break; ! sprintf(buf, "(cd %s && ctm %s%s%s%s) 2>&1", base_dir, set_time ? "-u " : "", ! apply_verbose ? "-v " : "", here, fname); if ((ctm = popen(buf, "r")) == NULL) { err("ctm failed to apply %s", delta); --- 200,211 ---- if (stat(fname, &sb) < 0) break; ! sprintf(buf, "(cd %s && ctm %s%s%s%s%s%s) 2>&1", base_dir, set_time ? "-u " : "", ! apply_verbose ? "-v " : "", ! (backup_dir == NULL) ? "" : "-B ", ! (backup_dir == NULL) ? "" : backup_dir, ! here, fname); if ((ctm = popen(buf, "r")) == NULL) { err("ctm failed to apply %s", delta); *** old/src/usr.sbin/ctm/ctm_rmail/ctm_rmail.1 Fri Sep 27 19:11:06 1996 --- new/src/usr.sbin/ctm/ctm_rmail/ctm_rmail.1 Sat Aug 31 11:49:56 1996 *************** *** 26,32 **** .Op Fl p Ar piecedir .Op Fl d Ar deltadir .Op Fl b Ar basedir - .Op Fl B Ar backup_dir .Op Ar .Sh DESCRIPTION In conjuction with the --- 26,31 ---- *************** *** 119,128 **** (or if .Li .ctm_status does not exist). - .It Fl B Ar backup_dir - Specify a backup directory for use by - .Nm ctm - .Fl B .It Fl D Delete deltas after successful application by .Xr ctm . --- 118,123 ---- ------------- Maybe someone will want to test the patch or commit it later ? Julian -- Julian H. Stacey jhs@freebsd.org http://www.freebsd.org/~jhs/