mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-23 13:31:48 +01:00
- fixed #122 ("osc chroot fails to use the osc build buildroot directory")
Renamed osc chroot's "--root" option to "--login-as-root" (kept the short option "-r"). Added new "--root /path/to/buildroot" option (this is consistent with "osc build --root...").
This commit is contained in:
parent
87021e41fe
commit
ad92e8abb7
@ -5798,8 +5798,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
help='specify the used build target project')
|
help='specify the used build target project')
|
||||||
@cmdln.option('--noinit', '--no-init', action='store_true',
|
@cmdln.option('--noinit', '--no-init', action='store_true',
|
||||||
help='do not guess/verify specified repository')
|
help='do not guess/verify specified repository')
|
||||||
@cmdln.option('-r', '--root', action='store_true',
|
@cmdln.option('-r', '--login-as-root', action='store_true',
|
||||||
help='login as root instead of abuild')
|
help='login as root instead of abuild')
|
||||||
|
@cmdln.option('--root', metavar='ROOT',
|
||||||
|
help='Path to the buildroot')
|
||||||
@cmdln.option('-o', '--offline', action='store_true',
|
@cmdln.option('-o', '--offline', action='store_true',
|
||||||
help='Use cached data without contacting the api server')
|
help='Use cached data without contacting the api server')
|
||||||
def do_chroot(self, subcmd, opts, *args):
|
def do_chroot(self, subcmd, opts, *args):
|
||||||
@ -5823,8 +5825,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
user = 'abuild'
|
user = 'abuild'
|
||||||
if opts.root:
|
if opts.login_as_root:
|
||||||
user = 'root'
|
user = 'root'
|
||||||
|
buildroot = opts.root
|
||||||
|
if buildroot is None:
|
||||||
repository, arch, descr = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project)
|
repository, arch, descr = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project)
|
||||||
project = opts.alternative_project or store_read_project('.')
|
project = opts.alternative_project or store_read_project('.')
|
||||||
if opts.local_package:
|
if opts.local_package:
|
||||||
@ -5832,6 +5836,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
else:
|
else:
|
||||||
package = store_read_package('.')
|
package = store_read_package('.')
|
||||||
apihost = urlsplit(self.get_api_url())[1]
|
apihost = urlsplit(self.get_api_url())[1]
|
||||||
|
if buildroot is None:
|
||||||
buildroot = os.environ.get('OSC_BUILD_ROOT', conf.config['build-root']) \
|
buildroot = os.environ.get('OSC_BUILD_ROOT', conf.config['build-root']) \
|
||||||
% {'repo': repository, 'arch': arch, 'project': project, 'package': package, 'apihost': apihost}
|
% {'repo': repository, 'arch': arch, 'project': project, 'package': package, 'apihost': apihost}
|
||||||
if not os.path.isdir(buildroot):
|
if not os.path.isdir(buildroot):
|
||||||
|
Loading…
Reference in New Issue
Block a user