From 57c4a63d06a0dbfed80fdbda5aeea84c47931cff Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Mon, 3 Aug 2026 08:56:00 +0300 Subject: [PATCH] vfp_symbols.ps1: reconstruire la schimbarea radacinii; default-uri pe fluxul in-tree Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01A5okKjUKMM5Xk1egq2w81P --- vfp_symbols.ps1 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/vfp_symbols.ps1 b/vfp_symbols.ps1 index 2da9f5c..b05c525 100644 --- a/vfp_symbols.ps1 +++ b/vfp_symbols.ps1 @@ -50,7 +50,8 @@ param( [string]$Where, [string]$Find, [string]$Class, - [string]$CacheRoot = 'D:\ROA\_vfp_textcache\roacnpro', + # implicit: fluxul in-tree din ROAACNPRO (textul .vc2/.sc2 sta langa binare, nu intr-un cache) + [string]$CacheRoot = 'D:\ROA\ROAACNPRO', [string]$ProjectRoot = 'D:\ROA\ROAACNPRO', [string[]]$PrgDirs = @('Programe', 'COMUN\programe'), [string]$ExcludePrg = '\\programe\\roa\\', @@ -60,7 +61,11 @@ param( ) $ErrorActionPreference = 'Stop' -if (-not $IndexFile) { $IndexFile = Join-Path $CacheRoot '_symbols.tsv' } +if (-not $IndexFile) { + # la fluxul in-tree indexul nu se scrie in repo, ci in zona de cache comuna + $IndexFile = if ($CacheRoot -like 'D:\ROA\_vfp_textcache\*') { Join-Path $CacheRoot '_symbols.tsv' } + else { Join-Path ('D:\ROA\_vfp_textcache\' + (Split-Path $ProjectRoot -Leaf).ToLower()) '_symbols.tsv' } +} # Codepage-ul din antetul .vc2 nu e de incredere (vezi CLAUDE.md), dar aici se citesc doar # cuvinte-cheie si identificatori ASCII, iar fisierele nu sunt niciodata rescrise. @@ -184,6 +189,16 @@ function Build-Index { function Test-IndexStale { if (-not (Test-Path $IndexFile)) { return $true } + # acelasi -IndexFile poate veni dintr-o alta radacina (alt -CacheRoot): datele vechi nu par invechite + $head = Get-Content -LiteralPath $IndexFile -TotalCount 2 + if ($head.Count -ge 2) { + $cols = $head[1].Split("`t") + if ($cols.Count -gt 4) { + $src = $cols[4].Trim('"') + if (-not ($src.StartsWith($CacheRoot, 'OrdinalIgnoreCase') -or + $src.StartsWith($ProjectRoot, 'OrdinalIgnoreCase'))) { return $true } + } + } $idx = (Get-Item $IndexFile).LastWriteTime foreach ($f in (Get-SourceFiles)) { if ($f.LastWriteTime -gt $idx) { return $true } } $false