From 04af493f24f22a0c2bf4d958bb96be4fb1315c8d Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 13 Feb 2014 11:21:45 +0100 Subject: [PATCH] remove create - we don't use it at the moment we need to revisit what to do for creating staging:work - but the code is in the git history --- osc-staging.py | 144 ------------------------------------------------- 1 file changed, 144 deletions(-) diff --git a/osc-staging.py b/osc-staging.py index 6dfc2b5e..4e959b7c 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -173,141 +173,6 @@ def _staging_check(self, project, check_everything, opts): print "Staging check succeeded!" return ret -def _staging_create(self, trg, opts): - """ - Creates new staging project based on the submit request. - :param trg: submit request to create staging project for or parent project/package - :param opts: pointer to options - """ - - req = None - - # We are dealing with sr - if re.match('^\d+$', trg): - # read info from sr - req = get_request(opts.apiurl, trg) - act = req.get_actions("submit")[0] - - trg_prj = act.tgt_project - trg_pkg = act.tgt_package - src_prj = act.src_project - src_pkg = act.src_package - - # We are dealing with project - else: - data = re.split('/', trg) - o_stg_prj = data[0] - trg_prj = re.sub(':Staging:.*','',data[0]) - src_prj = re.sub(':Staging:.*','',data[0]) - if len(data)>1: - trg_pkg = data[1] - src_pkg = data[1] - else: - trg_pkg = None - src_pkg = None - - # Set staging name and maybe parent - if trg_pkg is not None: - stg_prj = trg_prj + ":Staging:" + trg_pkg - - if re.search(':Staging:',trg): - stg_prj = o_stg_prj - - if opts.parent: - trg_prj = opts.parent - - # test if staging project exists - found = 1 - url = make_meta_url('prj', stg_prj, opts.apiurl) - try: - data = http_GET(url).readlines() - except HTTPError as e: - if e.code == 404: - found = 0 - else: - raise e - if found == 1: - print('Staging project "%s" already exists, overwrite? (Y/n)'%(stg_prj)) - answer = sys.stdin.readline() - if re.search("^\s*[Nn]", answer): - print('Aborting...') - exit(1) - - # parse metadata from parent project - trg_meta_url = make_meta_url("prj", trg_prj, opts.apiurl) - data = http_GET(trg_meta_url).readlines() - - dis_repo = [] - en_repo = [] - repos = [] - perm ='' - in_build = 0 - for line in data: - # what repositories are disabled - if in_build == 1: - if re.search("^\s+", line): - in_build = 0 - elif re.search("^\s+", line): - in_build=1 - # what are the rights - elif re.search("^\s+( %s/%s...'%(src_pkg,src_prj,stg_prj,trg_pkg)) - link_pac(src_prj, src_pkg, stg_prj, trg_pkg, True) - print - - return - def _staging_remove(self, project, opts): """ Remove staging project. @@ -490,8 +355,6 @@ def do_staging(self, subcmd, opts, *args): "check" will check if all packages are links without changes - "create" (or "c") will create staging repo from specified submit request - "remove" (or "r") will delete the staging project into submit requests for openSUSE:Factory "submit-devel" (or "s") will create review requests for changed packages in staging project @@ -508,8 +371,6 @@ def do_staging(self, subcmd, opts, *args): Usage: osc staging check [--everything] REPO - osc staging create [--parent project] SR# - osc staging create [--parent project] PROJECT[/PACKAGE] osc staging remove REPO osc staging submit-devel [-m message] REPO osc staging freeze PROJECT @@ -531,8 +392,6 @@ def do_staging(self, subcmd, opts, *args): min_args, max_args = 1, 2 elif cmd in ['select']: min_args, max_args = 2, None - elif cmd in ['create', 'c']: - min_args, max_args = 1, 2 elif cmd in ['list', 'cleanup_rings']: min_args, max_args = 0, 0 else: @@ -553,9 +412,6 @@ def do_staging(self, subcmd, opts, *args): if cmd in ['push', 'p']: project = args[1] self._staging_push(project, opts) - elif cmd in ['create', 'c']: - sr = args[1] - self._staging_create(sr, opts) elif cmd in ['check']: project = args[1] return self._staging_check(project, opts.everything, opts)