mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
srclib: no spaces in dict key
This commit is contained in:
parent
c6a97939f1
commit
2c86d38028
3 changed files with 7 additions and 4 deletions
|
@ -773,7 +773,7 @@ def getvcs(vcstype, remote, local):
|
||||||
def getsrclibvcs(name):
|
def getsrclibvcs(name):
|
||||||
if name not in fdroidserver.metadata.srclibs:
|
if name not in fdroidserver.metadata.srclibs:
|
||||||
raise VCSException("Missing srclib " + name)
|
raise VCSException("Missing srclib " + name)
|
||||||
return fdroidserver.metadata.srclibs[name]['Repo Type']
|
return fdroidserver.metadata.srclibs[name]['RepoType']
|
||||||
|
|
||||||
|
|
||||||
class vcs:
|
class vcs:
|
||||||
|
@ -1838,7 +1838,7 @@ def getsrclib(spec, srclib_dir, subdir=None, basepath=False,
|
||||||
sdir = os.path.join(srclib_dir, name)
|
sdir = os.path.join(srclib_dir, name)
|
||||||
|
|
||||||
if not preponly:
|
if not preponly:
|
||||||
vcs = getvcs(srclib["Repo Type"], srclib["Repo"], sdir)
|
vcs = getvcs(srclib["RepoType"], srclib["Repo"], sdir)
|
||||||
vcs.srclib = (name, number, sdir)
|
vcs.srclib = (name, number, sdir)
|
||||||
if ref:
|
if ref:
|
||||||
vcs.gotorevision(ref, refresh)
|
vcs.gotorevision(ref, refresh)
|
||||||
|
|
|
@ -709,7 +709,7 @@ def parse_txt_srclib(metadatapath):
|
||||||
thisinfo = {}
|
thisinfo = {}
|
||||||
|
|
||||||
# Defaults for fields that come from metadata
|
# Defaults for fields that come from metadata
|
||||||
thisinfo['Repo Type'] = ''
|
thisinfo['RepoType'] = ''
|
||||||
thisinfo['Repo'] = ''
|
thisinfo['Repo'] = ''
|
||||||
thisinfo['Subdir'] = None
|
thisinfo['Subdir'] = None
|
||||||
thisinfo['Prepare'] = None
|
thisinfo['Prepare'] = None
|
||||||
|
@ -731,6 +731,9 @@ def parse_txt_srclib(metadatapath):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
warn_or_exception(_("Invalid metadata in %s:%d") % (line, n))
|
warn_or_exception(_("Invalid metadata in %s:%d") % (line, n))
|
||||||
|
|
||||||
|
# collapse whitespaces in field names
|
||||||
|
f = f.replace(' ', '')
|
||||||
|
|
||||||
if f == "Subdir":
|
if f == "Subdir":
|
||||||
thisinfo[f] = v.split(',')
|
thisinfo[f] = v.split(',')
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -588,7 +588,7 @@ class MetadataTest(unittest.TestCase):
|
||||||
'''))
|
'''))
|
||||||
srclib = fdroidserver.metadata.parse_txt_srclib('JSoup.txt')
|
srclib = fdroidserver.metadata.parse_txt_srclib('JSoup.txt')
|
||||||
self.assertDictEqual({'Repo': 'https://github.com/jhy/jsoup.git',
|
self.assertDictEqual({'Repo': 'https://github.com/jhy/jsoup.git',
|
||||||
'Repo Type': 'git',
|
'RepoType': 'git',
|
||||||
'Subdir': [''],
|
'Subdir': [''],
|
||||||
'Prepare': ''},
|
'Prepare': ''},
|
||||||
srclib)
|
srclib)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue