mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-18 04:10:10 +02:00
logging.warn() was deprecated in Python 3.3, use logging.warning()
sed -i 's,logging\.warn(,logging.warning(,g' fdroid */*.* https://docs.python.org/3.3/library/logging.html#logging.Logger.warning
This commit is contained in:
parent
67332d83a5
commit
6030445be0
@ -137,9 +137,9 @@ def main():
|
|||||||
|
|
||||||
system_langcode, system_encoding = locale.getdefaultlocale()
|
system_langcode, system_encoding = locale.getdefaultlocale()
|
||||||
if system_encoding is None or system_encoding.lower() not in ('utf-8', 'utf8'):
|
if system_encoding is None or system_encoding.lower() not in ('utf-8', 'utf8'):
|
||||||
logging.warn(_("Encoding is set to '{enc}' fdroid might run "
|
logging.warning(_("Encoding is set to '{enc}' fdroid might run "
|
||||||
"into encoding issues. Please set it to 'UTF-8' "
|
"into encoding issues. Please set it to 'UTF-8' "
|
||||||
"for best results.".format(enc=system_encoding)))
|
"for best results.".format(enc=system_encoding)))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mod.main()
|
mod.main()
|
||||||
|
@ -278,7 +278,7 @@ def build_server(app, build, vcs, build_dir, output_dir, log_dir, force):
|
|||||||
ftp.get(toolsversion_log, os.path.join(log_dir, toolsversion_log))
|
ftp.get(toolsversion_log, os.path.join(log_dir, toolsversion_log))
|
||||||
logging.debug('retrieved %s', toolsversion_log)
|
logging.debug('retrieved %s', toolsversion_log)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warn('could not get %s from builder vm: %s' % (toolsversion_log, e))
|
logging.warning('could not get %s from builder vm: %s' % (toolsversion_log, e))
|
||||||
|
|
||||||
# Retrieve the built files...
|
# Retrieve the built files...
|
||||||
logging.info("Retrieving build output...")
|
logging.info("Retrieving build output...")
|
||||||
|
@ -131,9 +131,9 @@ def main():
|
|||||||
if not package:
|
if not package:
|
||||||
raise FDroidException(_("Couldn't find package ID"))
|
raise FDroidException(_("Couldn't find package ID"))
|
||||||
if not versionName:
|
if not versionName:
|
||||||
logging.warn(_("Couldn't find latest version name"))
|
logging.warning(_('Could not find latest version name'))
|
||||||
if not versionCode:
|
if not versionCode:
|
||||||
logging.warn(_("Couldn't find latest version code"))
|
logging.warning(_('Could not find latest version code'))
|
||||||
else:
|
else:
|
||||||
raise FDroidException(_("No gradle project could be found. Specify --subdir?"))
|
raise FDroidException(_("No gradle project could be found. Specify --subdir?"))
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ def main():
|
|||||||
if 'sdk_path' in test_config:
|
if 'sdk_path' in test_config:
|
||||||
common.write_to_config(test_config, 'sdk_path', options.android_home)
|
common.write_to_config(test_config, 'sdk_path', options.android_home)
|
||||||
else:
|
else:
|
||||||
logging.warn('Looks like this is already an F-Droid repo, cowardly refusing to overwrite it...')
|
logging.warning('Looks like this is already an F-Droid repo, cowardly refusing to overwrite it...')
|
||||||
logging.info('Try running `fdroid init` in an empty directory.')
|
logging.info('Try running `fdroid init` in an empty directory.')
|
||||||
raise FDroidException('Repository already exists.')
|
raise FDroidException('Repository already exists.')
|
||||||
|
|
||||||
@ -209,8 +209,8 @@ def main():
|
|||||||
opensc_so = files[0]
|
opensc_so = files[0]
|
||||||
else:
|
else:
|
||||||
opensc_so = '/usr/lib/opensc-pkcs11.so'
|
opensc_so = '/usr/lib/opensc-pkcs11.so'
|
||||||
logging.warn('No OpenSC PKCS#11 module found, '
|
logging.warning('No OpenSC PKCS#11 module found, '
|
||||||
+ 'install OpenSC then edit "opensc-fdroid.cfg"!')
|
+ 'install OpenSC then edit "opensc-fdroid.cfg"!')
|
||||||
with open(os.path.join(examplesdir, 'opensc-fdroid.cfg'), 'r') as f:
|
with open(os.path.join(examplesdir, 'opensc-fdroid.cfg'), 'r') as f:
|
||||||
opensc_fdroid = f.read()
|
opensc_fdroid = f.read()
|
||||||
opensc_fdroid = re.sub('^library.*', 'library = ' + opensc_so, opensc_fdroid,
|
opensc_fdroid = re.sub('^library.*', 'library = ' + opensc_so, opensc_fdroid,
|
||||||
|
@ -109,8 +109,8 @@ def main():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if fail == "INSTALL_FAILED_ALREADY_EXISTS":
|
if fail == "INSTALL_FAILED_ALREADY_EXISTS":
|
||||||
logging.warn(_("'{apkfilename}' is already installed on {dev}.")
|
logging.warning(_('"{apkfilename}" is already installed on {dev}.')
|
||||||
.format(apkfilename=apk, dev=dev))
|
.format(apkfilename=apk, dev=dev))
|
||||||
else:
|
else:
|
||||||
raise FDroidException(_("Failed to install '{apkfilename}' on {dev}: {error}")
|
raise FDroidException(_("Failed to install '{apkfilename}' on {dev}: {error}")
|
||||||
.format(apkfilename=apk, dev=dev, error=fail))
|
.format(apkfilename=apk, dev=dev, error=fail))
|
||||||
|
@ -159,7 +159,7 @@ def scan_source(build_dir, build=metadata.Build()):
|
|||||||
def warnproblem(what, path_in_build_dir):
|
def warnproblem(what, path_in_build_dir):
|
||||||
if toignore(path_in_build_dir):
|
if toignore(path_in_build_dir):
|
||||||
return
|
return
|
||||||
logging.warn('Found %s at %s' % (what, path_in_build_dir))
|
logging.warning('Found %s at %s' % (what, path_in_build_dir))
|
||||||
if json_per_build is not None:
|
if json_per_build is not None:
|
||||||
json_per_build['warnings'].append([what, path_in_build_dir])
|
json_per_build['warnings'].append([what, path_in_build_dir])
|
||||||
|
|
||||||
@ -356,8 +356,8 @@ def main():
|
|||||||
json_per_appid['current-source-state'] = json_per_build
|
json_per_appid['current-source-state'] = json_per_build
|
||||||
count = scan_source(build_dir)
|
count = scan_source(build_dir)
|
||||||
if count > 0:
|
if count > 0:
|
||||||
logging.warn(_('Scanner found {count} problems in {appid}:')
|
logging.warning(_('Scanner found {count} problems in {appid}:')
|
||||||
.format(count=count, appid=appid))
|
.format(count=count, appid=appid))
|
||||||
probcount += count
|
probcount += count
|
||||||
app.builds = []
|
app.builds = []
|
||||||
|
|
||||||
@ -378,19 +378,19 @@ def main():
|
|||||||
|
|
||||||
count = scan_source(build_dir, build)
|
count = scan_source(build_dir, build)
|
||||||
if count > 0:
|
if count > 0:
|
||||||
logging.warn(_('Scanner found {count} problems in {appid}:{versionCode}:')
|
logging.warning(_('Scanner found {count} problems in {appid}:{versionCode}:')
|
||||||
.format(count=count, appid=appid, versionCode=build.versionCode))
|
.format(count=count, appid=appid, versionCode=build.versionCode))
|
||||||
probcount += count
|
probcount += count
|
||||||
|
|
||||||
except BuildException as be:
|
except BuildException as be:
|
||||||
logging.warn("Could not scan app %s due to BuildException: %s" % (
|
logging.warning('Could not scan app %s due to BuildException: %s' % (
|
||||||
appid, be))
|
appid, be))
|
||||||
probcount += 1
|
probcount += 1
|
||||||
except VCSException as vcse:
|
except VCSException as vcse:
|
||||||
logging.warn("VCS error while scanning app %s: %s" % (appid, vcse))
|
logging.warning('VCS error while scanning app %s: %s' % (appid, vcse))
|
||||||
probcount += 1
|
probcount += 1
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.warn("Could not scan app %s due to unknown error: %s" % (
|
logging.warning('Could not scan app %s due to unknown error: %s' % (
|
||||||
appid, traceback.format_exc()))
|
appid, traceback.format_exc()))
|
||||||
probcount += 1
|
probcount += 1
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ def update_awsbucket_libcloud(repo_section):
|
|||||||
s3url = 's3://' + awsbucket + '/' + obj.name
|
s3url = 's3://' + awsbucket + '/' + obj.name
|
||||||
logging.info(' deleting ' + s3url)
|
logging.info(' deleting ' + s3url)
|
||||||
if not driver.delete_object(obj):
|
if not driver.delete_object(obj):
|
||||||
logging.warn('Could not delete ' + s3url)
|
logging.warning('Could not delete ' + s3url)
|
||||||
upload = True
|
upload = True
|
||||||
|
|
||||||
if upload:
|
if upload:
|
||||||
@ -229,7 +229,7 @@ def update_awsbucket_libcloud(repo_section):
|
|||||||
object_name, obj = objs.popitem()
|
object_name, obj = objs.popitem()
|
||||||
s3url = 's3://' + awsbucket + '/' + object_name
|
s3url = 's3://' + awsbucket + '/' + object_name
|
||||||
if object_name.startswith(upload_dir):
|
if object_name.startswith(upload_dir):
|
||||||
logging.warn(' deleting ' + s3url)
|
logging.warning(' deleting ' + s3url)
|
||||||
driver.delete_object(obj)
|
driver.delete_object(obj)
|
||||||
else:
|
else:
|
||||||
logging.info(' skipping ' + s3url)
|
logging.info(' skipping ' + s3url)
|
||||||
@ -773,8 +773,9 @@ def main():
|
|||||||
and not config.get('binary_transparency_remote') \
|
and not config.get('binary_transparency_remote') \
|
||||||
and not config.get('virustotal_apikey') \
|
and not config.get('virustotal_apikey') \
|
||||||
and local_copy_dir is None:
|
and local_copy_dir is None:
|
||||||
logging.warn(_('No option set! Edit your config.py to set at least one of these:')
|
logging.warning(_('No option set! Edit your config.py to set at least one of these:')
|
||||||
+ '\nserverwebroot, servergitmirrors, local_copy_dir, awsbucket, virustotal_apikey, androidobservatory, or binary_transparency_remote')
|
+ '\nserverwebroot, servergitmirrors, local_copy_dir, awsbucket, '
|
||||||
|
+ 'virustotal_apikey, androidobservatory, or binary_transparency_remote')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
repo_sections = ['repo']
|
repo_sections = ['repo']
|
||||||
|
@ -76,7 +76,9 @@ def extract(options):
|
|||||||
if tmp_apk and os.path.exists(tmp_apk):
|
if tmp_apk and os.path.exists(tmp_apk):
|
||||||
os.remove(tmp_apk)
|
os.remove(tmp_apk)
|
||||||
else:
|
else:
|
||||||
logging.warn(_('refuse downloading via insecure HTTP connection (use HTTPS or specify --no-https-check): {apkfilename}').format(apkfilename=apk))
|
logging.warning(_('refuse downloading via insecure HTTP connection '
|
||||||
|
'(use HTTPS or specify --no-https-check): {apkfilename}')
|
||||||
|
.format(apkfilename=apk))
|
||||||
except FDroidException as e:
|
except FDroidException as e:
|
||||||
logging.warning(_("Failed fetching signatures for '{apkfilename}': {error}")
|
logging.warning(_("Failed fetching signatures for '{apkfilename}': {error}")
|
||||||
.format(apkfilename=apk, error=e))
|
.format(apkfilename=apk, error=e))
|
||||||
|
@ -366,7 +366,7 @@ def update_wiki(apps, sortedids, apks):
|
|||||||
else:
|
else:
|
||||||
logging.debug("Page " + page.name + " is unchanged")
|
logging.debug("Page " + page.name + " is unchanged")
|
||||||
else:
|
else:
|
||||||
logging.warn("Deleting page " + page.name)
|
logging.warning('Deleting page ' + page.name)
|
||||||
page.delete('No longer published')
|
page.delete('No longer published')
|
||||||
for pagename, text in genp.items():
|
for pagename, text in genp.items():
|
||||||
logging.debug("Checking " + pagename)
|
logging.debug("Checking " + pagename)
|
||||||
@ -2162,15 +2162,15 @@ def main():
|
|||||||
msg = _("{apkfilename} ({appid}) has no metadata!") \
|
msg = _("{apkfilename} ({appid}) has no metadata!") \
|
||||||
.format(apkfilename=apk['apkName'], appid=apk['packageName'])
|
.format(apkfilename=apk['apkName'], appid=apk['packageName'])
|
||||||
if options.delete_unknown:
|
if options.delete_unknown:
|
||||||
logging.warn(msg + '\n\t' + _("deleting: repo/{apkfilename}")
|
logging.warning(msg + '\n\t' + _("deleting: repo/{apkfilename}")
|
||||||
.format(apkfilename=apk['apkName']))
|
.format(apkfilename=apk['apkName']))
|
||||||
rmf = os.path.join(repodirs[0], apk['apkName'])
|
rmf = os.path.join(repodirs[0], apk['apkName'])
|
||||||
if not os.path.exists(rmf):
|
if not os.path.exists(rmf):
|
||||||
logging.error(_("Could not find {path} to remove it").format(path=rmf))
|
logging.error(_("Could not find {path} to remove it").format(path=rmf))
|
||||||
else:
|
else:
|
||||||
os.remove(rmf)
|
os.remove(rmf)
|
||||||
else:
|
else:
|
||||||
logging.warn(msg + '\n\t' + _("Use `fdroid update -c` to create it."))
|
logging.warning(msg + '\n\t' + _('Use `fdroid update -c` to create it.'))
|
||||||
|
|
||||||
copy_triple_t_store_metadata(apps)
|
copy_triple_t_store_metadata(apps)
|
||||||
insert_obbs(repodirs[0], apps, apks)
|
insert_obbs(repodirs[0], apps, apks)
|
||||||
|
@ -117,7 +117,7 @@ def get_build_vm(srvdir, provider=None):
|
|||||||
logging.debug('build vm provider \'virtualbox\' selected')
|
logging.debug('build vm provider \'virtualbox\' selected')
|
||||||
return VirtualboxBuildVm(abssrvdir)
|
return VirtualboxBuildVm(abssrvdir)
|
||||||
else:
|
else:
|
||||||
logging.warn('build vm provider not supported: \'%s\'', provider)
|
logging.warning('build vm provider not supported: \'%s\'', provider)
|
||||||
|
|
||||||
# try guessing provider from installed software
|
# try guessing provider from installed software
|
||||||
kvm_installed = shutil.which('kvm') is not None
|
kvm_installed = shutil.which('kvm') is not None
|
||||||
@ -451,8 +451,8 @@ class LibvirtBuildVm(FDroidBuildVm):
|
|||||||
os.remove('box.img')
|
os.remove('box.img')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logging.warn("could not connect to storage-pool 'default', "
|
logging.warning("could not connect to storage-pool 'default', "
|
||||||
"skip packaging buildserver box")
|
"skip packaging buildserver box")
|
||||||
|
|
||||||
def box_add(self, boxname, boxfile, force=True):
|
def box_add(self, boxname, boxfile, force=True):
|
||||||
boximg = '%s_vagrant_box_image_0.img' % (boxname)
|
boximg = '%s_vagrant_box_image_0.img' % (boxname)
|
||||||
|
Loading…
Reference in New Issue
Block a user