only use AutoName: in checkupdates

AutoName: is only needed for the commit messages generated by checkupdates,
and it makes the logic for localized names confusing.

closes #654
refs #304
This commit is contained in:
Hans-Christoph Steiner 2020-01-13 15:43:42 +01:00
parent 0f6b638986
commit fff59e5197
11 changed files with 289 additions and 49 deletions

View file

@ -247,7 +247,7 @@ class IndexTest(unittest.TestCase):
self.maxDiff = None
self.assertEqual(json.dumps(i, indent=2), json.dumps(o, indent=2))
def test_make_v0(self):
def test_make_v0_repo_only(self):
tmptestsdir = tempfile.mkdtemp(prefix=inspect.currentframe().f_code.co_name,
dir=self.tmpdir)
os.chdir(tmptestsdir)
@ -264,7 +264,71 @@ class IndexTest(unittest.TestCase):
}
requestsdict = {'install': [], 'uninstall': []}
fdroidserver.common.config['repo_pubkey'] = 'ffffffffffffffffffffffffffffffffff'
fdroidserver.index.make_v0({}, [], 'repo', repodict, requestsdict, [])
fdroidserver.index.make_v0({}, [], 'repo', repodict, requestsdict, {})
self.assertTrue(os.path.isdir(repo_icons_dir))
self.assertTrue(os.path.exists(os.path.join(repo_icons_dir,
fdroidserver.common.default_config['repo_icon'])))
self.assertTrue(os.path.exists(os.path.join('repo', 'index.xml')))
def test_make_v0(self):
tmptestsdir = tempfile.mkdtemp(prefix=inspect.currentframe().f_code.co_name,
dir=self.tmpdir)
os.chdir(tmptestsdir)
os.mkdir('metadata')
os.mkdir('repo')
metadatafile = 'metadata/info.zwanenburg.caffeinetile.yml'
shutil.copy(os.path.join(self.basedir, metadatafile),
metadatafile)
repo_icons_dir = os.path.join('repo', 'icons')
self.assertFalse(os.path.isdir(repo_icons_dir))
repodict = {
'address': 'https://example.com/fdroid/repo',
'description': 'This is just a test',
'icon': 'blahblah',
'name': 'test',
'timestamp': datetime.datetime.now(),
'version': 12,
}
app = fdroidserver.metadata.parse_metadata(metadatafile, False, False)
app['icon'] = 'info.zwanenburg.caffeinetile.4.xml'
app['CurrentVersionCode'] = '4'
apps = {app.id: app}
apk = {
'hash': 'dbbdd7deadb038862f426b71efe4a64df8c3edf25d669e935f349510e16f65db',
'hashType': 'sha256',
'uses-permission': [
[
'android.permission.WAKE_LOCK',
None
]
],
'uses-permission-sdk-23': [],
'features': [],
'icons_src': {
'160': 'res/drawable/ic_coffee_on.xml',
'-1': 'res/drawable/ic_coffee_on.xml'
},
'icons': {
'160': 'info.zwanenburg.caffeinetile.4.xml'
},
'antiFeatures': [],
'packageName': 'info.zwanenburg.caffeinetile',
'versionCode': 4,
'name': 'Caffeine Tile',
'versionName': '1.3',
'minSdkVersion': 24,
'targetSdkVersion': 25,
'sig': '03f9b2f848d22fd1d8d1331e8b1b486d',
'signer': '51cfa5c8a743833ad89acf81cb755936876a5c8b8eca54d1ffdcec0cdca25d0e',
'size': 11740,
'apkName': 'info.zwanenburg.caffeinetile_4.apk',
'icon': 'info.zwanenburg.caffeinetile.4.xml',
'added': datetime.datetime.fromtimestamp(1539122400),
}
requestsdict = {'install': [], 'uninstall': []}
fdroidserver.common.config['repo_pubkey'] = 'ffffffffffffffffffffffffffffffffff'
fdroidserver.common.config['make_current_version_link'] = True
fdroidserver.index.make_v0(apps, [apk], 'repo', repodict, requestsdict, {})
self.assertTrue(os.path.isdir(repo_icons_dir))
self.assertTrue(os.path.exists(os.path.join(repo_icons_dir,
fdroidserver.common.default_config['repo_icon'])))