mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-13 01:26:37 -04:00
Check for git and merge basic and tool checks
This commit is contained in:
parent
b1f20aec69
commit
70fd9fd9f0
@ -289,30 +289,27 @@ class Check(Command):
|
|||||||
parser.add_argument('-v', '--version', help='Release version number or name.')
|
parser.add_argument('-v', '--version', help='Release version number or name.')
|
||||||
parser.add_argument('-s', '--src-dir', help='Source directory.', default='.')
|
parser.add_argument('-s', '--src-dir', help='Source directory.', default='.')
|
||||||
parser.add_argument('-b', '--release-branch', help='Release source branch (default: inferred from --version).')
|
parser.add_argument('-b', '--release-branch', help='Release source branch (default: inferred from --version).')
|
||||||
parser.add_argument('-t', '--check-tools', help='Check for necessary build tools.', action='store_true')
|
|
||||||
|
|
||||||
def run(self, version, src_dir, release_branch, check_tools):
|
def run(self, version, src_dir, release_branch):
|
||||||
if not version:
|
if not version:
|
||||||
logger.warning('No version specified, performing only basic checks.')
|
logger.warning('No version specified, performing only basic checks.')
|
||||||
if check_tools:
|
|
||||||
self.perform_tool_checks()
|
|
||||||
self.perform_basic_checks(src_dir)
|
self.perform_basic_checks(src_dir)
|
||||||
if version:
|
if version:
|
||||||
self.perform_version_checks(version, src_dir, release_branch)
|
self.perform_version_checks(version, src_dir, release_branch)
|
||||||
logger.info('All checks passed.')
|
logger.info('All checks passed.')
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def perform_tool_checks(cls):
|
|
||||||
logger.info('Checking for required build tools...')
|
|
||||||
cls.check_xcode_setup()
|
|
||||||
cls.check_gnupg()
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def perform_basic_checks(cls, src_dir):
|
def perform_basic_checks(cls, src_dir):
|
||||||
logger.info('Performing basic checks...')
|
logger.info('Performing basic checks...')
|
||||||
cls.check_src_dir_exists(src_dir)
|
cls.check_src_dir_exists(src_dir)
|
||||||
|
cls.check_git()
|
||||||
cls.check_git_repository(src_dir)
|
cls.check_git_repository(src_dir)
|
||||||
|
|
||||||
|
logger.info('Checking for required build tools...')
|
||||||
|
cls.check_git()
|
||||||
|
cls.check_gnupg()
|
||||||
|
cls.check_xcode_setup()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def perform_version_checks(cls, version, src_dir, git_ref=None, version_exists=False, checkout=True):
|
def perform_version_checks(cls, version, src_dir, git_ref=None, version_exists=False, checkout=True):
|
||||||
logger.info('Performing version checks...')
|
logger.info('Performing version checks...')
|
||||||
@ -403,17 +400,22 @@ class Check(Command):
|
|||||||
raise Error(f'{appstream} has not been updated to the "%s" release.', version)
|
raise Error(f'{appstream} has not been updated to the "%s" release.', version)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_xcode_setup():
|
def check_git():
|
||||||
if sys.platform != 'darwin':
|
if not _cmd_exists('git'):
|
||||||
return
|
raise Error('Git not installed.')
|
||||||
if not _cmd_exists('xcrun'):
|
|
||||||
raise Error('xcrun command not found! Please check that you have correctly installed Xcode.')
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_gnupg():
|
def check_gnupg():
|
||||||
if not _cmd_exists('gpg'):
|
if not _cmd_exists('gpg'):
|
||||||
raise Error('GnuPG not installed.')
|
raise Error('GnuPG not installed.')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def check_xcode_setup():
|
||||||
|
if sys.platform != 'darwin':
|
||||||
|
return
|
||||||
|
if not _cmd_exists('xcrun'):
|
||||||
|
raise Error('xcrun command not found! Please check that you have correctly installed Xcode.')
|
||||||
|
|
||||||
|
|
||||||
class Merge(Command):
|
class Merge(Command):
|
||||||
"""Merge release branch into main branch and create release tags."""
|
"""Merge release branch into main branch and create release tags."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user