Change 7zip default to external utility

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2019-07-28 11:31:10 +09:00
parent c2072c80c0
commit 5f7b6b506a
3 changed files with 19 additions and 19 deletions

View File

@@ -33,7 +33,7 @@ This is an utility replacing the official graphical Qt installer. It can
automatically download prebuilt Qt binaries for any target (you're not bound to automatically download prebuilt Qt binaries for any target (you're not bound to
Linux binaries on Linux; you could also download iOS binaries). Linux binaries on Linux; you could also download iOS binaries).
It's working with Python > 3.5 on Linux, OS X and Windows. It's working with Python > 3.5 on Linux, OS X and Windows.
It is required to install 7zip utility in your platform.
Install Install
------- -------
@@ -52,19 +52,20 @@ General usage looks like this:
.. code-block:: bash .. code-block:: bash
aqt [-h][--help][-O | --outputdir <directory>][-b | --base <mirror url>][-E | --external <7zip command>] \ aqt [-h][--help][-O | --outputdir <directory>][-b | --base <mirror url>][-E | --external <7zip command>] \
install <qt-version> <host> <target> [<arch>] [--internal] install <qt-version> <host> <target> [<arch>]
.. code-block:: bash .. code-block:: bash
python -m aqt [-h][--help][-O | --outputdir <directory>][-b | --base <mirror url>] \ python -m aqt [-h][--help][-O | --outputdir <directory>][-b | --base <mirror url>][-E | --external <7zip command>] \
install <qt-version> <host> <target> [<arch>] [--internal] install <qt-version> <host> <target> [<arch>]
* The Qt version is formatted like this: `5.11.3` * The Qt version is formatted like this: `5.11.3`
* Host is one of: `linux`, `mac`, `windows` * Host is one of: `linux`, `mac`, `windows`
* Target is one of: `desktop`, `android`, `ios` (iOS only works with mac host) * Target is one of: `desktop`, `android`, `ios` (iOS only works with mac host)
* For android and windows you also need to specify an arch: `win64_msvc2017_64`, * For android and windows you also need to specify an arch: `win64_msvc2017_64`,
`win64_msvc2015_64`, `win32_msvc2015`, `win32_mingw53`, `win64_mingw73`, `android_x86`, `android_armv7` `win64_msvc2015_64`, `win32_msvc2015`, `win32_mingw53`, `win64_mingw73`, `android_x86`, `android_armv7`
* You can also use external 7zip command instead of internal extration function. * You can also use internal 7zip extractor instead of external 7zip command.
* You can specify external 7zip command path.
The Qt packages are installed under current directory as such `Qt<ver>/<ver>/gcc_64/` The Qt packages are installed under current directory as such `Qt<ver>/<ver>/gcc_64/`

View File

@@ -66,21 +66,20 @@ class Cli():
os_name = args.host os_name = args.host
output_dir = args.outputdir output_dir = args.outputdir
mirror = args.base mirror = args.base
sevenzip = args.external use_py7zr = args.internal
if sevenzip is not None: sevenzip = None
if sevenzip == '_auto': if not use_py7zr:
sevenzip = args.external
if sevenzip is None:
if platform.system() == 'Windows': if platform.system() == 'Windows':
sevenzip = r'C:\Program Files\7-Zip\7z.exe' sevenzip = r'C:\Program Files\7-Zip\7z.exe'
else: else:
sevenzip = r'7zr' sevenzip = r'7zr'
elif not os.path.exists(sevenzip): elif os.path.exists(sevenzip):
print('Specified unexist external command in option -E') pass
exit(1)
elif sys.version_info.major == 2:
if platform.system() == 'Windows':
sevenzip = r'C:\Program Files\7-Zip\7z.exe'
else: else:
sevenzip = r'7zr' print('Specified external 7zip command is not exist.')
exit(1)
if arch is None: if arch is None:
if os_name == "linux" and target == "desktop": if os_name == "linux" and target == "desktop":
arch = "gcc_64" arch = "gcc_64"
@@ -140,8 +139,8 @@ class Cli():
install_parser.add_argument('-b', '--base', nargs='?', install_parser.add_argument('-b', '--base', nargs='?',
help="Specify mirror base url such as http://mirrors.ocf.berkeley.edu/qt/, " help="Specify mirror base url such as http://mirrors.ocf.berkeley.edu/qt/, "
"where 'online' folder exist.") "where 'online' folder exist.")
install_parser.add_argument('-E', '--external', nargs='?', const='_auto', install_parser.add_argument('-E', '--external', nargs=1, help='Specify external 7zip command path.')
help='Use external 7zip command instead of internal extractor.') install_parser.add_argument('--internal', action='store_true', help='Use internal extractor.')
list_parser = subparsers.add_parser('list') list_parser = subparsers.add_parser('list')
list_parser.set_defaults(func=self.run_list) list_parser.set_defaults(func=self.run_list)
list_parser.add_argument("qt_version", help="Qt version in the format of \"5.X.Y\"") list_parser.add_argument("qt_version", help="Qt version in the format of \"5.X.Y\"")

View File

@@ -24,7 +24,7 @@ steps:
inputs: inputs:
scriptSource: filePath scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/bin/aqt scriptPath: $(Build.SourcesDirectory)/bin/aqt
arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH) -E arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH)
workingDirectory: $(Build.BinariesDirectory) workingDirectory: $(Build.BinariesDirectory)
condition: not(variables['QT_BASE_MIRROR']) condition: not(variables['QT_BASE_MIRROR'])
displayName: Run Aqt (No Base URL Set) displayName: Run Aqt (No Base URL Set)
@@ -32,7 +32,7 @@ steps:
inputs: inputs:
scriptSource: filePath scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/bin/aqt scriptPath: $(Build.SourcesDirectory)/bin/aqt
arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH) -b $(QT_BASE_MIRROR) -E arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH) -b $(QT_BASE_MIRROR)
workingDirectory: $(Build.BinariesDirectory) workingDirectory: $(Build.BinariesDirectory)
condition: variables['QT_BASE_MIRROR'] condition: variables['QT_BASE_MIRROR']
displayName: Run Aqt (Base URL Set) displayName: Run Aqt (Base URL Set)