* that the composition file is already in MIME format
* and will not be processed further. Otherwise, an
* error is generated.
+ * dist - A flag to indicate if we are being run by "dist". In
+ * that case, add no MIME headers to the message. Existing
+ * headers will still be encoded by RFC 2047.
* directives - A flag to control whether or not build directives are
* processed by default.
* encoding - The default encoding to use when doing RFC 2047 header
* -auto flag is set and a MIME-Version header is encountered, the return
* value is NULL.
*/
-CT build_mime (char *infile, int autobuild, int directives, int encoding);
+CT build_mime (char *infile, int autobuild, int dist, int directives,
+ int encoding);
int add_header (CT, char *, char *);
int get_ctinfo (char *, CT, int);
X("version", 0, VERSIONSW) \
X("help", 0, HELPSW) \
X("debug", -5, DEBUGSW) \
+ X("dist", -4, DISTSW) \
#define X(sw, minchars, id) id,
DEFINE_SWITCH_ENUM(MHBUILD);
int
main (int argc, char **argv)
{
- int sizesw = 1, headsw = 1, directives = 1, autobuild = 0;
+ int sizesw = 1, headsw = 1, directives = 1, autobuild = 0, dist = 0;
int *icachesw;
char *cp, buf[BUFSIZ];
char buffer[BUFSIZ], *compfile = NULL;
case DEBUGSW:
debugsw = 1;
continue;
+ case DISTSW:
+ dist = 1;
+ continue;
}
}
if (compfile)
unlink_infile = 1;
/* build the content structures for MIME message */
- ct = build_mime (infile, autobuild, directives, header_encoding);
+ ct = build_mime (infile, autobuild, dist, directives, header_encoding);
/*
* If ct == NULL, that means that -auto was set and a MIME version
*/
/* build the content structures for MIME message */
- ct = build_mime (compfile, autobuild, directives, header_encoding);
+ ct = build_mime (compfile, autobuild, dist, directives, header_encoding);
/*
* If ct == NULL, that means -auto was set and we found a MIME version
*/
CT
-build_mime (char *infile, int autobuild, int directives, int header_encoding)
+build_mime (char *infile, int autobuild, int dist, int directives,
+ int header_encoding)
{
int compnum, state;
char buf[BUFSIZ], name[NAMESZ];
* Now add the MIME-Version header field
* to the list of header fields.
*/
- np = add (VRSN_FIELD, NULL);
- vp = concat (" ", VRSN_VALUE, "\n", NULL);
- add_header (ct, np, vp);
+
+ if (! dist) {
+ np = add (VRSN_FIELD, NULL);
+ vp = concat (" ", VRSN_VALUE, "\n", NULL);
+ add_header (ct, np, vp);
+ }
/*
* We initally assume we will find multiple contents in the
}
/* Build the rest of the header field structures */
- build_headers (ct);
+ if (! dist)
+ build_headers (ct);
return ct;
}
case OK:
buildvec = argsplit(buildmimeproc, &buildprogram, &i);
buildvec[i++] = "-auto";
+ if (distfile)
+ buildvec[i++] = "-dist";
buildvec[i++] = drft;
buildvec[i] = NULL;
execvp(buildprogram, buildvec);