Commit a2512fd6 authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Use execCmdEx for all procs

parent 15b928df
......@@ -21,12 +21,15 @@ import .. / cores / configs
# TODO get both output and stderr
proc gbpClone*(gbpPath, gitUrl, packageName: string, stderr: var string): int =
proc gbpClone*(gbpPath, gitUrl, packageName, workDir: string, stderr: var string): int =
#[
Use command gbp clone to clone project with all branches
# TODO use git URL from setting instead of hard coded
]#
return execCmd(gbpPath & " clone " & gitUrl & packageName)
(stderr, result) = execCmdEx(
gbpPath & " clone " & gitUrl & packageName,
workingDir = workDir
)
proc gbpPull*(gpbPath, workDir: string, stderr: var string): int =
......@@ -34,27 +37,31 @@ proc gbpPull*(gpbPath, workDir: string, stderr: var string): int =
Run gbp pull to sync any changes to avoid conflict
It must be run before doing anything on project
]#
(stderr, result) = execCmdEx(gpbPath & " pull")
(stderr, result) = execCmdEx(gpbPath & " pull", workingDir = workDir)
proc gbpUpdate*(gbpPath: string, stderr: var string): int =
proc gbpUpdate*(gbpPath, workDir: string, stderr: var string): int =
#[
Update debian project with gbp + uscan
]#
(stderr, result) = execCmdEx(
gbpPath & " import-orig --no-interactive --pristine-tar --uscan"
gbpPath & " import-orig --no-interactive --pristine-tar --uscan",
workingDir = workDir
)
proc gbpTag*(gbpPath: string, stderr: var string): int =
proc gbpTag*(gbpPath, workDir: string, stderr: var string): int =
#[
Generate git tags for version change
Solved gbp:error: revision 'debian/1.3.0-parrot0^{commit}' not found
]#
(stderr, result) = execCmdEx(gbpPath & " tag")
(stderr, result) = execCmdEx(
gbpPath & " tag",
workingDir = workDir
)
proc gbpChange*(version: string): int =
proc gbpChange*(gbpPath, version, workDir: string, stderr: var string): int =
#[
Generate new Debian version using gbp dch
Distro name will be forced as rolling-testing (flag: --distribution=rolling-testing)
......@@ -63,15 +70,21 @@ proc gbpChange*(version: string): int =
Add flag -N <version> to solve the problem gbp:error: revision 'debian/1.3.0-parrot0^{commit}' not found
The version name should be added -parrot0 by default. The -parrot0 is hardcoded text as a new upstream release
]#
return execCmd("gbp dch --distribution=rolling-testing --force-distribution -c -N " & version & "-parrot0")
(stderr, result) = execCmdEx(
gbpPath & " dch --distribution=rolling-testing --force-distribution -c -N " & version & "-parrot0",
workingDir = workDir
)
proc gbpPush*(): int =
proc gbpPush*(gbpPath, workDir: string, stderr: var string): int =
#[
Push all changes with branches to nest
PROBLEM: on update server, maintainer have to type ssh password multiple times
]#
return execCmd("gbp push --pristine-tar")
(stderr, result) = execCmdEx(
gbpPath & " push --pristine-tar",
workingDir = workDir
)
proc checkUpdate*(uscanPath, path: string, localVer, serverVer: var string): Err =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment