mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-05 20:42:26 +00:00
commented out debug lines.
This commit is contained in:
parent
9efd875716
commit
ebf6bd387d
3 changed files with 51 additions and 6 deletions
|
|
@ -420,53 +420,79 @@ BEGIN
|
|||
b := FALSE;
|
||||
jsonstr := NIL;
|
||||
|
||||
(*
|
||||
Out.String("DEBUG: Reading file: "); Out.String(filename); Out.Ln;
|
||||
|
||||
*)
|
||||
|
||||
(* Read from specified file instead of package tree *)
|
||||
vpkStorage.fileToString(filename, jsonstr);
|
||||
|
||||
IF jsonstr # NIL THEN
|
||||
(*
|
||||
Out.String("DEBUG: JSON string loaded, length: "); Out.Int(LEN(jsonstr^), 0); Out.Ln;
|
||||
*)
|
||||
NEW(errstr, ErrmessSize);
|
||||
b := Json.Parse(tree, jsonstr^, errstr^);
|
||||
IF b THEN
|
||||
(*
|
||||
Out.String("DEBUG: JSON parsed successfully"); Out.Ln;
|
||||
*)
|
||||
IF tree IS Json.Obj THEN
|
||||
(*
|
||||
Out.String("DEBUG: Root is object"); Out.Ln;
|
||||
*)
|
||||
rootObj := tree(Json.Obj);
|
||||
NEW(bl, Strings.Length(vpkSettings.bldType) + 1);
|
||||
COPY(vpkSettings.bldType, bl^);
|
||||
(*
|
||||
Out.String("DEBUG: Looking for build key: "); Out.String(bl^); Out.Ln;
|
||||
*)
|
||||
IF Json.ObjSelect(buildValue, rootObj, bl) THEN
|
||||
(*
|
||||
Out.String("DEBUG: Found Build section"); Out.Ln;
|
||||
*)
|
||||
IF buildValue IS Json.Arr THEN
|
||||
(*
|
||||
Out.String("DEBUG: Build section is array"); Out.Ln;
|
||||
*)
|
||||
buildArray := buildValue(Json.Arr);
|
||||
WHILE buildArray # NIL DO
|
||||
(*
|
||||
Out.String("DEBUG: Processing build array element"); Out.Ln;
|
||||
*)
|
||||
IF buildArray.value IS Json.Obj THEN
|
||||
(*
|
||||
Out.String("DEBUG: Build array element is object"); Out.Ln;
|
||||
*)
|
||||
buildStep := buildArray.value(Json.Obj);
|
||||
NEW(cm, Strings.Length(vpkSettings.bldCommand) + 1);
|
||||
NEW(fl, Strings.Length(vpkSettings.bldFile) + 1);
|
||||
COPY(vpkSettings.bldCommand, cm^);
|
||||
COPY(vpkSettings.bldFile, fl^);
|
||||
(*
|
||||
Out.String("DEBUG: Looking for command key: "); Out.String(cm^); Out.Ln;
|
||||
Out.String("DEBUG: Looking for file key: "); Out.String(fl^); Out.Ln;
|
||||
*)
|
||||
|
||||
(* Simple approach - just try to get command and file directly *)
|
||||
IF Json.ObjSelect(command, buildStep, cm) & Json.ObjSelect(file, buildStep, fl) THEN
|
||||
(*
|
||||
Out.String("DEBUG: Found both command and file keys"); Out.Ln;
|
||||
*)
|
||||
IF (command IS Json.Str) & (file IS Json.Str) THEN
|
||||
(*
|
||||
Out.String("DEBUG: Both are strings"); Out.Ln;
|
||||
*)
|
||||
IF k = NIL THEN k := StringList.Create() END;
|
||||
IF v = NIL THEN v := StringList.Create() END;
|
||||
k.AppendString(k, command(Json.Str).str^);
|
||||
v.AppendString(v, file(Json.Str).str^);
|
||||
Out.String("Found build step: "); Out.String(command(Json.Str).str^);
|
||||
Out.String("Found build step: "); Out.String(command(Json.Str).str^);
|
||||
Out.String(" "); Out.String(file(Json.Str).str^); Out.Ln;
|
||||
ELSE
|
||||
(*
|
||||
Out.String("DEBUG: command and file must be strings"); Out.Ln;
|
||||
*)
|
||||
END;
|
||||
ELSE
|
||||
Out.String("DEBUG: Failed to select 'command' or 'file' from build step"); Out.Ln;
|
||||
|
|
|
|||
|
|
@ -27,10 +27,14 @@ PROCEDURE fetch*(VAR dep: vpkdepTree.Tdep; dst: ARRAY OF CHAR);
|
|||
VAR repoPath: ARRAY 256 OF CHAR;
|
||||
workingDst: ARRAY 512 OF CHAR; (* Local copy to modify *)
|
||||
BEGIN
|
||||
(*
|
||||
Out.String("*** SYNCER: Starting fetch process..."); Out.Ln;
|
||||
Out.String("*** SYNCER: Input destination: '"); Out.String(dst); Out.String("'"); Out.Ln;
|
||||
*)
|
||||
COPY(dst, workingDst); (* Make a local copy to modify *)
|
||||
(*
|
||||
Out.String("*** SYNCER: Working destination: '"); Out.String(workingDst); Out.String("'"); Out.Ln;
|
||||
*)
|
||||
|
||||
IF dep = NIL THEN
|
||||
Out.String("Dependency is NIL"); Out.Ln;
|
||||
|
|
@ -41,17 +45,21 @@ BEGIN
|
|||
HALT(5);
|
||||
ELSE
|
||||
IF dep^.rmt IS vpkdepTree.RemoteGit THEN
|
||||
(*
|
||||
Out.String("*** SYNCER: Remote type is Git"); Out.Ln;
|
||||
Out.String("*** SYNCER: Package name is: '"); Out.String(dep^.name^); Out.String("'"); Out.Ln;
|
||||
Out.String("*** SYNCER: Remote URI is: '"); Out.String(dep^.rmt^.URI); Out.String("'"); Out.Ln;
|
||||
*)
|
||||
|
||||
vpkTools.extractRepoPathFromUrl(dep^.rmt^.URI, repoPath);
|
||||
(*
|
||||
Out.String("*** SYNCER: Extracted repo path: '"); Out.String(repoPath); Out.String("'"); Out.Ln;
|
||||
|
||||
Out.String("*** SYNCER: About to call mkPkgDirPath with:"); Out.Ln;
|
||||
Out.String("*** repoPath = '"); Out.String(repoPath); Out.String("'"); Out.Ln;
|
||||
Out.String("*** name = '"); Out.String(dep^.name^); Out.String("'"); Out.Ln;
|
||||
Out.String("*** workingDst = '"); Out.String(workingDst); Out.String("'"); Out.Ln;
|
||||
*)
|
||||
|
||||
(* Build the proper destination path *)
|
||||
IF Strings.Length(workingDst) = 0 THEN
|
||||
|
|
@ -60,8 +68,10 @@ BEGIN
|
|||
vpkEnv.mkPkgDirPath(repoPath, dep^.name^, workingDst);
|
||||
END;
|
||||
|
||||
(*
|
||||
Out.String("*** SYNCER: After mkPkgDirPath, workingDst = '"); Out.String(workingDst); Out.String("'"); Out.Ln;
|
||||
Out.String("*** SYNCER: About to call git with destination: '"); Out.String(workingDst); Out.String("'"); Out.Ln;
|
||||
*)
|
||||
|
||||
vpkGit.fetchRepo(dep^.rmt^.URI, workingDst, dep^.rmt(vpkdepTree.RemoteGit).branch);
|
||||
ELSIF dep^.rmt IS vpkdepTree.RemoteHttps THEN
|
||||
|
|
@ -76,7 +86,7 @@ BEGIN
|
|||
Out.Ln;
|
||||
END;
|
||||
END;
|
||||
Out.String("*** SYNCER: Fetch process completed."); Out.Ln;
|
||||
Out.String(Fetch process completed."); Out.Ln;
|
||||
END fetch;
|
||||
|
||||
END vpkSyncer.
|
||||
|
|
|
|||
|
|
@ -87,8 +87,9 @@ VAR
|
|||
start, i, j: INTEGER;
|
||||
found: BOOLEAN;
|
||||
BEGIN
|
||||
(*
|
||||
Out.String("@@@ extractRepoPathFromUrl input: '"); Out.String(url); Out.String("'"); Out.Ln;
|
||||
|
||||
*)
|
||||
start := 0;
|
||||
found := FALSE;
|
||||
repoPath[0] := 0X; (* Initialize to empty string *)
|
||||
|
|
@ -102,13 +103,15 @@ BEGIN
|
|||
INC(start);
|
||||
END;
|
||||
END;
|
||||
|
||||
(*
|
||||
Out.String("@@@ After skipping protocol, start="); Out.Int(start, 0); Out.Ln;
|
||||
|
||||
*)
|
||||
IF ~found THEN
|
||||
(* No protocol found, assume the whole URL is the path *)
|
||||
COPY(url, repoPath);
|
||||
(*
|
||||
Out.String("@@@ No protocol found, using whole URL: '"); Out.String(repoPath); Out.String("'"); Out.Ln;
|
||||
*)
|
||||
RETURN;
|
||||
END;
|
||||
|
||||
|
|
@ -118,12 +121,16 @@ BEGIN
|
|||
INC(i);
|
||||
END;
|
||||
|
||||
(*
|
||||
Out.String("@@@ End of URL at position: "); Out.Int(i, 0); Out.Ln;
|
||||
*)
|
||||
|
||||
(* Remove .git suffix if present *)
|
||||
IF (i >= 4) & (url[i-4] = '.') & (url[i-3] = 'g') & (url[i-2] = 'i') & (url[i-1] = 't') THEN
|
||||
i := i - 4;
|
||||
(*
|
||||
Out.String("@@@ Removed .git suffix, new end: "); Out.Int(i, 0); Out.Ln;
|
||||
*)
|
||||
END;
|
||||
|
||||
(* Copy domain + path *)
|
||||
|
|
@ -134,7 +141,9 @@ BEGIN
|
|||
END;
|
||||
repoPath[j] := 0X;
|
||||
|
||||
(*
|
||||
Out.String("@@@ extractRepoPathFromUrl output: '"); Out.String(repoPath); Out.String("'"); Out.Ln;
|
||||
*)
|
||||
END extractRepoPathFromUrl;
|
||||
|
||||
END vpkTools.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue