1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

updatepacmetafromspec scans for spec files automatically.

requested/suggested (or whatever) by darix
This commit is contained in:
Marcus Hüwe 2007-07-04 13:48:24 +00:00
parent 9985f7fccb
commit a0f8f15190
2 changed files with 20 additions and 3 deletions

View File

@ -509,7 +509,9 @@ class Osc(cmdln.Cmdln):
@cmdln.option('-r', '--revision', metavar='rev',
help='checkout the specified revision')
help='checkout the specified revision. '
'NOTE: if you checkout the complete project '
'this option is ignored!')
@cmdln.alias('co')
def do_checkout(self, subcmd, opts, *args):
"""${cmd_name}: check out content from the repository

View File

@ -521,10 +521,25 @@ rev: %s
def read_meta_from_spec(self, spec = None):
import glob
if spec:
specfile = spec
else:
specfile = os.path.join(self.dir, self.name + '.spec')
# scan for spec files
speclist = glob.glob(os.path.join(self.dir, '*.spec'))
if len(speclist) == 1:
specfile = speclist[0]
elif len(speclist) > 1:
print 'the following specfiles were found:'
for file in speclist:
print file
print 'please specify one with --specfile'
sys.exit(1)
else:
print 'no specfile was found - please specify one ' \
'with --specfile'
sys.exit(1)
summary, descr = read_meta_from_spec(specfile)
if not summary and not descr:
@ -1598,7 +1613,7 @@ def wipebinaries(apiurl, project, package=None, arch=None, repo=None):
def parseRevisionOption(string):
"""
retrun a tuple which contains the revisions
returns a tuple which contains the revisions
"""
if string: