aria download parameter fix | installation output log fix

This commit is contained in:
Vinicius Moreira
2019-09-23 13:26:50 -03:00
parent 5441d35ee2
commit dcb43d4f5a
4 changed files with 29 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
## bauh
Graphical user interface to manage your Linux applications (packages) (old **fpakman**). It currently supports Flatpak, Snap and AUR packaging types. When you launch **bauh** you will see
a management panel where you can search, update, install and uninstall applications. You can also downgrade some applications depending on the package technology.
a management panel where you can search, update, install, uninstall and launch applications. You can also downgrade some applications depending on the package technology.
It has a **tray mode** (see **Settings** below) that attaches the application icon to the system tray providing a quick way to launch it. Also the icon will get red when updates are available.
@@ -88,19 +88,19 @@ The application settings are stored in **/home/$USER/.config/bauh/config.json**
- Let the disk cache always enabled so **bauh** does not need to dynamically retrieve some data every time you launch it.
### Flatpak support ( flatpak gem )
- The user is able to search, install, uninstall, downgrade and retrieve the applications history
- The user is able to search, install, uninstall, downgrade, laucnh and retrieve the applications history
### Snap support ( snap gem )
- The user is able to search, install, uninstall and downgrade applications
- The user is able to search, install, uninstall, launch and downgrade applications
### AUR support ( arch gem )
- The user is able to search, install, uninstall, downgrade and retrieve the packages history
- The user is able to search, install, uninstall, downgrade, launch and retrieve the packages history
- It handles conflicts, and missing / optional packages installations
- Automatically makes a simple package compilation improvement: if **MAKEFLAGS** is not set in **/etc/makepkg.conf** and **/home/$USER/makepkg.conf** does not exist,
then a copy of **/etc/makepkg.conf** will be generated at **/home/$USER/makepkg.conf** defining MAKEFLAGS to work with
the number of your machine processors multiplied by 1.5 rounded up ( this feature can be disabled through the environment variable **BAUH_ARCH_OPTIMIZE=0** )
- If (**aria2**) [https://github.com/aria2/aria2] is installed on your system and multi-threaded downloads are enabled ( see**BAUH_DOWNLOAD_MULTITHREAD** ), the source packages
will be downloaded faster.
will be pre-downloaded faster ( it does **NOT** modify your **pacman** settings ).
### Logs

View File

@@ -35,8 +35,8 @@ class AdaptableFileDownloader(FileDownloader):
if output_path:
output_split = output_path.split('/')
cmd.append('-d=' + '/'.join(output_split[:-1]))
cmd.append('-o=' + output_split[-1])
cmd.append('--dir=' + '/'.join(output_split[:-1]))
cmd.append('--out=' + output_split[-1])
return SystemProcess(new_subprocess(cmd=cmd, cwd=cwd),
skip_stdout=True,

View File

@@ -231,10 +231,10 @@ class SearchPackages(AsyncAction):
self.word = None
class InstallApp(AsyncAction):
class InstallPackage(AsyncAction):
def __init__(self, manager: SoftwareManager, disk_cache: bool, icon_cache: MemoryCache, locale_keys: dict, pkg: PackageView = None):
super(InstallApp, self).__init__()
super(InstallPackage, self).__init__()
self.pkg = pkg
self.manager = manager
self.icon_cache = icon_cache
@@ -261,7 +261,7 @@ class InstallApp(AsyncAction):
success = False
self.print(self.locale_keys['internet.required'])
finally:
self.signal_finished.emit(self.pkg if success else None)
self.signal_finished.emit({'success': success, 'pkg': self.pkg})
self.pkg = None

View File

@@ -28,7 +28,7 @@ from bauh.view.qt.info import InfoDialog
from bauh.view.qt.root import is_root, ask_root_password
from bauh.view.qt.styles import StylesComboBox
from bauh.view.qt.thread import UpdateSelectedApps, RefreshApps, UninstallApp, DowngradeApp, GetAppInfo, \
GetAppHistory, SearchPackages, InstallApp, AnimateProgress, VerifyModels, FindSuggestions, ListWarnings, \
GetAppHistory, SearchPackages, InstallPackage, AnimateProgress, VerifyModels, FindSuggestions, ListWarnings, \
AsyncAction, LaunchApp, ApplyFilters, CustomAction
from bauh.view.qt.view_model import PackageView
from bauh.view.qt.view_utils import load_icon
@@ -219,7 +219,7 @@ class ManageWindow(QWidget):
self.thread_apply_filters.signal_table.connect(self._update_table_and_upgrades)
self.signal_table_update.connect(self.thread_apply_filters.stop_waiting)
self.thread_install = InstallApp(manager=self.manager, disk_cache=self.disk_cache, icon_cache=self.icon_cache, locale_keys=self.i18n)
self.thread_install = InstallPackage(manager=self.manager, disk_cache=self.disk_cache, icon_cache=self.icon_cache, locale_keys=self.i18n)
self._bind_async_action(self.thread_install, finished_call=self._finish_install)
self.thread_animate_progress = AnimateProgress()
@@ -868,31 +868,30 @@ class ManageWindow(QWidget):
self.thread_install.root_password = pwd
self.thread_install.start()
def _finish_install(self, pkgv: PackageView):
def _finish_install(self, res: dict):
self.input_search.setText('')
self.finish_action()
if pkgv:
console_output = self.textarea_output.toPlainText()
if console_output:
log_path = '/tmp/bauh/logs/install/{}/{}'.format(res['pkg'].model.get_type(), res['pkg'].model.name)
try:
Path(log_path).mkdir(parents=True, exist_ok=True)
with open(log_path + '/{}.log'.format(int(time.time())), 'w+') as f:
f.write(console_output)
except:
self.textarea_output.appendPlainText("[warning] Could not write install log file to '{}'".format(log_path))
if res['success']:
if self._can_notify_user():
util.notify_user(msg='{} ({}) {}'.format(pkgv.model.name, pkgv.model.get_type(), self.i18n['installed']))
util.notify_user(msg='{} ({}) {}'.format(res['pkg'].model.name, res['pkg'].model.get_type(), self.i18n['installed']))
console_output = self.textarea_output.toPlainText()
if console_output:
log_path = '/tmp/bauh/logs/install/{}/{}'.format(pkgv.model.get_type(), pkgv.model.name)
try:
Path(log_path).mkdir(parents=True, exist_ok=True)
with open(log_path + '/{}.log'.format(int(time.time())), 'w+') as f:
f.write(console_output)
except:
self.textarea_output.appendPlainText(
"[warning] Could not write install log file to '{}'".format(log_path))
self.refresh_apps(top_app=pkgv, pkg_types={pkgv.model.__class__})
self.refresh_apps(top_app=res['pkg'], pkg_types={res['pkg'].model.__class__})
else:
if self._can_notify_user():
util.notify_user('{}: {}'.format(pkgv.model.name, self.i18n['notification.install.failed']))
util.notify_user('{}: {}'.format(res['pkg'].model.name, self.i18n['notification.install.failed']))
self.checkbox_console.setChecked(True)