1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-24 00:56:15 +01:00

Merge branch 'master' of github.com:openSUSE/osc

This commit is contained in:
Marcus Huewe 2012-09-20 01:20:23 +02:00
commit a8d26db675
6 changed files with 51 additions and 15 deletions

3
NEWS
View File

@ -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)

View File

@ -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

View File

@ -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):

View File

@ -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)

View File

@ -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):

View File

@ -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