mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-10 13:05:46 +01:00
Merge branch 'master' of git://gitorious.org/opensuse/osc
This commit is contained in:
commit
8e7a171cf2
3
README
3
README
@ -14,6 +14,7 @@ RPM packages are here (rpm-md repository):
|
|||||||
http://download.opensuse.org/repositories/openSUSE:/Tools/
|
http://download.opensuse.org/repositories/openSUSE:/Tools/
|
||||||
|
|
||||||
To install from svn, do
|
To install from svn, do
|
||||||
|
|
||||||
python setup.py build
|
python setup.py build
|
||||||
python setup.py install
|
python setup.py install
|
||||||
# create a symlink 'osc' in your path pointing to osc.py.
|
# create a symlink 'osc' in your path pointing to osc.py.
|
||||||
@ -146,7 +147,7 @@ Update a working copy
|
|||||||
osc up [pac_dir] # update a single package by its path
|
osc up [pac_dir] # update a single package by its path
|
||||||
osc up * # from within a project dir, update all packages
|
osc up * # from within a project dir, update all packages
|
||||||
osc up # from within a project dir, update all packages
|
osc up # from within a project dir, update all packages
|
||||||
AND check out all newly added packages
|
# AND check out all newly added packages
|
||||||
|
|
||||||
If an update can't be merged automatically, a file is in 'C' (conflict)
|
If an update can't be merged automatically, a file is in 'C' (conflict)
|
||||||
state, and conflicts are marked with special <<<<<<< and >>>>>>> lines.
|
state, and conflicts are marked with special <<<<<<< and >>>>>>> lines.
|
||||||
|
@ -98,5 +98,4 @@ if __name__ == "__main__":
|
|||||||
checker.cleanup()
|
checker.cleanup()
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
# vim: sw=4 et
|
# vim: sw=4 et
|
||||||
|
@ -28,11 +28,11 @@ MAN_FOOTER = r"""
|
|||||||
Type 'osc help <subcommand>' for more detailed help on a specific subcommand.
|
Type 'osc help <subcommand>' for more detailed help on a specific subcommand.
|
||||||
.PP
|
.PP
|
||||||
For additional information, see
|
For additional information, see
|
||||||
* http://www.opensuse.org/Build_Service_Tutorial
|
* http://en.opensuse.org/Build_Service_Tutorial
|
||||||
* http://www.opensuse.org/Build_Service/CLI
|
* http://en.opensuse.org/Build_Service/CLI
|
||||||
.PP
|
.PP
|
||||||
You can modify osc commands, or roll you own, via the plugin API:
|
You can modify osc commands, or roll you own, via the plugin API:
|
||||||
* http://www.opensuse.org/Build_Service/osc_plugins
|
* http://en.opensuse.org/Build_Service/osc_plugins
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
osc was written by several authors. This man page is automatically generated.
|
osc was written by several authors. This man page is automatically generated.
|
||||||
"""
|
"""
|
||||||
@ -48,11 +48,11 @@ class Osc(cmdln.Cmdln):
|
|||||||
${help_list}
|
${help_list}
|
||||||
global ${option_list}
|
global ${option_list}
|
||||||
For additional information, see
|
For additional information, see
|
||||||
* http://www.opensuse.org/Build_Service_Tutorial
|
* http://en.opensuse.org/Build_Service_Tutorial
|
||||||
* http://www.opensuse.org/Build_Service/CLI
|
* http://en.opensuse.org/Build_Service/CLI
|
||||||
|
|
||||||
You can modify osc commands, or roll you own, via the plugin API:
|
You can modify osc commands, or roll you own, via the plugin API:
|
||||||
* http://www.opensuse.org/Build_Service/osc_plugins
|
* http://en.opensuse.org/Build_Service/osc_plugins
|
||||||
"""
|
"""
|
||||||
name = 'osc'
|
name = 'osc'
|
||||||
conf = None
|
conf = None
|
||||||
@ -2698,7 +2698,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
opts.name_filter = None
|
opts.name_filter = None
|
||||||
opts.status_filter = None
|
opts.status_filter = None
|
||||||
opts.vertical = None
|
opts.vertical = None
|
||||||
self.do_prjresults('prjresults', opts, *args);
|
self.do_prjresults('prjresults', opts, *args)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
project = store_read_project(wd)
|
project = store_read_project(wd)
|
||||||
|
@ -3496,7 +3496,9 @@ def get_results(apiurl, prj, package, lastbuild=None, repository=[], arch=[]):
|
|||||||
rmap['status'] = ''
|
rmap['status'] = ''
|
||||||
|
|
||||||
if rmap['status'] in ['expansion error', 'broken', 'blocked', 'finished']:
|
if rmap['status'] in ['expansion error', 'broken', 'blocked', 'finished']:
|
||||||
rmap['status'] += ': ' + statusnode.find('details').text
|
details = statusnode.find('details')
|
||||||
|
if details != None:
|
||||||
|
rmap['status'] += ': ' + details.text
|
||||||
|
|
||||||
if rmap['dirty'] == 'true':
|
if rmap['dirty'] == 'true':
|
||||||
rmap['status'] = 'state is outdated (was: %s)' % rmap['status']
|
rmap['status'] = 'state is outdated (was: %s)' % rmap['status']
|
||||||
|
@ -114,9 +114,9 @@ class Fetcher:
|
|||||||
pkgq = packagequery.PackageQuery.query(tmpfile, extra_rpmtags=(1044, 1051, 1052))
|
pkgq = packagequery.PackageQuery.query(tmpfile, extra_rpmtags=(1044, 1051, 1052))
|
||||||
arch = pkgq.arch()
|
arch = pkgq.arch()
|
||||||
# SOURCERPM = 1044
|
# SOURCERPM = 1044
|
||||||
if pkgq.filename_suffix == 'rpm' and not pkgq.getTag(1044):
|
if pkgq.filename_suffix == 'rpm' and not pkgq.gettag(1044):
|
||||||
# NOSOURCE = 1051, NOPATCH = 1052
|
# NOSOURCE = 1051, NOPATCH = 1052
|
||||||
if pkgq.getTag(1051) or pkgq.getTag(1052):
|
if pkgq.gettag(1051) or pkgq.gettag(1052):
|
||||||
arch = "nosrc"
|
arch = "nosrc"
|
||||||
else:
|
else:
|
||||||
arch = "src"
|
arch = "src"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
class NoSecureSSLError(Exception):
|
class NoSecureSSLError(Exception):
|
||||||
def __init__(self, msg):
|
def __init__(self, msg):
|
||||||
|
Exception.__init__(self)
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.msg
|
return self.msg
|
||||||
|
@ -104,7 +104,7 @@ class DebQuery(packagequery.PackageQuery):
|
|||||||
def requires(self):
|
def requires(self):
|
||||||
return self.fields['depends']
|
return self.fields['depends']
|
||||||
|
|
||||||
def getTag(self, num):
|
def gettag(self, num):
|
||||||
return self.fields.get(num, None)
|
return self.fields.get(num, None)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -13,8 +13,8 @@ class PackageQueries(dict):
|
|||||||
# map debian arches to common obs arches
|
# map debian arches to common obs arches
|
||||||
architectureMap = {'i386': ['i586', 'i686'], 'amd64': ['x86_64']}
|
architectureMap = {'i386': ['i586', 'i686'], 'amd64': ['x86_64']}
|
||||||
|
|
||||||
def __init__(self, wantedArchitecture):
|
def __init__(self, wanted_architecture):
|
||||||
self.wantedArchitecture = wantedArchitecture
|
self.wanted_architecture = wanted_architecture
|
||||||
super(PackageQueries, self).__init__()
|
super(PackageQueries, self).__init__()
|
||||||
|
|
||||||
def add(self, query):
|
def add(self, query):
|
||||||
@ -32,13 +32,13 @@ class PackageQueries(dict):
|
|||||||
|
|
||||||
architecture = query.arch()
|
architecture = query.arch()
|
||||||
|
|
||||||
if (architecture in [self.wantedArchitecture, 'noarch', 'all'] or
|
if (architecture in [self.wanted_architecture, 'noarch', 'all'] or
|
||||||
self.wantedArchitecture in self.architectureMap.get(architecture,
|
self.wanted_architecture in self.architectureMap.get(architecture,
|
||||||
[])):
|
[])):
|
||||||
currentQuery = self.get(name)
|
current_query = self.get(name)
|
||||||
|
|
||||||
# if current query does not exist or is older than this new query
|
# if current query does not exist or is older than this new query
|
||||||
if currentQuery is None or currentQuery.vercmp(query) <= 0:
|
if current_query is None or current_query.vercmp(query) <= 0:
|
||||||
super(PackageQueries, self).__setitem__(name, query)
|
super(PackageQueries, self).__setitem__(name, query)
|
||||||
|
|
||||||
class PackageQuery:
|
class PackageQuery:
|
||||||
@ -73,10 +73,10 @@ class PackageQuery:
|
|||||||
def requires(self):
|
def requires(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def getTag(self):
|
def gettag(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def vercmp(self, pkgq):
|
def vercmp(self, pkgquery):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -85,20 +85,20 @@ class PackageQuery:
|
|||||||
magic = f.read(7)
|
magic = f.read(7)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
extra_tags = ()
|
extra_tags = ()
|
||||||
pkgq = None
|
pkgquery = None
|
||||||
if magic[:4] == '\xed\xab\xee\xdb':
|
if magic[:4] == '\xed\xab\xee\xdb':
|
||||||
import rpmquery
|
import rpmquery
|
||||||
pkgq = rpmquery.RpmQuery(f)
|
pkgquery = rpmquery.RpmQuery(f)
|
||||||
extra_tags = extra_rpmtags
|
extra_tags = extra_rpmtags
|
||||||
elif magic == '!<arch>':
|
elif magic == '!<arch>':
|
||||||
import debquery
|
import debquery
|
||||||
pkgq = debquery.DebQuery(f)
|
pkgquery = debquery.DebQuery(f)
|
||||||
extra_tags = extra_debtags
|
extra_tags = extra_debtags
|
||||||
else:
|
else:
|
||||||
raise PackageError('unsupported package type. magic: \'%s\' (%s)' % (magic, filename))
|
raise PackageError('unsupported package type. magic: \'%s\' (%s)' % (magic, filename))
|
||||||
pkgq.read(all_tags, *extra_tags)
|
pkgquery.read(all_tags, *extra_tags)
|
||||||
f.close()
|
f.close()
|
||||||
return pkgq
|
return pkgquery
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
import sys
|
||||||
|
@ -20,7 +20,7 @@ class RpmHeader:
|
|||||||
def append(self, entry):
|
def append(self, entry):
|
||||||
self.entries.append(entry)
|
self.entries.append(entry)
|
||||||
|
|
||||||
def getTag(self, tag):
|
def gettag(self, tag):
|
||||||
for i in self.entries:
|
for i in self.entries:
|
||||||
if i.tag == tag:
|
if i.tag == tag:
|
||||||
return i
|
return i
|
||||||
@ -131,7 +131,7 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
entry.data = entry.data[0]
|
entry.data = entry.data[0]
|
||||||
return
|
return
|
||||||
# get private i18n table
|
# get private i18n table
|
||||||
table = self.header.getTag(100)
|
table = self.header.gettag(100)
|
||||||
# just care about the country code
|
# just care about the country code
|
||||||
lang = lang.split('_', 1)[0]
|
lang = lang.split('_', 1)[0]
|
||||||
cnt = 0
|
cnt = 0
|
||||||
@ -147,9 +147,9 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
raise RpmHeaderError('unsupported tag type \'%d\' (tag: \'%s\'' % (entry.type, entry.tag))
|
raise RpmHeaderError('unsupported tag type \'%d\' (tag: \'%s\'' % (entry.type, entry.tag))
|
||||||
|
|
||||||
def __reqprov(self, tag, flags, version):
|
def __reqprov(self, tag, flags, version):
|
||||||
pnames = self.header.getTag(tag).data
|
pnames = self.header.gettag(tag).data
|
||||||
pflags = self.header.getTag(flags).data
|
pflags = self.header.gettag(flags).data
|
||||||
pvers = self.header.getTag(version).data
|
pvers = self.header.gettag(version).data
|
||||||
if not (pnames and pflags and pvers):
|
if not (pnames and pflags and pvers):
|
||||||
raise RpmError('cannot get provides/requires, tags are missing')
|
raise RpmError('cannot get provides/requires, tags are missing')
|
||||||
res = []
|
res = []
|
||||||
@ -179,31 +179,31 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
|
|
||||||
# XXX: create dict for the tag => number mapping?!
|
# XXX: create dict for the tag => number mapping?!
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.header.getTag(1000).data
|
return self.header.gettag(1000).data
|
||||||
|
|
||||||
def version(self):
|
def version(self):
|
||||||
return self.header.getTag(1001).data
|
return self.header.gettag(1001).data
|
||||||
|
|
||||||
def release(self):
|
def release(self):
|
||||||
return self.header.getTag(1002).data
|
return self.header.gettag(1002).data
|
||||||
|
|
||||||
def epoch(self):
|
def epoch(self):
|
||||||
epoch = self.header.getTag(1003)
|
epoch = self.header.gettag(1003)
|
||||||
if epoch is None:
|
if epoch is None:
|
||||||
return 0
|
return 0
|
||||||
return epoch.data[0]
|
return epoch.data[0]
|
||||||
|
|
||||||
def arch(self):
|
def arch(self):
|
||||||
return self.header.getTag(1022).data
|
return self.header.gettag(1022).data
|
||||||
|
|
||||||
def summary(self):
|
def summary(self):
|
||||||
return self.header.getTag(1004).data
|
return self.header.gettag(1004).data
|
||||||
|
|
||||||
def description(self):
|
def description(self):
|
||||||
return self.header.getTag(1005).data
|
return self.header.gettag(1005).data
|
||||||
|
|
||||||
def url(self):
|
def url(self):
|
||||||
entry = self.header.getTag(1020)
|
entry = self.header.gettag(1020)
|
||||||
if entry is None:
|
if entry is None:
|
||||||
return None
|
return None
|
||||||
return entry.data
|
return entry.data
|
||||||
@ -217,8 +217,8 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
def requires(self):
|
def requires(self):
|
||||||
return self.__reqprov(1049, 1048, 1050)
|
return self.__reqprov(1049, 1048, 1050)
|
||||||
|
|
||||||
def getTag(self, num):
|
def gettag(self, num):
|
||||||
return self.header.getTag(num)
|
return self.header.gettag(num)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def query(filename):
|
def query(filename):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user