mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 18:06:13 +01:00
build: when called without arguments, show only architectures that can be built on the local machine
This commit is contained in:
parent
b69ae796cc
commit
686eb637c8
12
osc/build.py
12
osc/build.py
@ -265,18 +265,6 @@ def main(argv):
|
||||
global config
|
||||
config, auth = get_build_conf()
|
||||
|
||||
if len(argv) < 2:
|
||||
print 'you have to choose a repo to build on'
|
||||
print 'possible repositories are:'
|
||||
|
||||
(i, o) = os.popen4(['osc', 'repos'])
|
||||
i.close()
|
||||
|
||||
for line in o.readlines():
|
||||
if line.split()[1] == hostarch or line.split()[1] in can_also_build[hostarch]:
|
||||
print line.strip()
|
||||
sys.exit(1)
|
||||
|
||||
repo = argv[1]
|
||||
arch = argv[2]
|
||||
spec = argv[3]
|
||||
|
@ -608,21 +608,20 @@ usage: 1. osc repos # package = current dir
|
||||
|
||||
|
||||
def build(args):
|
||||
"""build: build a package _locally_
|
||||
"""build: build a package on your local machine
|
||||
You need to call the command inside a package directory.
|
||||
|
||||
usage: 1. osc build <platform> <arch> <specfile> [--clean|--noinit]
|
||||
2. BUILD_DIST=... osc build <specfile> [--clean|--noinit]
|
||||
|
||||
where BUILD_DIST equals <platform>-<arch>
|
||||
where BUILD_DIST equals <platform>-<arch>
|
||||
|
||||
|
||||
You may want to configure sudo with option NOPASSWD for /usr/bin/build
|
||||
and set su-wrapper to 'sudo' in .oscrc.
|
||||
|
||||
|
||||
"""
|
||||
|
||||
import osc.build
|
||||
|
||||
builddist = os.getenv('BUILD_DIST')
|
||||
if builddist:
|
||||
#sys.argv[4] = sys.argv[1]
|
||||
@ -635,12 +634,19 @@ and set su-wrapper to 'sudo' in .oscrc.
|
||||
print 'missing argument'
|
||||
print build.func_doc
|
||||
print 'Valid arguments are:'
|
||||
print 'you have to choose a repo to build on'
|
||||
print 'possible repositories are:'
|
||||
print
|
||||
repos(None)
|
||||
print
|
||||
(i, o) = os.popen4(['osc', 'repos'])
|
||||
i.close()
|
||||
|
||||
for line in o.readlines():
|
||||
a = line.split()[1] # arch
|
||||
if a == osc.build.hostarch or \
|
||||
a in osc.build.can_also_build.get(osc.build.hostarch, []):
|
||||
print line.strip()
|
||||
sys.exit(1)
|
||||
|
||||
import osc.build
|
||||
osc.build.main(sys.argv[1:])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user