Skip to content
Snippets Groups Projects
Commit 603e6149 authored by Tobias Hildebrandt's avatar Tobias Hildebrandt Committed by Adrien Béraud
Browse files

build: add -y flag to build.py dependency install

disable -y by default

Change-Id: I6befd8564fc4334dae398d32d54d3871bd19b717
parent c26393df
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,8 @@ On Linux ...@@ -40,7 +40,8 @@ On Linux
./build.py --dependencies ./build.py --dependencies
Your distribution's package manager will be used. Your distribution's package manager will be used. Adding the ``-y`` flag will install the
dependencies non-interactively (assumes yes at all prompts).
2. Build and install locally under this repository: 2. Build and install locally under this repository:
......
...@@ -51,7 +51,7 @@ FLATPAK_BASED_RUNTIMES = [ ...@@ -51,7 +51,7 @@ FLATPAK_BASED_RUNTIMES = [
APT_INSTALL_SCRIPT = [ APT_INSTALL_SCRIPT = [
'apt-get update', 'apt-get update',
'apt-get install -y %(packages)s' 'apt-get install %(packages)s'
] ]
BREW_UNLINK_SCRIPT = [ BREW_UNLINK_SCRIPT = [
...@@ -66,7 +66,7 @@ BREW_INSTALL_SCRIPT = [ ...@@ -66,7 +66,7 @@ BREW_INSTALL_SCRIPT = [
RPM_INSTALL_SCRIPT = [ RPM_INSTALL_SCRIPT = [
'dnf update', 'dnf update',
'dnf install -y %(packages)s' 'dnf install %(packages)s'
] ]
PACMAN_INSTALL_SCRIPT = [ PACMAN_INSTALL_SCRIPT = [
...@@ -76,7 +76,7 @@ PACMAN_INSTALL_SCRIPT = [ ...@@ -76,7 +76,7 @@ PACMAN_INSTALL_SCRIPT = [
ZYPPER_INSTALL_SCRIPT = [ ZYPPER_INSTALL_SCRIPT = [
'zypper update', 'zypper update',
'zypper install -y %(packages)s' 'zypper install %(packages)s'
] ]
ZYPPER_DEPENDENCIES = [ ZYPPER_DEPENDENCIES = [
...@@ -253,6 +253,9 @@ OSX_UNINSTALL_SCRIPT = [ ...@@ -253,6 +253,9 @@ OSX_UNINSTALL_SCRIPT = [
'rm -rf install/client-macosx' 'rm -rf install/client-macosx'
] ]
ASSUME_YES_FLAG = ' -y'
ASSUME_YES_FLAG_PACMAN = ' --noconfirm'
def run_powersell_cmd(cmd): def run_powersell_cmd(cmd):
p = subprocess.Popen(["powershell.exe", cmd], stdout=sys.stdout) p = subprocess.Popen(["powershell.exe", cmd], stdout=sys.stdout)
p.communicate() p.communicate()
...@@ -266,6 +269,9 @@ def run_dependencies(args): ...@@ -266,6 +269,9 @@ def run_dependencies(args):
'Set-ExecutionPolicy Unrestricted; .\\scripts\\install-deps-windows.ps1') 'Set-ExecutionPolicy Unrestricted; .\\scripts\\install-deps-windows.ps1')
elif args.distribution in APT_BASED_DISTROS: elif args.distribution in APT_BASED_DISTROS:
if args.assume_yes:
for i, _ in enumerate(APT_INSTALL_SCRIPT):
APT_INSTALL_SCRIPT[i] += ASSUME_YES_FLAG
execute_script( execute_script(
APT_INSTALL_SCRIPT, APT_INSTALL_SCRIPT,
{"packages": ' '.join(map(shlex.quote, APT_DEPENDENCIES))}) {"packages": ' '.join(map(shlex.quote, APT_DEPENDENCIES))})
...@@ -281,6 +287,9 @@ def run_dependencies(args): ...@@ -281,6 +287,9 @@ def run_dependencies(args):
{"packages": ' '.join(map(shlex.quote, APT_CLIENT_GNOME_DEPENDENCIES))}) {"packages": ' '.join(map(shlex.quote, APT_CLIENT_GNOME_DEPENDENCIES))})
elif args.distribution in DNF_BASED_DISTROS: elif args.distribution in DNF_BASED_DISTROS:
if args.assume_yes:
for i, _ in enumerate(DNF_INSTALL_SCRIPT):
DNF_INSTALL_SCRIPT[i] += ASSUME_YES_FLAG
execute_script( execute_script(
RPM_INSTALL_SCRIPT, RPM_INSTALL_SCRIPT,
{"packages": ' '.join(map(shlex.quote, DNF_DEPENDENCIES))}) {"packages": ' '.join(map(shlex.quote, DNF_DEPENDENCIES))})
...@@ -296,6 +305,9 @@ def run_dependencies(args): ...@@ -296,6 +305,9 @@ def run_dependencies(args):
{"packages": ' '.join(map(shlex.quote, DNF_CLIENT_GNOME_DEPENDENCIES))}) {"packages": ' '.join(map(shlex.quote, DNF_CLIENT_GNOME_DEPENDENCIES))})
elif args.distribution in PACMAN_BASED_DISTROS: elif args.distribution in PACMAN_BASED_DISTROS:
if args.assume_yes:
for i, _ in enumerate(PACMAN_INSTALL_SCRIPT):
PACMAN_INSTALL_SCRIPT[i] += ASSUME_YES_FLAG_PACMAN
execute_script( execute_script(
PACMAN_INSTALL_SCRIPT, PACMAN_INSTALL_SCRIPT,
{"packages": ' '.join(map(shlex.quote, PACMAN_DEPENDENCIES))}) {"packages": ' '.join(map(shlex.quote, PACMAN_DEPENDENCIES))})
...@@ -311,6 +323,9 @@ def run_dependencies(args): ...@@ -311,6 +323,9 @@ def run_dependencies(args):
{"packages": ' '.join(map(shlex.quote, PACMAN_CLIENT_GNOME_DEPENDENCIES))}) {"packages": ' '.join(map(shlex.quote, PACMAN_CLIENT_GNOME_DEPENDENCIES))})
elif args.distribution in ZYPPER_BASED_DISTROS: elif args.distribution in ZYPPER_BASED_DISTROS:
if args.assume_yes:
for i, _ in enumerate(ZYPPER_INSTALL_SCRIPT):
ZYPPER_INSTALL_SCRIPT[i] += ASSUME_YES_FLAG
execute_script( execute_script(
ZYPPER_INSTALL_SCRIPT, ZYPPER_INSTALL_SCRIPT,
{"packages": ' '.join(map(shlex.quote, ZYPPER_DEPENDENCIES))}) {"packages": ' '.join(map(shlex.quote, ZYPPER_DEPENDENCIES))})
...@@ -710,6 +725,8 @@ def parse_args(): ...@@ -710,6 +725,8 @@ def parse_args():
ap.add_argument('--no-libwrap', dest='no_libwrap', ap.add_argument('--no-libwrap', dest='no_libwrap',
default=False, action='store_true', default=False, action='store_true',
help='Disable libwrap. Also set --disable-shared option to daemon configure') help='Disable libwrap. Also set --disable-shared option to daemon configure')
ap.add_argument('-y', '--assume-yes', default=False, action='store_true',
help='Assume yes (do not prompt user) for dependency installations through the system package manager')
ap.add_argument('--no-webengine', dest='no_webengine', ap.add_argument('--no-webengine', dest='no_webengine',
default=False, action='store_true', default=False, action='store_true',
help='Do not use Qt WebEngine.') help='Do not use Qt WebEngine.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment