Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nong Hoang Tu
source-updater
Commits
a2512fd6
Commit
a2512fd6
authored
Mar 08, 2021
by
Nong Hoang Tu
Browse files
Use execCmdEx for all procs
parent
15b928df
Changes
1
Hide whitespace changes
Inline
Side-by-side
newsrc/update/cmdutils.nim
View file @
a2512fd6
...
...
@@ -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
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment