Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openSUSE/osc
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-h committed Sep 19, 2012
2 parents dd48ee4 + 4ab6f90 commit a8d26db
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 15 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions osc-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# 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

Expand Down
11 changes: 10 additions & 1 deletion osc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
36 changes: 30 additions & 6 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1747,8 +1747,8 @@ def do_changedevelrequest(self, subcmd, opts, *args):
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',
Expand Down Expand Up @@ -1871,7 +1871,7 @@ def do_request(self, subcmd, opts, *args):
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'])
Expand Down Expand Up @@ -2170,14 +2170,34 @@ def do_request(self, subcmd, opts, *args):
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
Expand Down Expand Up @@ -6139,7 +6159,11 @@ def build_xpath(attr, what, substr = False):
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)
Expand Down
10 changes: 5 additions & 5 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -787,7 +787,7 @@ def commit(self, pacs = (), msg = '', files = {}, verbose = False, skip_local_se
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:
Expand Down Expand Up @@ -856,7 +856,7 @@ def commitDelPackage(self, pac):
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 = '.'
Expand All @@ -875,7 +875,7 @@ def commitExtPackage(self, pac, msg, files = [], verbose=False):
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 = []
Expand Down Expand Up @@ -1830,7 +1830,7 @@ def mark_frozen(self):
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):
Expand Down
2 changes: 1 addition & 1 deletion osc/oscssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8d26db

Please sign in to comment.