diff --git a/osc-staging.py b/osc-staging.py index 086dce8e..6a4f51e9 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -73,6 +73,8 @@ def _full_project_name(self, project): help='use the old check algorithm') @cmdln.option('-v', '--version', action='store_true', help='show version of the plugin') +@cmdln.option('--no-freeze', dest='no_freeze', action='store_true', + help='force the select command ignoring the time from the last freeze') def do_staging(self, subcmd, opts, *args): """${cmd_name}: Commands to work with staging projects @@ -99,7 +101,7 @@ def do_staging(self, subcmd, opts, *args): osc staging cleanup_rings osc staging freeze PROJECT... osc staging list - osc staging select [--move [--from PROJECT]] LETTER REQUEST... + osc staging select [--no-freeze] [--move [--from PROJECT]] LETTER REQUEST... osc staging unselect REQUEST... """ if opts.version: @@ -159,7 +161,8 @@ def do_staging(self, subcmd, opts, *args): if opts.add: api.mark_additional_packages(tprj, [opts.add]) else: - SelectCommand(api).perform(tprj, args[2:], opts.move, opts.from_) + SelectCommand(api).perform(tprj, args[2:], opts.move, + opts.from_, opts.no_freeze) elif cmd == 'cleanup_rings': CleanupRings(api).perform() elif cmd == 'list': diff --git a/osclib/conf.py b/osclib/conf.py index d7021391..e99f8146 100644 --- a/osclib/conf.py +++ b/osclib/conf.py @@ -41,9 +41,9 @@ DEFAULT = { 'lock': 'openSUSE:%(project)s:Staging', 'lock-ns': 'openSUSE', }, - r'SUSE:(?P[-\w\d]+)': { + r'SUSE:(?P.*$)': { 'staging': 'SUSE:%(project)s:Staging', - 'staging-group': '%(project.lower)s-staging', + 'staging-group': 'sle-staging-managers', # '%(project.lower)s-staging', 'rings': None, 'nonfree': None, 'rebuild': None, diff --git a/osclib/list_command.py b/osclib/list_command.py index b384d8e4..5164d273 100644 --- a/osclib/list_command.py +++ b/osclib/list_command.py @@ -29,7 +29,14 @@ class ListCommand: # Where are we targeting the package target_package = action.find('target').get('package') - ring = self.api.ring_packages.get(target_package) - # This condition is quite moot as we dispatched stuff above anyway + # If the system have rings, we ask for the ring of the + # package + if self.api.crings: + ring = self.api.ring_packages.get(target_package) + else: + ring = self.api.project + + # This condition is quite moot as we dispatched stuff + # above anyway if ring: print('Request({}): {} -> {}'.format(request_id, target_package, ring)) diff --git a/osclib/select_command.py b/osclib/select_command.py index 779bc54e..b04fb705 100644 --- a/osclib/select_command.py +++ b/osclib/select_command.py @@ -103,7 +103,8 @@ class SelectCommand(object): else: raise oscerr.WrongArgs('Arguments for select are not correct.') - def perform(self, target_project, requests, move=False, from_=None): + def perform(self, target_project, requests, move=False, + from_=None, no_freeze=False): """ Select package and move it accordingly by arguments :param target_project: project we want to target @@ -113,7 +114,7 @@ class SelectCommand(object): """ # If the project is not frozen enough yet freeze it - if not self.api.prj_frozen_enough(target_project): + if not (no_freeze or self.api.prj_frozen_enough(target_project)): print('Freeze the prj first') return False # FreezeCommand(self.api).perform(target_project) diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index 19d08c7d..7eb138c9 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -398,7 +398,8 @@ class StagingAPI(object): requests = self.get_open_requests() # check if we can reduce it down by accepting some for rq in requests: - self.accept_non_ring_request(rq) + if self.crings: + self.accept_non_ring_request(rq) self.update_superseded_request(rq) def get_prj_pseudometa(self, project): @@ -734,7 +735,7 @@ class StagingAPI(object): # The force_enable_build will avoid the # map_ring_package_to_subproject if not force_enable_build: - if not self.ring_packages.get(tar_pkg): + if self.crings and not self.ring_packages.get(tar_pkg): disable_build = True else: project = self.map_ring_package_to_subject(project, tar_pkg) @@ -910,7 +911,7 @@ class StagingAPI(object): for request in meta['requests']: staged_requests.append(request['id']) target_flag = 'disable' - if self.check_ring_packages(target_project, staged_requests): + if not self.crings or self.check_ring_packages(target_project, staged_requests): target_flag = 'enable' self.build_switch_prj(target_project, target_flag)