-C Enhance\sLemon\sso\sthat\sit\sremembers\swhich\s-D\scommand-line\soptions\sare\sactually\nused\sin\sthe\sgrammar\sand\sincludes\sa\slist\sof\sall\ssuch\soptions\sin\sthe\sheader\nof\sthe\sgenerated\soutput\sfile.
-D 2023-06-08T12:52:28.968
+C Include\ssource\sprovenance\sin\sthe\sheader\scomment\sof\sthe\samalgamation.
+D 2023-06-08T15:27:35.001
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
-F Makefile.in bb4554cd186313a89f2e774698faa718350b3fc914386845c5ddb39710181cff
+F Makefile.in 4b75bbccdbdd1d4953f67f93ec7fd6dbc31d0f5eeab432ad0dc56d70b8aff0d5
F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241
-F Makefile.msc 9c032cabd86fc0468167459b714478be7fe77e47ce43fdf1bfaf2e48e829a112
+F Makefile.msc 82b56254cedf800b3388ce54b4b271ae1a47f5a9332866b25e21689049eb3c09
F README.md 6f942c2e542d53202dc75b114b0617e9e02f8a6a777508fc23c3d8297951c478
F VERSION c6366dc72582d3144ce87b013cc35fe48d62f6d07d5be0c9716ea33c862144aa
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
-F main.mk 14bdf404d42ffee34b637369afd305c8dbc283cab233ca5d27bb104024d7f5b7
+F main.mk 2504d5451f9202094b840cdbf3d4e4019e1d6cc32d91acd57f3bc27f4cf67104
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
-F tool/mksqlite3c.tcl eb47021591b1ad4a6862e2cb5625f1ac67ec1e0c6db5ba3953c069c635284cf5
+F tool/mksqlite3c.tcl dc14cedec7b83425afbfe1954e7fbfb3b56ed7cec92feaa5151042539273286e
F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
F tool/mkvsix.tcl b9e0777a213c23156b6542842c238479e496ebf5
F tool/sqlite3_analyzer.c.in f88615bf33098945e0a42f17733f472083d150b58bdaaa5555a7129d0a51621c
F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
-F tool/src-verify.c cf3aa5a7dcfae4680b011d9fbc3eafa558367f7e1ad19532684b887aa553a324
+F tool/src-verify.c b7b26f1ae4acbf20d1fd8d013dc621d52cda310b1432a39c3b5f34fca42806a7
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
F tool/stripccomments.c 20b8aabc4694d0d4af5566e42da1f1a03aff057689370326e9269a9ddcffdc37
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 5332abf0ad8ef42c44e9dd7045d017bb8fc9a0262a89ababa3e2c41788a6cdb8
-R 8901e2725cbc66d820e7686f035bb3c9
+P c47a4dbd24b8277c57b7a83a8c0aeac2bc8f6ab75d1b65ba5e1fa83d1868d95f
+R 674e703d30474530d75ea6adb4bbb3a6
U drh
-Z e939ccde6d44f5ae271532ac04101d42
+Z f0add852f7350241c63aa7cf96943aee
# Remove this line to create a well-formed Fossil manifest.
# Force the output to use unix line endings, even on Windows.
fconfigure $out -translation lf
set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
-puts $out [subst \
+puts $out \
{/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
** version $VERSION. By combining all the individual C code files into this
** if you want a wrapper to interface SQLite with your choice of programming
** language. The code for the "sqlite3" command-line shell is also in a
** separate file. This file contains only code for the core SQLite library.
-*/
+**}
+set srcroot [file dirname [file dirname [info script]]]
+if {$tcl_platform(platform)=="windows"} {
+ set vsrcprog src-verify.exe
+} else {
+ set vsrcprog ./src-verify
+}
+if {[file executable $vsrcprog] && [file readable $srcroot/manifest]} {
+ set res [string trim [split [exec $vsrcprog -x $srcroot]] \n]
+ puts $out "** The content in this amalgamation comes from Fossil check-in"
+ puts -nonewline $out "** [string range [lindex $res 0] 1 35]"
+ if {[llength $res]==1} {
+ puts "."
+ } else {
+ puts $out " with changes in files:\n**"
+ foreach f [lrange $res 1 end] {
+ puts $out "** $f"
+ }
+ }
+} else {
+ puts $out "** The origin of the sources used to build this amalgamation"
+ puts $out "** is unknown."
+}
+puts $out [subst {*/
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1}]
if {$addstatic} {
**
** USAGE:
**
-** src-verify $(ROOT)
+** src-verify [-x] [-v] $(ROOT)
**
** Where ROOT is the root of the source tree - the directory that contains
** the "manifest" and "manifest.uuid" files. Add the "-v" option for
-** some debugging output. Additional debugging options:
+** some debugging output. With the -x option, the output is in a format
+** that is intended to be read by a script rather by a human. The -x output
+** format always has the SHA3 hash of the source check-in on the first line
+** and lists files that have changed on subsequent lines.
+**
+** Additional debugging options:
**
** src-verify --sha1 FILE ...
** src-verify --sha3 FILE ...
printf(" %s\n", zFile);
(*pnErr)++;
}
+static void errorMsgNH(int *pnErr, const char *zVers, const char *zFile){
+ if( *pnErr==0 ){
+ printf("%s\n", zVers);
+ }
+ printf("%s\n", zFile);
+ (*pnErr)++;
+}
int main(int argc, char **argv){
int i, j;
int nDir;
FILE *in;
int bDebug = 0;
+ int bNonHuman = 0;
int nErr = 0;
SHA3Context ctx3;
- const char *zDir;
+ const char *zDir = 0;
+ void (*xErr)(int*,const char*,const char*);
char zHash[100];
char zCk[100];
char zVers[100];
char zLine[40000];
char zFile[40000];
- if( argc>=3 && strcmp(argv[1],"--sha1")==0 ){
- /* For testing purposes, if the first argument is --sha1, then simply
- ** compute and print the SHA1 checksum of all subsequent arguments. */
- for(i=2; i<argc; i++){
- sha1sum_file(argv[i], zHash);
- printf("%s %s\n", zHash, argv[i]);
+ xErr = errorMsg;
+ for(i=1; i<argc; i++){
+ const char *z = argv[i];
+ if( z[0]!='-' ){
+ if( zDir!=0 ){
+ fprintf(stderr, "bad argument: %s\n", z);
+ return 1;
+ }
+ zDir = z;
+ continue;
}
- return 0;
- }
- if( argc>=3 && strcmp(argv[1], "--sha3")==0 ){
- /* For testing purposes, if the first argument is --sha3, then simply
- ** compute and print the SHA3-256 checksum of all subsequent arguments. */
- for(i=2; i<argc; i++){
- sha3sum_file(argv[i], zHash);
- printf("%s %s\n", zHash, argv[i]);
+ if( z[1]=='-' && z[2]!=0 ) z++;
+ if( strcmp(argv[1],"-sha1")==0 ){
+ /* For testing purposes, if the first argument is --sha1, then simply
+ ** compute and print the SHA1 checksum of all subsequent arguments. */
+ for(i++; i<argc; i++){
+ sha1sum_file(argv[i], zHash);
+ printf("%s %s\n", zHash, argv[i]);
+ }
+ return 0;
+ }
+ if( strcmp(argv[1], "-sha3")==0 ){
+ /* For testing purposes, if the first argument is --sha3, then simply
+ ** compute and print the SHA3-256 checksum of all subsequent arguments. */
+ for(i++; i<argc; i++){
+ sha3sum_file(argv[i], zHash);
+ printf("%s %s\n", zHash, argv[i]);
+ }
+ return 0;
+ }
+ if( strcmp(z,"-v")==0 ){
+ bDebug = 1;
+ continue;
+ }
+ if( strcmp(z,"-x")==0 ){
+ bNonHuman = 1;
+ xErr = errorMsgNH;
+ continue;
}
- return 0;
- }
- if( argc==3 && strcmp(argv[0], "-v")==0 ){
- bDebug = 1;
- zDir = argv[2];
- argc = 2;
- }else{
- zDir = argv[1];
- }
- if( argc!=2 ){
fprintf(stderr, "Usage: %s DIRECTORY\n"
" or: %s --sha1 FILE ...\n"
" or: %s --sha3 FILE ...\n",
return 1;
}
if( strlen(zDir)>1000 ){
- fprintf(stderr, "First argument too big: [%s]\n", zDir);
+ fprintf(stderr, "Directory argument too big: [%s]\n", zDir);
return 1;
}
nDir = (int)strlen(zDir);
if( nDir<0 ){
- fprintf(stderr, "First argument too short.\n");
+ fprintf(stderr, "Directory argument too short.\n");
return 1;
}
memcpy(zFile, zDir, nDir);
zFile[sizeof(zFile)-1] = 0;
defossilize(&zFile[nDir]);
if( zLine[i]!=' ' ){
- errorMsg(&nErr, zVers, "manifest");
+ xErr(&nErr, zVers, "manifest");
return 1;
}
for(i++, j=0; zLine[i]>='0' && zLine[i]<='f'; i++, j++){
printf("%s %s\n", zFile, zHash);
}
if( access(zFile, R_OK)!=0 ){
- errorMsg(&nErr, zVers, &zFile[nDir]);
+ xErr(&nErr, zVers, &zFile[nDir]);
continue;
}
if( strlen(zHash)==40 ){
sha1sum_file(zFile, zCk);
if( strcmp(zHash, zCk)!=0 ){
- errorMsg(&nErr, zVers, &zFile[nDir]);
+ xErr(&nErr, zVers, &zFile[nDir]);
}
}else if( strlen(zHash)==64 ){
sha3sum_file(zFile, zCk);
if( strcmp(zHash, zCk)!=0 ){
- errorMsg(&nErr, zVers, &zFile[nDir]);
+ xErr(&nErr, zVers, &zFile[nDir]);
}
}else{
- errorMsg(&nErr, zVers, "manifest");
+ xErr(&nErr, zVers, "manifest");
return 1;
}
}
|| zLine[64]!='\n'
|| memcmp(zLine, zVers, 64)!=0
){
- errorMsg(&nErr, zVers, &zFile[nDir]);
+ xErr(&nErr, zVers, &zFile[nDir]);
}
if( in ) fclose(in);
- if( nErr ) return nErr;
- printf("OK %.25s\n", zVers);
+ if( bNonHuman ){
+ if( nErr ) return 0;
+ printf("%s\n", zVers);
+ }else{
+ if( nErr ) return nErr;
+ printf("OK %.25s\n", zVers);
+ }
return 0;
}