2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
|
** the project are imported into a different Fossil project, the manifest
** file will not be interpreted as a control artifact in that other project.
**
** Normally it is sufficient to simply append the extra line of text.
** However, if the manifest is PGP signed then the extra line has to be
** inserted before the PGP signature (thus invalidating the signature).
*/
void sterilize_manifest(Blob *p){
char *z, *zOrig;
int n, nOrig;
static const char zExtraLine[] =
"# Remove this line to create a well-formed manifest.\n";
z = zOrig = blob_materialize(p);
n = nOrig = blob_size(p);
remove_pgp_signature((const char **)&z, &n);
if( z==zOrig ){
blob_append(p, zExtraLine, -1);
}else{
int iEnd;
Blob copy;
memcpy(©, p, sizeof(copy));
blob_init(p, 0, 0);
iEnd = (int)(&z[n] - zOrig);
blob_append(p, zOrig, iEnd);
blob_append(p, zExtraLine, -1);
blob_append(p, &zOrig[iEnd], -1);
blob_zero(©);
}
}
/*
** This is the comparison function used to sort the tag array.
|
|
|
>
|
|
|
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
|
** the project are imported into a different Fossil project, the manifest
** file will not be interpreted as a control artifact in that other project.
**
** Normally it is sufficient to simply append the extra line of text.
** However, if the manifest is PGP signed then the extra line has to be
** inserted before the PGP signature (thus invalidating the signature).
*/
void sterilize_manifest(Blob *p, int eType){
char *z, *zOrig;
int n, nOrig;
static const char zExtraLine[] =
"# Remove this line to create a well-formed Fossil %s.\n";
const char *zType = eType==CFTYPE_MANIFEST ? "manifest" : "control artifact";
z = zOrig = blob_materialize(p);
n = nOrig = blob_size(p);
remove_pgp_signature((const char **)&z, &n);
if( z==zOrig ){
blob_appendf(p, zExtraLine/*works-like:"%s"*/, zType);
}else{
int iEnd;
Blob copy;
memcpy(©, p, sizeof(copy));
blob_init(p, 0, 0);
iEnd = (int)(&z[n] - zOrig);
blob_append(p, zOrig, iEnd);
blob_appendf(p, zExtraLine/*works-like:"%s"*/, zType);
blob_append(p, &zOrig[iEnd], -1);
blob_zero(©);
}
}
/*
** This is the comparison function used to sort the tag array.
|