mirror of
https://abf.rosa.ru/djam/abf-console-client-src.git
synced 2025-02-23 09:52:48 +00:00
Merge pull request #5 from termim/abf-console-client:fixes
fix project name and owner in get_project_name and get_project_data
This commit is contained in:
commit
226742dc8a
3 changed files with 30 additions and 31 deletions
4
abf.py
4
abf.py
|
@ -152,8 +152,8 @@ def parse_command_line():
|
|||
'Default is 0B.'))
|
||||
subparser.add_argument('-n', '--do-not-remove-files', action='store_true', help=_('By default files are being removed on uploading. Override this behavior.'))
|
||||
subparser.add_argument('-a', '--upload-all', action='store_true', help=_('By default, console client analyzes spec file and tries to detect which files located in the '
|
||||
'current folder are really used by the project and uploads only these files to file store. '
|
||||
'With this option, console client will upload all binary files located in the current folder.'))
|
||||
'current folder are really used by the project and uploads only these files to file store. '
|
||||
'With this option, console client will upload all binary files located in the current folder.'))
|
||||
subparser.set_defaults(func=put)
|
||||
|
||||
# store
|
||||
|
|
|
@ -45,11 +45,10 @@ def get_project_name(path=None):
|
|||
e["LC_ALL"] = "C"
|
||||
output, ret_code = execute_command(['git', 'remote', 'show', 'origin', '-n'], cwd=path, env=e)
|
||||
|
||||
for line in output.split('\n'):
|
||||
if line.startswith(' Fetch URL:') and 'abf' in line:
|
||||
project_name = line.split('/')[-1][:-4]
|
||||
owner_name = line.split('/')[-2]
|
||||
return (owner_name, project_name)
|
||||
m = re.compile("^.*Fetch URL:\s+.*abf.*:(.+)/([^/]+)[.]git$",re.MULTILINE).search(output)
|
||||
if m:
|
||||
owner_name, project_name = m.groups()
|
||||
return (owner_name, project_name)
|
||||
return (None, None)
|
||||
except ReturnCodeNotZero:
|
||||
return (None, None)
|
||||
|
@ -100,11 +99,11 @@ def get_project_data(spec_path):
|
|||
sources = []
|
||||
patches = []
|
||||
for src in sources_all:
|
||||
name, number, flag = src
|
||||
fname, number, flag = src
|
||||
if flag & src_flag: # source file
|
||||
sources.append((name, number))
|
||||
sources.append((fname, number))
|
||||
elif flag & patch_fkag:
|
||||
patches.append((name, number))
|
||||
patches.append((fname, number))
|
||||
return {'name': name, 'version': version, 'sources': sources, 'patches': patches}
|
||||
|
||||
|
||||
|
|
42
abf/model.py
42
abf/model.py
|
@ -436,7 +436,7 @@ class Project(Model):
|
|||
|
||||
@staticmethod
|
||||
def update(models, project, name, description, visibility, is_package, default_branch,
|
||||
has_issues, has_wiki, publish_i686_into_x86_64, maintainer_id):
|
||||
has_issues, has_wiki, publish_i686_into_x86_64, maintainer_id):
|
||||
DATA = {
|
||||
'id': project.id,
|
||||
'name': name,
|
||||
|
@ -539,12 +539,12 @@ class BuildList(Model):
|
|||
|
||||
self.params_dict['chroot_tree'] = ''
|
||||
if self.init_data['logs']:
|
||||
self.params_dict['log_url'] = self.init_data['logs'][0]['url'] + '.log?show=True'
|
||||
for log in self.init_data['logs']:
|
||||
if log["file_name"] == "chroot-tree.log":
|
||||
self.params_dict["chroot_tree"] = log["url"] + '.log?show=True'
|
||||
self.params_dict['log_url'] = self.init_data['logs'][0]['url'] + '.log?show=True'
|
||||
for log in self.init_data['logs']:
|
||||
if log["file_name"] == "chroot-tree.log":
|
||||
self.params_dict["chroot_tree"] = log["url"] + '.log?show=True'
|
||||
else:
|
||||
self.params_dict['log_url'] = ''
|
||||
self.params_dict['log_url'] = ''
|
||||
|
||||
self.params_dict['status_string'] = BuildList.status_by_id[self.params_dict['status']]
|
||||
if self.params_dict['status'] in BuildList.final_statuses:
|
||||
|
@ -562,21 +562,21 @@ class BuildList(Model):
|
|||
auto_publish_statuses = ['default', 'none', 'testing']
|
||||
@staticmethod
|
||||
def new_build_task(models,
|
||||
project,
|
||||
save_to_repository,
|
||||
repositories,
|
||||
commit_hash,
|
||||
project_version,
|
||||
update_type,
|
||||
auto_publish_status,
|
||||
arches, skip_personal,
|
||||
cached_chroot,
|
||||
save_chroot,
|
||||
auto_create_container,
|
||||
include_testing_subrepo,
|
||||
use_extra_tests,
|
||||
extra_build_lists,
|
||||
external_nodes):
|
||||
project,
|
||||
save_to_repository,
|
||||
repositories,
|
||||
commit_hash,
|
||||
project_version,
|
||||
update_type,
|
||||
auto_publish_status,
|
||||
arches, skip_personal,
|
||||
cached_chroot,
|
||||
save_chroot,
|
||||
auto_create_container,
|
||||
include_testing_subrepo,
|
||||
use_extra_tests,
|
||||
extra_build_lists,
|
||||
external_nodes):
|
||||
if external_nodes == 'none':
|
||||
DATA = {
|
||||
'project_id': project.id,
|
||||
|
|
Loading…
Add table
Reference in a new issue