1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

Do not retrieve the package list when initializing a project via osc init

Currently, when trying to initialize a non existent (server-side)
project via "osc init <prj>", osc errors out (after creating the wc)
because it fails to retrieve the package list. However, there is no
need to retrieve the package list in the "osc init <prj>" case. Hence,
skip the package list retrieval. As a result, osc does not error out.

For the background, see the discussion in #858 ("osc fails to check
out an empty project as project") [1].

[1] https://github.com/openSUSE/osc/issues/858#issuecomment-722330024
This commit is contained in:
Marcus Huewe 2020-11-05 13:08:20 +01:00
parent 699827d091
commit 0d78560e5d

View File

@ -242,7 +242,8 @@ class Osc(cmdln.Cmdln):
apiurl = self.get_api_url()
if not package:
Project.init_project(apiurl, os.curdir, project, conf.config['do_package_tracking'])
Project.init_project(apiurl, os.curdir, project, conf.config['do_package_tracking'],
getPackageList=False)
print('Initializing %s (Project: %s)' % (os.curdir, project))
else:
Package.init_package(apiurl, project, package, os.curdir)