diff --git a/src/calibre/build_forms.py b/src/calibre/build_forms.py index 39bf932873..d6e554fc17 100644 --- a/src/calibre/build_forms.py +++ b/src/calibre/build_forms.py @@ -43,9 +43,9 @@ def build_forms(srcdir, info=None, summary=False, check_for_migration=False): # Ensure that people running from source have all their forms rebuilt for # the qt5 migration force_compile = os.environ.get('CALIBRE_FORCE_BUILD_UI_FORMS', '') in ('1', 'yes', 'true') - if check_for_migration and not force_compile: + if check_for_migration: from calibre.gui2 import gprefs - force_compile = not gprefs.get(f'migrated_forms_to_qt{qt_major}', False) + force_compile |= not gprefs.get(f'migrated_forms_to_qt{qt_major}', False) for form in forms: compiled_form = form_to_compiled_form(form) @@ -67,5 +67,5 @@ def build_forms(srcdir, info=None, summary=False, check_for_migration=False): num += 1 if num: info('Compiled %d forms' % num) - if force_compile: + if check_for_migration and force_compile: gprefs.set(f'migrated_forms_to_qt{qt_major}', True)