diff --git a/NEWS b/NEWS index b4941ef5..1399e12e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +0.135.1 + - do not forward requests to packages which do link anyway to original request target + 0.135 - request accept is offering now to forward submit request if it is a devel area like webui does - support archlinux builds (requires OBS 2.4) diff --git a/osc-wrapper.py b/osc-wrapper.py index 416dbe6d..0a292dc4 100755 --- a/osc-wrapper.py +++ b/osc-wrapper.py @@ -11,9 +11,9 @@ from osc import commandline, babysitter # this is a hack to make osc work as expected with utf-8 characters, # no matter how site.py is set... reload(sys) -loc = locale.getdefaultlocale()[1] +loc = locale.getpreferredencoding() if not loc: - loc = sys.getdefaultencoding() + loc = sys.getpreferredencoding() sys.setdefaultencoding(loc) del sys.setdefaultencoding diff --git a/osc/build.py b/osc/build.py index 9f970639..9724407f 100644 --- a/osc/build.py +++ b/osc/build.py @@ -257,13 +257,22 @@ def get_built_files(pacdir, pactype): b_built = subprocess.Popen(['find', os.path.join(pacdir, 'KIWI'), '-type', 'f'], stdout=subprocess.PIPE).stdout.read().strip() - else: + elif pactype == 'deb': b_built = subprocess.Popen(['find', os.path.join(pacdir, 'DEBS'), '-name', '*.deb'], stdout=subprocess.PIPE).stdout.read().strip() s_built = subprocess.Popen(['find', os.path.join(pacdir, 'SOURCES.DEB'), '-type', 'f'], stdout=subprocess.PIPE).stdout.read().strip() + elif pactype == 'arch': + b_built = subprocess.Popen(['find', os.path.join(pacdir, 'ARCHPKGS'), + '-name', '*.pkg.tar*'], + stdout=subprocess.PIPE).stdout.read().strip() + s_built = [] + else: + print >>sys.stderr, 'WARNING: Unknown package type \'%s\'.' % (pactype) + b_built = [] + s_built = [] return s_built, b_built def get_repo(path): diff --git a/osc/commandline.py b/osc/commandline.py index 03027992..7c23d38d 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1747,8 +1747,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='all states. Same as\'-s all\'') @cmdln.option('-f', '--force', action='store_true', help='enforce state change, can be used to ignore open reviews') - @cmdln.option('-s', '--state', default='', # default is 'all' if no args given, 'new,review' otherwise - help='only list requests in one of the comma separated given states (new/review/accepted/revoked/declined) or "all" [default="new,review", or "all", if no args given]') + @cmdln.option('-s', '--state', default='', # default is 'all' if no args given, 'declined,new,review' otherwise + help='only list requests in one of the comma separated given states (new/review/accepted/revoked/declined) or "all" [default="declined,new,review", or "all", if no args given]') @cmdln.option('-D', '--days', metavar='DAYS', help='only list requests in state "new" or changed in the last DAYS. [default=%(request_list_days)s]') @cmdln.option('-U', '--user', metavar='USER', @@ -1871,7 +1871,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. opts.state = 'all' if opts.state == '': - opts.state = 'new,review' + opts.state = 'declined,new,review' if args[0] == 'help': return self.do_help(['help', 'request']) @@ -2170,14 +2170,34 @@ Please submit there instead, or use --nodevelproject to force direct submission. for node in root.findall('package'): project = node.get('project') package = node.get('name') + # skip it when this is anyway a link to me + link_url = makeurl(apiurl, ['source', project, package]) + links_to_project = links_to_package = None + try: + file = http_GET(link_url) + root = ET.parse(file).getroot() + link_node = root.find('linkinfo') + if link_node != None: + links_to_project = link_node.get('project') or project + links_to_package = link_node.get('package') or package + except urllib2.HTTPError, e: + if e.code != 404: + print >>sys.stderr, 'Cannot get list of files for %s/%s: %s' % (project, package, e) + except SyntaxError, e: + print >>sys.stderr, 'Cannot parse list of files for %s/%s: %s' % (project, package, e) + if links_to_project==action.tgt_project and links_to_package==action.tgt_package: + # links to my request target anyway, no need to forward submit + continue + print project, if package != action.tgt_package: print "/", package, repl = raw_input('\nForward this submit to it? ([y]/n)') if repl.lower() == 'y' or repl == '': - msg = cgi.escape("%s (forwarded request %s from %s)" % ( rq.description, reqid, rq.get_creator)) + msg = "%s (forwarded request %s from %s)" % ( rq.description, reqid, rq.get_creator()) + print msg rid = create_submit_request(apiurl, action.tgt_project, action.tgt_package, - project, package, msg) + project, package, cgi.escape(msg)) print "New request #", rid # editmeta and its aliases are all depracated @@ -6139,7 +6159,11 @@ Please submit there instead, or use --nodevelproject to force direct submission. if project is None: project = node.get('name') else: - package = node.get('name') + if kind == 'published/binary/id': + package = node.get('package') + else: + package = node.get('name') + result.append(project) if not package is None: result.append(package) diff --git a/osc/core.py b/osc/core.py index d5be869b..bb15b588 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3,7 +3,7 @@ # and distributed under the terms of the GNU General Public Licence, # either version 2, or version 3 (at your option). -__version__ = '0.134git' +__version__ = '0.135' # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration @@ -787,7 +787,7 @@ class Project: elif pac in self.pacs_broken: print 'osc: \'%s\' package not found' % pac elif state == None: - self.commitExtPackage(pac, msg, todo, verbose=verbose) + self.commitExtPackage(pac, msg, todo, verbose=verbose, skip_local_service_run=skip_local_service_run) finally: self.write_packages() else: @@ -856,7 +856,7 @@ class Project: delete_package(self.apiurl, self.name, pac) self.del_package_node(pac) - def commitExtPackage(self, pac, msg, files = [], verbose=False): + def commitExtPackage(self, pac, msg, files = [], verbose=False, skip_local_service_run=False): """commits a package from an external project""" if os_path_samefile(os.path.join(self.dir, pac), os.getcwd()): pac_path = '.' @@ -875,7 +875,7 @@ class Project: template_args=({'name': pac, 'user': user}), apiurl=apiurl) p = Package(pac_path) p.todo = files - p.commit(msg=msg, verbose=verbose) + p.commit(msg=msg, verbose=verbose, skip_local_service_run=skip_local_service_run) def __str__(self): r = [] @@ -1830,7 +1830,7 @@ rev: %s print print "The link in this package is currently broken. Checking" print "out the last working version instead; please use 'osc pull'" - print "to repair the link." + print "to merge the conflicts." print def unmark_frozen(self): diff --git a/osc/oscssl.py b/osc/oscssl.py index a0b305be..127c0cdd 100644 --- a/osc/oscssl.py +++ b/osc/oscssl.py @@ -155,7 +155,7 @@ class mySSLContext(SSL.Context): def __init__(self): SSL.Context.__init__(self, 'sslv23') self.set_options(m2.SSL_OP_NO_SSLv2 | m2.SSL_OP_NO_SSLv3) - self.set_cipher_list("ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!MD5:@STRENGTH") + self.set_cipher_list("ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH") self.set_session_cache_mode(m2.SSL_SESS_CACHE_CLIENT) self.verrs = None #self.set_info_callback() # debug