summaryrefslogtreecommitdiff
path: root/lang/nim/files/patch-tools_deps.nim
blob: ab6d46bf2e343bb18cb2aae6b0848d072e5f082d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- tools/deps.nim.orig	2025-02-06 01:49:40 UTC
+++ tools/deps.nim
@@ -20,28 +20,29 @@ proc cloneDependency*(destDirBase: string, url: string
 
 proc cloneDependency*(destDirBase: string, url: string, commit = commitHead,
                       appendRepoName = true, allowBundled = false) =
-  let destDirBase = destDirBase.absolutePath
-  let p = url.parseUri.path
-  let name = p.splitFile.name
-  var destDir = destDirBase
-  if appendRepoName: destDir = destDir / name
-  let quotedDestDir = destDir.quoteShell
-  if not dirExists(destDir):
+  #let destDirBase = destDirBase.absolutePath
+  #let p = url.parseUri.path
+  #let name = p.splitFile.name
+  #var destDir = destDirBase
+  #if appendRepoName: destDir = destDir / name
+  #let quotedDestDir = destDir.quoteShell
+  #if not dirExists(destDir):
     # note: old code used `destDir / .git` but that wouldn't prevent git clone
     # from failing
-    execRetry fmt"git clone -q {url} {quotedDestDir}"
-  if isGitRepo(destDir):
-    let oldDir = getCurrentDir()
-    setCurrentDir(destDir)
-    try:
-      execRetry "git fetch -q"
-      exec fmt"git checkout -q {commit}"
-    finally:
-      setCurrentDir(oldDir)
-  elif allowBundled:
-    discard "this dependency was bundled with Nim, don't do anything"
-  else:
-    quit "FAILURE: " & destdir & " already exists but is not a git repo"
+  #  execRetry fmt"git clone -q {url} {quotedDestDir}"
+  #if isGitRepo(destDir):
+  #  let oldDir = getCurrentDir()
+  #  setCurrentDir(destDir)
+  #  try:
+  #    execRetry "git fetch -q"
+  #    exec fmt"git checkout -q {commit}"
+  #  finally:
+  #    setCurrentDir(oldDir)
+  #elif allowBundled:
+  #  discard "this dependency was bundled with Nim, don't do anything"
+  #else:
+  #  quit "FAILURE: " & destdir & " already exists but is not a git repo"
+  quit "FAILURE: git operations now allowed!: " & destDirBase
 
 proc updateSubmodules*(dir: string, allowBundled = false) =
   if isGitRepo(dir):