download_using_mirrors() downloads to temp files and returns the path, but
nothing was ever cleaning those temp files up. On an active server, like
verification, this can fill /tmp/ with many gigs of index-v2.json files.
/tmp has been filling up on verification, and it took me a little while to
track down the source. The tmp dirs were called /tmp/tmp98345sf. This
will replace the "tmp" prefix with something meaningful.
When get_source_date_epoch(get_build_dir(app)) returns None (e.g. when
the app source directory has not been initialized or is missing git/scm
metadata), assigning env['SOURCE_DATE_EPOCH'] = None causes a TypeError
since environment variable values must be strings.
Ensure SOURCE_DATE_EPOCH is only set when a timestamp is returned, and
delete any stale SOURCE_DATE_EPOCH key otherwise.
Closes#1329
insert_localized_app_metadata checks a build's subdir based on the path
suffix, but this only works for the base locale dir (with the summary,
descriptiion, etc), not the images/changelogs subdir, which are silently
ignored.
Triple-T metadata does not have this issue since copy_triple_t_store_metadata
finds the base metadata dir, then goes from there.
Searching for the fastlane dir from the end of the path instead of using
a fixed offset fixes this.
* `if common.find_apksigner({}) is None:` was always false.
* test case never generated files for archive/
* use --nosign to only sign jars with signindex
The current method messed up on timezones in some cases. Also fixes:
DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and
scheduled for removal in a future version. Use timezone-aware objects to
represent datetimes in UTC:
datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
Python 3.14 defaults to building with zlib-ng, so this is a workaround
until signature copying is fixed.
This also fixes!1848 tests on macOS:
https://gitlab.com/fdroid/fdroidserver/-/jobs/15472305534
FileNotFoundError: [Errno 2] No such file or directory: '/etc/os-release'
TmpCwd used to raise FileNotFound exception when the processes cwd is
pointing to a non-existent directory. This change makes it so that
TmpCwd doesn't raise this exception anymore.
Intially apk_is_v1_signed_only() was designed to expect APK file-paths
as parameter. In some cases we already have an androguard APK instance,
so those changes the signature of apk_is_v1_signed_only to take
androguard APK objects instead of file-paths. Additionally we introduce
apkfile_is_v1_signed_only for working with file-paths.
This adds _download_and_check_reference_binary() to build.py and moves
some lines from the humongous main() function there. It also adds some
unit tests for that new fucntion.
This is a Pythonic structure for gathering all these constant values that
are used in a manageable way.
Enums have SCREEN_RESOLUTIONS['ldpi'] but throw KeyErrors when the key is
there.