mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 22:40:12 +01:00
strip file extension from generated name for non-APKs
With a generic file, the file name is the only guaranteed name metadata field. So if the name is not specified in the metadata, then the name is set to the filename. This changes that so that the file extension is stripped from that generated name.
This commit is contained in:
parent
6105f8a184
commit
372c8b418d
@ -448,7 +448,7 @@ def make_v0(apps, apks, repodir, repodict, requestsdict):
|
||||
and repodir == 'repo': # only create these
|
||||
namefield = common.config['current_version_name_source']
|
||||
sanitized_name = re.sub(b'''[ '"&%?+=/]''', b'', app.get(namefield).encode('utf-8'))
|
||||
apklinkname = sanitized_name + b'.apk'
|
||||
apklinkname = sanitized_name + os.path.splitext(current_version_file)[1].encode('utf-8')
|
||||
current_version_path = os.path.join(repodir, current_version_file).encode('utf-8', 'surrogateescape')
|
||||
if os.path.islink(apklinkname):
|
||||
os.remove(apklinkname)
|
||||
|
@ -843,8 +843,8 @@ def scan_repo_files(apkcache, repodir, knownapks, use_date_from_file=False):
|
||||
if not usecache:
|
||||
logging.debug("Processing " + name_utf8)
|
||||
repo_file = collections.OrderedDict()
|
||||
repo_file['name'] = os.path.splitext(name_utf8)[0]
|
||||
# TODO rename apkname globally to something more generic
|
||||
repo_file['name'] = name_utf8
|
||||
repo_file['apkName'] = name_utf8
|
||||
repo_file['hash'] = shasum
|
||||
repo_file['hashType'] = 'sha256'
|
||||
|
@ -12,7 +12,7 @@
|
||||
<id>fake.ota.update</id>
|
||||
<added>2016-03-10</added>
|
||||
<lastupdated>2016-03-10</lastupdated>
|
||||
<name>fake.ota.update_1234.zip</name>
|
||||
<name>fake.ota.update_1234</name>
|
||||
<summary>Tests whether OTA ZIP files are being include</summary>
|
||||
<desc><p>F-Droid can make use of system privileges or permissions to install, update and remove applications on its own. The only way to obtain those privileges is to become a system app.</p><p>This is where the Privileged Extension comes in - being a separate app and much smaller, it can be installed as a system app and communicate with the main app via AIDL IPC.</p><p>This has several advantages:</p><ul><li> Reduced disk usage in the system partition</li><li> System updates don't remove F-Droid</li><li> The process of installing into system via root is safer</li></ul><p>This is packaged as an OTA (Over-The-Air) update ZIP file. It must be installed using TWRP or other Android recovery that can flash updates to the system from the /data/data/org.fdroid.fdroid folder on the /data partition. The standalone APK is called F-Droid Privileged Extension.</p></desc>
|
||||
<license>Apache-2.0</license>
|
||||
|
Loading…
Reference in New Issue
Block a user