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
packaging
apkg
Commits
d21e6ed3
Commit
d21e6ed3
authored
Apr 23, 2021
by
Tomas Krizek
Browse files
Merge branch 'host-build' into 'master'
build: use direct host build by default Closes
#44
See merge request
!37
parents
473755b7
2ea07eae
Pipeline
#80099
failed with stages
in 4 minutes and 13 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apkg/commands/build.py
View file @
d21e6ed3
...
...
@@ -4,7 +4,7 @@ build packages
Usage: apkg build [-u] [-s | -a] [<file> | -F <file-list>]...
[-v <ver>] [-r <rls>] [-d <distro>]
[-O <dir>] [--no-cache]
[-
H] [-i
]
[-
i | -I
]
Arguments:
<file> specify input <file>s (when using -s or -a)
...
...
@@ -23,10 +23,9 @@ Options:
-O, --result-dir <dir> put results into specified dir
default: pkg/pkgs/DISTRO/NVR
--no-cache disable cache
-H, --host-build build directly on host (!) without isolated env
default: use isolated builder (pbuilder, mock, ...)
-i, --install-dep install build dependencies on host
only works with -H/--host-build
-i, --install-dep install build dependencies on host (build-dep)
-I, --isolated use isolated builder (pbuilder, mock, ...)
default: use direct builder
"""
# noqa
from
docopt
import
docopt
...
...
@@ -48,7 +47,7 @@ def run_command(cargs):
distro
=
args
[
'--distro'
],
result_dir
=
args
[
'--result-dir'
],
install_dep
=
args
[
'--install-dep'
],
isolated
=
not
args
[
'--
host-buil
d'
],
isolated
=
args
[
'--
isolate
d'
],
use_cache
=
not
args
[
'--no-cache'
])
common
.
print_results
(
results
)
return
results
apkg/pkgstyles/arch.py
View file @
d21e6ed3
...
...
@@ -74,14 +74,10 @@ def build_packages(
raise
ex
.
InvalidSourcePackageFormat
(
fmt
=
"arch source package format is PKGBUILD but got: %s"
%
srcpkg_path
.
name
)
isolated
=
kwargs
.
get
(
'isolated'
)
log
.
info
(
"copying source package to build dir: %s"
,
build_path
)
shutil
.
copytree
(
srcpkg_path
.
parent
,
build_path
)
# build package using makepkg
if
not
isolated
:
msg
=
"arch doesn't support direct host build - using isolated"
log
.
warning
(
msg
)
log
.
info
(
"starting isolated arch package build using makepkg"
)
log
.
info
(
"starting arch package build using makepkg"
)
with
cd
(
build_path
):
run
(
'makepkg'
,
direct
=
'auto'
)
log
.
info
(
"copying built packages to result dir: %s"
,
out_path
)
...
...
tests/self/test_self.py
View file @
d21e6ed3
...
...
@@ -53,7 +53,7 @@ def test_apkg_build(tmpdir, capsys):
repo_dir
=
str
(
repo_path
)
assert
repo_dir
.
endswith
(
'apkg'
)
with
cd
(
repo_dir
):
assert
apkg
(
'build'
,
'--host-build'
)
==
0
assert
apkg
(
'build'
)
==
0
out
,
_
=
capsys
.
readouterr
()
# at least one package should be printed
assert
re
.
match
(
r
"pkg/pkgs/\S+/apkg\S+"
,
out
)
...
...
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