/ Check-in [3c2e3c2d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the .archive command in the CLI so that it actually compresses content.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3c2e3c2d3dd5d951099ad8d9f74d3c20dae11dd5615d86a6e2283b28ff5b19aa
User & Date: drh 2018-03-09 22:18:53
Context
2018-03-10
12:34
Fix the zipfile extension so that it is able to create symbolic link entries in the ZIP file even on systems like Win32 that do not support symbolic links on the native filesystem. check-in: 2a4493f4 user: drh tags: trunk
2018-03-09
22:18
Fix the .archive command in the CLI so that it actually compresses content. check-in: 3c2e3c2d user: drh tags: trunk
21:54
Enhance the ".ar" command in the CLI so that it is able to update and create ZIP Archives. check-in: 9404765e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

  5274   5274        "    %s,\n"
  5275   5275        "    mode,\n"
  5276   5276        "    mtime,\n"
  5277   5277        "    CASE substr(lsmode(mode),1,1)\n"
  5278   5278        "      WHEN '-' THEN length(data)\n"
  5279   5279        "      WHEN 'd' THEN 0\n"
  5280   5280        "      ELSE -1 END,\n"
  5281         -     "    data\n"
         5281  +     "    sqlar_compress(data)\n"
  5282   5282        "  FROM fsdir(%Q,%Q)\n"
  5283   5283        "  WHERE lsmode(mode) NOT LIKE '?%%';",
  5284   5284        "REPLACE INTO %s(name,mode,mtime,data)\n"
  5285   5285        "  SELECT\n"
  5286   5286        "    %s,\n"
  5287   5287        "    mode,\n"
  5288   5288        "    mtime,\n"
................................................................................
  5394   5394         if( rc!=SQLITE_OK ){
  5395   5395           utf8_printf(stderr, "cannot open file: %s (%s)\n", 
  5396   5396               cmd.zFile, sqlite3_errmsg(cmd.db)
  5397   5397           );
  5398   5398           goto end_ar_command;
  5399   5399         }
  5400   5400         sqlite3_fileio_init(cmd.db, 0, 0);
  5401         -#ifdef SQLITE_HAVE_ZLIB
  5402   5401         sqlite3_sqlar_init(cmd.db, 0, 0);
  5403         -#endif
  5404   5402         sqlite3_create_function(cmd.db, "shell_putsnl", 1, SQLITE_UTF8, cmd.p,
  5405   5403                                 shellPutsFunc, 0, 0);
  5406   5404   
  5407   5405       }
  5408   5406       if( cmd.zSrcTable==0 && cmd.bZip==0 ){
  5409   5407         if( cmd.eCmd!=AR_CMD_CREATE
  5410   5408          && sqlite3_table_column_metadata(cmd.db,0,"sqlar","name",0,0,0,0,0)