Hello, again. I would like to know is there a way to see if this proposal rejected or something? Is this a write ML to propose with patch?
And yes I saw <ddevie...@gmail.com> suggested to use checksums, but this means we read all the files in a source directory, that is huge. This is a reason for relying on timestamps. If some os does not update its files timestumps why we suffer. On Thu, 21 Mar 2019, 10:31 Захар Малиновский, <zakhar.malinovs...@gmail.com> wrote: > Yes, timestamps only. > Sqlar does not has a column for checksum or sha. > > Here comes the patch: > > Index: src/shell.c.in > > ================================================================== > > --- src/shell.c.in > > +++ src/shell.c.in > > @@ -5820,10 +5820,30 @@ > > " mtime,\n" > > " data\n" > > " FROM fsdir(%Q,%Q)\n" > > " WHERE lsmode(mode) NOT LIKE '?%%';" > > }; > > + > > + // updates only newer files > > + const char * zInsertFmtNewer = > > + "REPLACE INTO %s(name,mode,mtime,sz,data)\n" > > + " SELECT\n" > > + " %s,\n" > > + " fs.mode,\n" > > + " fs.mtime,\n" > > + " CASE substr(lsmode(fs.mode),1,1)\n" > > + " WHEN '-' THEN length(fs.data)\n" > > + " WHEN 'd' THEN 0\n" > > + " ELSE -1 END,\n" > > + " sqlar_compress(fs.data)\n" > > + " FROM fsdir(%Q,%Q) as fs\n" > > + " left join sqlar on sqlar.name = fs.name \n" > > + " WHERE lsmode(fs.mode) NOT LIKE '?%%' \n" > > + " and (fs.mtime > sqlar.mtime or sqlar.name isnull) \n" > > + " ;\n"; > > + > > + > > int i; /* For iterating through azFile[] */ > > int rc; /* Return code */ > > const char *zTab = 0; /* SQL table into which to insert */ > > char *zSql; > > char zTemp[50]; > > @@ -5856,13 +5876,23 @@ > > if( rc!=SQLITE_OK ) goto end_ar_transaction; > > } > > rc = arExecSql(pAr, zCreate); > > } > > for(i=0; i<pAr->nArg && rc==SQLITE_OK; i++){ > > - char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab, > > - pAr->bVerbose ? "shell_putsnl(name)" : "name", > > + > > + char *zSql2; > > + if( bUpdate!=0 && !pAr->bZip) { > > + // updates only newer files > > + zSql2 = sqlite3_mprintf(zInsertFmtNewer, zTab, > > + pAr->bVerbose ? "shell_putsnl(fs.name)" : "fs.name", > > pAr->azArg[i], pAr->zDir); > > + } else { > > + zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab, > > + pAr->bVerbose ? "shell_putsnl(name)" : "name", > > + pAr->azArg[i], pAr->zDir); > > + > > + } > > rc = arExecSql(pAr, zSql2); > > sqlite3_free(zSql2); > > } > > end_ar_transaction: > > if( rc!=SQLITE_OK ){ > > > > On Wed, 20 Mar 2019, 18:18 Dominique Devienne, <ddevie...@gmail.com> > wrote: > >> On Wed, Mar 20, 2019 at 5:13 PM Захар Малиновский < >> zakhar.malinovs...@gmail.com> wrote: >> >> > Here I include patch file with the changes: fossil diff --from trunk >> .\src\ >> > shell.c.in > patch-updateOnlyNewer.patch >> > (see patch file patch-updateOnlyNewer.patch) >> > >> >> Copy/paste it inline to your message. Attachments are stripped on this ML. >> --DD >> >> PS: based on timestamps only? Using a checksum (MD5, SHA1, SHA3, whatever) >> would be "safer", if a little slower. >> Of course, that assumes SQLar uses a checksum. I don't recall, I thought >> not. >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@mailinglists.sqlite.org >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >> > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users