summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctm/ctm_rmail
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-04-29 21:02:42 +0000
committerphk <phk@FreeBSD.org>1996-04-29 21:02:42 +0000
commit4c9fab8cf79cd02d9f736ca6420d778c2f7de75a (patch)
treed469de1e9a5ad8ce95cdfbbbb3bb6170a71dbd7f /usr.sbin/ctm/ctm_rmail
parent5c83d66490e402205b37a5615569e025c3be1d6d (diff)
downloadFreeBSD-src-4c9fab8cf79cd02d9f736ca6420d778c2f7de75a.zip
FreeBSD-src-4c9fab8cf79cd02d9f736ca6420d778c2f7de75a.tar.gz
Support for "-u" which sets the timestamp from the delta on the file.
Intended for sup mirrors etc. Not well tested yet. Reviewed by: phk Submitted by: Giles Lean <giles@nemeton.com.au> Submitted by: John Hay <jhay@mikom.csir.co.za>
Diffstat (limited to 'usr.sbin/ctm/ctm_rmail')
-rw-r--r--usr.sbin/ctm/ctm_rmail/ctm_rmail.19
-rw-r--r--usr.sbin/ctm/ctm_rmail/ctm_rmail.c7
2 files changed, 13 insertions, 3 deletions
diff --git a/usr.sbin/ctm/ctm_rmail/ctm_rmail.1 b/usr.sbin/ctm/ctm_rmail/ctm_rmail.1
index 735e7dd..42a5102 100644
--- a/usr.sbin/ctm/ctm_rmail/ctm_rmail.1
+++ b/usr.sbin/ctm/ctm_rmail/ctm_rmail.1
@@ -21,7 +21,7 @@ deltas via mail
.Ar ctm-delta
.Ar mail-alias
.Nm ctm_rmail
-.Op Fl Dfv
+.Op Fl Dfuv
.Op Fl l Ar log
.Op Fl p Ar piecedir
.Op Fl d Ar deltadir
@@ -148,6 +148,13 @@ Don't worry about zillions of background
processes loading your machine, since locking is used to prevent more than one
.Xr ctm
invocation at a time.
+.It Fl u
+Pass the
+.Fl u
+flag to the
+.Xr ctm
+command when applying the complete deltas, causing it to set the modification
+time of created and modified files to the CTM delta creation time.
.It Fl v
Pass the
.Fl v
diff --git a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
index bbb1cea..6b01922 100644
--- a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
+++ b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
@@ -30,6 +30,7 @@ char *delta_dir = NULL; /* Where to store completed deltas. */
char *base_dir = NULL; /* The tree to apply deltas to. */
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. */
void apply_complete(void);
int read_piece(char *input_file);
@@ -61,9 +62,10 @@ main(int argc, char **argv)
err_prog_name(argv[0]);
- OPTIONS("[-Df] [-p piecedir] [-d deltadir] [-b basedir] [-l log] [file ...]")
+ OPTIONS("[-Dfuv] [-p piecedir] [-d deltadir] [-b basedir] [-l log] [file ...]")
FLAG('D', delete_after)
FLAG('f', fork_ctm)
+ FLAG('u', set_time)
FLAG('v', apply_verbose)
STRING('p', piece_dir)
STRING('d', delta_dir)
@@ -196,7 +198,8 @@ apply_complete()
if (stat(fname, &sb) < 0)
break;
- sprintf(buf, "(cd %s && ctm %s%s%s) 2>&1", base_dir,
+ 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)
{
OpenPOWER on IntegriCloud