From: drh <> Date: Thu, 11 Jun 2026 14:28:48 +0000 (+0000) Subject: Three-pass algorithm for the ".ar x" command in the CLI, so that symlinks X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d57abdb017b9f7e9b740f7dca25942db4632ecb0;p=thirdparty%2Fsqlite.git Three-pass algorithm for the ".ar x" command in the CLI, so that symlinks are created after all regular files are created. FossilOrigin-Name: 37a80d20fe1948db15ac72432ed7bf3d573c80807fe0a58c58440647e3c34ab8 --- diff --git a/manifest b/manifest index 5df250a818..55e79123ab 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s(undocumented)\s--debug\soption\sto\sthe\s".ar"\scommand\sin\sthe\sCLI -D 2026-06-11T14:14:37.249 +C Three-pass\salgorithm\sfor\sthe\s".ar\sx"\scommand\sin\sthe\sCLI,\sso\sthat\ssymlinks\nare\screated\safter\sall\sregular\sfiles\sare\screated. +D 2026-06-11T14:28:48.700 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -739,7 +739,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c d0724113da9f5c0430d2052808ce59519f51ae7c4fbb1f5ef21fe3a832956086 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 5c3a5e3c1e6c3f8ccabeb414e18dce64e6f3e797de225ee93034f2c9e76f289c -F src/shell.c.in 20bdae8e587db01ecc02b99f7af5339db5de3fccf1f4ca325695604f22a0ff9f +F src/shell.c.in ce875e841ad3f240d3b0ccb492e8c849552e7273a92cbe936eb8f22014448666 F src/sqlite.h.in 749454ec71c875bc130d399ff9a7e47191d143d1b9d8b4af3839b6028df9eda9 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479 F src/sqlite3ext.h 9788c301f95370fa30e808861f1d2e6f022a816ddbe2a4f67486784c1b31db2e @@ -2209,8 +2209,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P e01a185a699d0c4ad2341ce2114bc826f02768735cef67179a1127229a073d03 -R d2a6bbd4c0f8b7bc9e21299e9449c104 +P 3a040ffc47fa3e38b36716587c56d9b071d9c69d9daaa9cf0ef6baa654419ab5 +R f25542232c944cff5bd84dfd8cb028e6 U drh -Z c9bb4b4e063916ece8127fa255c743ff +Z 3ff2a55612509f55590dac3ec3f890b6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7ebdc9afdb..59d6e82ebc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3a040ffc47fa3e38b36716587c56d9b071d9c69d9daaa9cf0ef6baa654419ab5 +37a80d20fe1948db15ac72432ed7bf3d573c80807fe0a58c58440647e3c34ab8 diff --git a/src/shell.c.in b/src/shell.c.in index c700943dcf..a3c13e8b19 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -7348,7 +7348,9 @@ static int arExtractCommand(ArCommand *pAr){ " END\n" " FROM dest CROSS JOIN %s\n" " WHERE (%s)\n" - " AND (data IS NULL OR $pass==0)\n" /* Dirs both passes */ + " AND (CASE $pass WHEN 0 THEN (mode&0xf000)<>0xa000\n" + " WHEN 1 THEN (mode&0xf000)=0xa000\n" + " ELSE data IS NULL END)\n" " AND dpath=substr(realpath($dir||name),1,dlen)\n" /* No escapes */ " AND name NOT GLOB '*..[/\\]*'\n"; /* No /../ in paths */ @@ -7389,12 +7391,13 @@ static int arExtractCommand(ArCommand *pAr){ sqlite3_bind_int(pSql, j, pAr->bDryRun); /* Run the SELECT statement twice - ** (0) writefile() all files and directories - ** (1) writefile() for directory again - ** The second pass is so that the timestamps for extracted directories + ** (0) writefile() files and directories + ** (1) writefile() symlinks + ** (2) writefile() for directory again + ** The third pass is so that the timestamps for extracted directories ** will be reset to the value in the archive, since populating them ** in the first pass will have changed the timestamp. */ - for(i=0; i<2; i++){ + for(i=0; i<3; i++){ if( pAr->bDryRun>=2 ){ cli_printf(pAr->out, "*** BEGIN PASS %d ***\n", i+1); }