diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dafa14f..e02a7045 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.9.7] 2020 +### Features +- Arch + - AUR: + - allowing to edit the PKGBUILD file of a package to be installed/upgraded/downgraded. If enabled, a popup will be displayed during this acctions allowing the PKGBUILD to be edited. +

+ +

+ - mark a given PKGBUILD of a package as editable (if the property above is enabled, the same behavior will be applied) +

+ +

+ - unmark a given PKGBUILD of a package as editable (it prevents the behavior described above to happen) +

+ +

+ ### Improvements - AppImage - Manual file installation/upgrade: @@ -20,6 +36,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - upgrading firstly the keyring packages declared in **SyncFirst** (**/etc/pacman.conf**) to avoid pacman downloading issues - only removing packages after downloading the required ones - "Multi-threaded download (repositories)" is not the default behavior anymore (current pacman download approach is faster). If your settings has this property set as 'Yes', just change it to 'No'. + - AUR: caching the PKGBUILD file used for the package installation/upgrade/downgrade (**~/.cache/bauh/arch/installed/$pkgname/PKGBUILD**) - Flatpak - creating the exports path **~/.local/share/flatpak/exports/share** (if it does not exist) and adding it to install/upgrade/downgrade/remove commands path to prevent warning messages. [#128](https://github.com/vinifmor/bauh/issues/128) @@ -38,6 +55,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - not displaying all packages that must be uninstalled - displaying "required size" for packages that must be uninstalled - some conflict resolution scenarios when upgrading several packages + - AUR: info dialog of installed packages displays the latest PKGBUILD file instead of the one used for installation/upgrade/downgrade - Flatpak - downgrading crashing with version 1.8.X - history: the top commit is returned as "(null)" in version 1.8.X diff --git a/README.md b/README.md index 99da07ed..7f9aa11b 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,9 @@ db_updater: - **refresh mirrors**: allows the user to define multiple mirrors locations and sort by the fastest (`sudo pacman-mirrors -c country1,country2 && sudo pacman-mirrors --fasttrack 5 && sudo pacman -Syy`) - **quick system upgrade**: it executes a default pacman upgrade (`pacman -Syyu --noconfirm`) - **clean cache**: it cleans the pacman cache diretory (default: `/var/cache/pacman/pkg`) + - **mark PKGBUILD as editable**: it marks a given PKGBUILD of a package as editable (a popup with the PKGBUILD will be displayed before upgrading/downgrading this package). Action only available when the configuration property **edit_aur_pkgbuild** is not **false**. + - **unmark PKGBUILD as editable**: reverts the action described above. Action only available when the configuration property **edit_aur_pkgbuild** is not **false**. +- Installed AUR packages have their **PKGBUILD** files cached at **~/.cache/bauh/arch/installed/$pkgname** - Packages with ignored updates are defined at **~/.config/bauh/arch/updates_ignored.txt** - The configuration file is located at **~/.config/bauh/arch.yml** and it allows the following customizations: ``` @@ -190,7 +193,8 @@ aur: true # allows to manage AUR packages repositories: true # allows to manage packages from the configured repositories repositories_mthread_download: false # enable multi-threaded download for repository packages if aria2/axel is installed automatch_providers: true # if a possible provider for a given package dependency exactly matches its name, it will be chosen instead of asking for the user to decide (false). -``` +edit_aur_pkgbuild: false # if the AUR PKGBUILD file should be displayed for edition before the make process. true (PKGBUILD will always be displayed for edition), false (PKGBUILD never will be displayed), null (a popup will ask if the user want to edit the PKGBUILD) +``` - Required dependencies: - **pacman** - **wget** diff --git a/bauh/api/abstract/model.py b/bauh/api/abstract/model.py index 66f56d9b..3cb78981 100644 --- a/bauh/api/abstract/model.py +++ b/bauh/api/abstract/model.py @@ -7,9 +7,12 @@ from bauh.api.constants import CACHE_PATH class CustomSoftwareAction: - def __init__(self, i18_label_key: str, i18n_status_key: str, icon_path: str, manager_method: str, requires_root: bool, manager: "SoftwareManager" = None, backup: bool = False, refresh: bool = True): + def __init__(self, i18n_label_key: str, i18n_status_key: str, icon_path: str, manager_method: str, + requires_root: bool, manager: "SoftwareManager" = None, + backup: bool = False, refresh: bool = True, + i18n_confirm_key: str = None): """ - :param i18_label_key: the i18n key that will be used to display the action name + :param i18n_label_key: the i18n key that will be used to display the action name :param i18n_status_key: the i18n key that will be used to display the action name being executed :param icon_path: the action icon path. Use None for no icon :param manager_method: the SoftwareManager method name that should be called. The method must has the following parameters: (pkg: SoftwarePackage, root_password: str, watcher: ProcessWatcher) @@ -17,8 +20,9 @@ class CustomSoftwareAction: :param backup: if a system backup should be performed before executing the action :param requires_root: :param refresh: if the a full app refresh should be done if the action succeeds + :param i18n_confirm_key: action confirmation message """ - self.i18_label_key = i18_label_key + self.i18n_label_key = i18n_label_key self.i18n_status_key = i18n_status_key self.icon_path = icon_path self.manager_method = manager_method @@ -26,12 +30,13 @@ class CustomSoftwareAction: self.manager = manager self.backup = backup self.refresh = refresh + self.i18n_confirm_key = i18n_confirm_key def __hash__(self): - return self.i18_label_key.__hash__() + self.i18n_status_key.__hash__() + self.manager_method.__hash__() + return self.i18n_label_key.__hash__() + self.i18n_status_key.__hash__() + self.manager_method.__hash__() def __repr__(self): - return "CustomAction (label={}, method={})".format(self.i18_label_key, self.manager_method) + return "CustomAction (label={}, method={})".format(self.i18n_label_key, self.manager_method) class PackageStatus(Enum): @@ -252,6 +257,10 @@ class PackageHistory: self.history = history self.pkg_status_idx = pkg_status_idx + @classmethod + def empyt(cls, pkg: SoftwarePackage): + return cls(pkg=pkg, history=[], pkg_status_idx=-1) + class SuggestionPriority(Enum): LOW = 0 diff --git a/bauh/api/abstract/view.py b/bauh/api/abstract/view.py index bd0adf52..fe39b081 100644 --- a/bauh/api/abstract/view.py +++ b/bauh/api/abstract/view.py @@ -148,10 +148,15 @@ class TwoStateButtonComponent(ViewComponent): self.state = state +class TextInputType(Enum): + SINGLE_LINE = 0 + MULTIPLE_LINES = 1 + + class TextInputComponent(ViewComponent): def __init__(self, label: str, value: str = '', placeholder: str = None, tooltip: str = None, read_only: bool =False, - id_: str = None, only_int: bool = False, max_width: int = -1): + id_: str = None, only_int: bool = False, max_width: int = -1, type_: TextInputType = TextInputType.SINGLE_LINE): super(TextInputComponent, self).__init__(id_=id_) self.label = label self.value = value @@ -160,20 +165,22 @@ class TextInputComponent(ViewComponent): self.read_only = read_only self.only_int = only_int self.max_width = max_width + self.type = type_ def get_value(self) -> str: if self.value is not None: - return self.value.strip() + return self.value else: return '' def set_value(self, val: Optional[str], caller: object = None): - self.value = val + if val != self.value: + self.value = val - if self.observers: - for o in self.observers: - if caller != o: - o.on_change(val) + if self.observers: + for o in self.observers: + if caller != o: + o.on_change(val) def get_int_value(self) -> int: if self.value is not None: diff --git a/bauh/commons/view_utils.py b/bauh/commons/view_utils.py new file mode 100644 index 00000000..11611bd0 --- /dev/null +++ b/bauh/commons/view_utils.py @@ -0,0 +1,18 @@ +from typing import List, Tuple, Optional + +from bauh.api.abstract.view import SelectViewType, InputOption, SingleSelectComponent + + +def new_select(label: str, tip: str, id_: str, opts: List[Tuple[Optional[str], object, Optional[str]]], value: object, max_width: int, + type_: SelectViewType = SelectViewType.RADIO, capitalize_label: bool = True): + inp_opts = [InputOption(label=o[0].capitalize(), value=o[1], tooltip=o[2]) for o in opts] + def_opt = [o for o in inp_opts if o.value == value] + return SingleSelectComponent(label=label, + tooltip=tip, + options=inp_opts, + default_option=def_opt[0] if def_opt else inp_opts[0], + max_per_line=len(inp_opts), + max_width=max_width, + type_=type_, + id_=id_, + capitalize_label=capitalize_label) diff --git a/bauh/gems/appimage/controller.py b/bauh/gems/appimage/controller.py index 087af469..36738aea 100644 --- a/bauh/gems/appimage/controller.py +++ b/bauh/gems/appimage/controller.py @@ -82,13 +82,13 @@ class AppImageManager(SoftwareManager): self.logger = context.logger self.file_downloader = context.file_downloader self.db_locks = {DB_APPS_PATH: Lock(), DB_RELEASES_PATH: Lock()} - self.custom_actions = [CustomSoftwareAction(i18_label_key='appimage.custom_action.install_file', + self.custom_actions = [CustomSoftwareAction(i18n_label_key='appimage.custom_action.install_file', i18n_status_key='appimage.custom_action.install_file.status', manager=self, manager_method='install_file', icon_path=resource.get_path('img/appimage.svg', ROOT_DIR), requires_root=False)] - self.custom_app_actions = [CustomSoftwareAction(i18_label_key='appimage.custom_action.manual_update', + self.custom_app_actions = [CustomSoftwareAction(i18n_label_key='appimage.custom_action.manual_update', i18n_status_key='appimage.custom_action.manual_update.status', manager_method='update_file', requires_root=False, diff --git a/bauh/gems/arch/__init__.py b/bauh/gems/arch/__init__.py index 274fa271..6a1cb5c2 100644 --- a/bauh/gems/arch/__init__.py +++ b/bauh/gems/arch/__init__.py @@ -16,6 +16,7 @@ AUR_INDEX_FILE = '{}/arch.txt'.format(BUILD_DIR) CONFIG_FILE = '{}/arch.yml'.format(CONFIG_PATH) SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/arch/aur_suggestions.txt' UPDATES_IGNORED_FILE = '{}/updates_ignored.txt'.format(CONFIG_DIR) +EDITABLE_PKGBUILDS_FILE = '{}/aur/editable_pkgbuilds.txt'.format(CONFIG_DIR) def get_icon_path() -> str: diff --git a/bauh/gems/arch/config.py b/bauh/gems/arch/config.py index abdb0d27..f2d6b5a1 100644 --- a/bauh/gems/arch/config.py +++ b/bauh/gems/arch/config.py @@ -12,5 +12,6 @@ def read_config(update_file: bool = False) -> dict: "sync_databases_startup": True, 'mirrors_sort_limit': 5, 'repositories_mthread_download': False, - 'automatch_providers': True} + 'automatch_providers': True, + 'edit_aur_pkgbuild': False} return read(CONFIG_FILE, template, update_file=update_file) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 93453c41..06a3fe98 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -22,17 +22,18 @@ from bauh.api.abstract.handler import ProcessWatcher, TaskManager from bauh.api.abstract.model import PackageUpdate, PackageHistory, SoftwarePackage, PackageSuggestion, PackageStatus, \ SuggestionPriority, CustomSoftwareAction from bauh.api.abstract.view import MessageType, FormComponent, InputOption, SingleSelectComponent, SelectViewType, \ - ViewComponent, PanelComponent, MultipleSelectComponent, TextInputComponent, TextComponent + ViewComponent, PanelComponent, MultipleSelectComponent, TextInputComponent, TextComponent, TextInputType from bauh.api.constants import TEMP_DIR from bauh.commons import user, internet from bauh.commons.category import CategoriesDownloader from bauh.commons.config import save_config from bauh.commons.html import bold from bauh.commons.system import SystemProcess, ProcessHandler, new_subprocess, run_cmd, SimpleProcess +from bauh.commons.view_utils import new_select from bauh.gems.arch import BUILD_DIR, aur, pacman, makepkg, message, confirmation, disk, git, \ gpg, URL_CATEGORIES_FILE, CATEGORIES_FILE_PATH, CUSTOM_MAKEPKG_FILE, SUGGESTIONS_FILE, \ CONFIG_FILE, get_icon_path, database, mirrors, sorting, cpu_manager, ARCH_CACHE_PATH, UPDATES_IGNORED_FILE, \ - CONFIG_DIR + CONFIG_DIR, EDITABLE_PKGBUILDS_FILE from bauh.gems.arch.aur import AURClient from bauh.gems.arch.config import read_config from bauh.gems.arch.dependencies import DependenciesAnalyser @@ -65,7 +66,8 @@ class TransactionContext: remote_repo_map: Dict[str, str] = None, provided_map: Dict[str, Set[str]] = None, remote_provided_map: Dict[str, Set[str]] = None, aur_idx: Set[str] = None, missing_deps: List[Tuple[str, str]] = None, installed: Set[str] = None, removed: Dict[str, SoftwarePackage] = None, - disk_loader: DiskCacheLoader = None, disk_cache_updater: Thread = None): + disk_loader: DiskCacheLoader = None, disk_cache_updater: Thread = None, + new_pkg: bool = False): self.name = name self.base = base self.maintainer = maintainer @@ -90,13 +92,15 @@ class TransactionContext: self.removed = removed self.disk_loader = disk_loader self.disk_cache_updater = disk_cache_updater + self.pkgbuild_edited = False + self.new_pkg = new_pkg @classmethod def gen_context_from(cls, pkg: ArchPackage, arch_config: dict, root_password: str, handler: ProcessHandler) -> "TransactionContext": return cls(name=pkg.name, base=pkg.get_base_name(), maintainer=pkg.maintainer, repository=pkg.repository, arch_config=arch_config, watcher=handler.watcher, handler=handler, skip_opt_deps=True, change_progress=True, root_password=root_password, dependency=False, - installed=set(), removed={}) + installed=set(), removed={}, new_pkg=not pkg.installed) def get_base_name(self): return self.base if self.base else self.name @@ -173,26 +177,26 @@ class ArchManager(SoftwareManager): self.deps_analyser = DependenciesAnalyser(self.aur_client, self.i18n) self.http_client = context.http_client self.custom_actions = { - 'sys_up': CustomSoftwareAction(i18_label_key='arch.custom_action.upgrade_system', + 'sys_up': CustomSoftwareAction(i18n_label_key='arch.custom_action.upgrade_system', i18n_status_key='arch.custom_action.upgrade_system.status', manager_method='upgrade_system', icon_path=get_icon_path(), requires_root=True, backup=True, manager=self), - 'ref_dbs': CustomSoftwareAction(i18_label_key='arch.custom_action.refresh_dbs', + 'ref_dbs': CustomSoftwareAction(i18n_label_key='arch.custom_action.refresh_dbs', i18n_status_key='arch.sync_databases.substatus', manager_method='sync_databases', icon_path=get_icon_path(), requires_root=True, manager=self), - 'ref_mirrors': CustomSoftwareAction(i18_label_key='arch.custom_action.refresh_mirrors', + 'ref_mirrors': CustomSoftwareAction(i18n_label_key='arch.custom_action.refresh_mirrors', i18n_status_key='arch.task.mirrors', manager_method='refresh_mirrors', icon_path=get_icon_path(), requires_root=True, manager=self), - 'clean_cache': CustomSoftwareAction(i18_label_key='arch.custom_action.clean_cache', + 'clean_cache': CustomSoftwareAction(i18n_label_key='arch.custom_action.clean_cache', i18n_status_key='arch.custom_action.clean_cache.status', manager_method='clean_cache', icon_path=get_icon_path(), @@ -416,7 +420,8 @@ class ArchManager(SoftwareManager): res.total = len(res.installed) + len(res.new) return res - def _fill_aur_pkgs(self, aur_pkgs: dict, output: list, disk_loader: DiskCacheLoader, internet_available: bool): + def _fill_aur_pkgs(self, aur_pkgs: dict, output: List[ArchPackage], disk_loader: DiskCacheLoader, internet_available: bool, + arch_config: dict): downgrade_enabled = git.is_enabled() if internet_available: @@ -424,9 +429,11 @@ class ArchManager(SoftwareManager): pkgsinfo = self.aur_client.get_info(aur_pkgs.keys()) if pkgsinfo: + editable_pkgbuilds = self._read_editable_pkgbuilds() if arch_config['edit_aur_pkgbuild'] is not False else None for pkgdata in pkgsinfo: pkg = self.mapper.map_api_data(pkgdata, aur_pkgs, self.categories) pkg.downgrade_enabled = downgrade_enabled + pkg.pkgbuild_editable = pkg.name in editable_pkgbuilds if editable_pkgbuilds is not None else None if disk_loader: disk_loader.fill(pkg) @@ -434,11 +441,13 @@ class ArchManager(SoftwareManager): output.append(pkg) - return + return + except requests.exceptions.ConnectionError: self.logger.warning('Could not retrieve installed AUR packages API data. It seems the internet connection is off.') self.logger.info("Reading only local AUR packages data") + editable_pkgbuilds = self._read_editable_pkgbuilds() if arch_config['edit_aur_pkgbuild'] is not False else None for name, data in aur_pkgs.items(): pkg = ArchPackage(name=name, version=data.get('version'), latest_version=data.get('version'), description=data.get('description'), @@ -446,6 +455,7 @@ class ArchManager(SoftwareManager): pkg.categories = self.categories.get(pkg.name) pkg.downgrade_enabled = downgrade_enabled + pkg.pkgbuild_editable = pkg.name in editable_pkgbuilds if editable_pkgbuilds is not None else None if disk_loader: disk_loader.fill(pkg) @@ -538,7 +548,7 @@ class ArchManager(SoftwareManager): map_threads = [] if aur_pkgs: - t = Thread(target=self._fill_aur_pkgs, args=(aur_pkgs, pkgs, disk_loader, internet_available), daemon=True) + t = Thread(target=self._fill_aur_pkgs, args=(aur_pkgs, pkgs, disk_loader, internet_available, arch_config), daemon=True) t.start() map_threads.append(t) @@ -1207,6 +1217,8 @@ class ArchManager(SoftwareManager): self._revert_ignored_updates(to_uninstall) + self._remove_from_editable_pkgbuilds(context.name) + self._update_progress(context, 100) return uninstalled @@ -1314,8 +1326,12 @@ class ArchManager(SoftwareManager): run_cmd('git clone ' + URL_GIT.format(base_name), print_error=False, cwd=temp_dir) clone_path = '{}/{}'.format(temp_dir, base_name) + srcinfo_path = '{}/.SRCINFO'.format(clone_path) + if not os.path.exists(srcinfo_path): + return PackageHistory.empyt(pkg) + commits = git.list_commits(clone_path) if commits: @@ -1572,7 +1588,62 @@ class ArchManager(SoftwareManager): return True + def _display_pkgbuild_for_editing(self, pkgname: str, watcher: ProcessWatcher, pkgbuild_path: str) -> bool: + with open(pkgbuild_path) as f: + pkgbuild = f.read() + + pkgbuild_input = TextInputComponent(label='', value=pkgbuild, type_=TextInputType.MULTIPLE_LINES) + + watcher.request_confirmation(title='PKGBUILD ({})'.format(pkgname), + body='', + components=[pkgbuild_input], + confirmation_label=self.i18n['proceed'].capitalize(), + deny_button=False) + + if pkgbuild_input.get_value() != pkgbuild: + with open(pkgbuild_path, 'w+') as f: + f.write(pkgbuild_input.get_value()) + + return makepkg.update_srcinfo('/'.join(pkgbuild_path.split('/')[0:-1])) + + return False + + def _ask_for_pkgbuild_edition(self, pkgname: str, arch_config: dict, watcher: ProcessWatcher, pkgbuild_path: str) -> bool: + if pkgbuild_path: + if arch_config['edit_aur_pkgbuild'] is None: + if watcher.request_confirmation(title=self.i18n['confirmation'].capitalize(), + body=self.i18n['arch.aur.action.edit_pkgbuild.body'].format( + bold(pkgname))): + return self._display_pkgbuild_for_editing(pkgname, watcher, pkgbuild_path) + elif arch_config['edit_aur_pkgbuild']: + return self._display_pkgbuild_for_editing(pkgname, watcher, pkgbuild_path) + + return False + + def _edit_pkgbuild_and_update_context(self, context: TransactionContext): + if context.new_pkg or context.name in self._read_editable_pkgbuilds(): + if self._ask_for_pkgbuild_edition(pkgname=context.name, + arch_config=context.config, + watcher=context.watcher, + pkgbuild_path='{}/PKGBUILD'.format(context.project_dir)): + context.pkgbuild_edited = True + srcinfo = aur.map_srcinfo(makepkg.gen_srcinfo(context.project_dir)) + + if srcinfo: + context.name = srcinfo['pkgname'] + context.base = srcinfo['pkgbase'] + + if context.pkg: + for pkgattr, srcattr in {'name': 'pkgname', + 'package_base': 'pkgbase', + 'version': 'pkgversion', + 'latest_version': 'pkgversion', + 'license': 'license', + 'description': 'pkgdesc'}.items(): + setattr(context.pkg, pkgattr, srcinfo.get(srcattr, getattr(context.pkg, pkgattr))) + def _build(self, context: TransactionContext) -> bool: + self._edit_pkgbuild_and_update_context(context) self._pre_download_source(context.project_dir, context.watcher) self._update_progress(context, 50) @@ -1608,6 +1679,7 @@ class ArchManager(SoftwareManager): context.install_file = '{}/{}'.format(context.project_dir, gen_file[0]) if self._install(context=context): + self._save_pkgbuild(context) if context.dependency or context.skip_opt_deps: return True @@ -1620,6 +1692,24 @@ class ArchManager(SoftwareManager): return False + def _save_pkgbuild(self, context: TransactionContext): + cache_path = ArchPackage.disk_cache_path(context.name) + if not os.path.exists(cache_path): + try: + os.mkdir(cache_path) + except: + print("Could not create cache directory '{}'".format(cache_path)) + traceback.print_exc() + return + + src_pkgbuild = '{}/PKGBUILD'.format(context.project_dir) + dest_pkgbuild = '{}/PKGBUILD'.format(cache_path) + try: + shutil.copy(src_pkgbuild, dest_pkgbuild) + except: + context.watcher.print("Could not copy '{}' to '{}'".format(src_pkgbuild, dest_pkgbuild)) + traceback.print_exc() + def _ask_and_install_missing_deps(self, context: TransactionContext, missing_deps: List[Tuple[str, str]]) -> bool: context.watcher.change_substatus(self.i18n['arch.missing_deps_found'].format(bold(context.name))) @@ -2086,12 +2176,21 @@ class ArchManager(SoftwareManager): else: res = self._install_from_repository(install_context) - if res and os.path.exists(pkg.get_disk_data_path()): - with open(pkg.get_disk_data_path()) as f: - data = f.read() - if data: - data = json.loads(data) - pkg.fill_cached_data(data) + if res: + pkg.name = install_context.name # changes the package name in case the PKGBUILD was edited + + if os.path.exists(pkg.get_disk_data_path()): + with open(pkg.get_disk_data_path()) as f: + data = f.read() + if data: + data = json.loads(data) + pkg.fill_cached_data(data) + + if install_context.new_pkg and install_context.config['edit_aur_pkgbuild'] is not False and pkg.repository == 'aur': + if install_context.pkgbuild_edited: + pkg.pkgbuild_editable = self._add_as_editable_pkgbuild(pkg.name) + else: + pkg.pkgbuild_editable = not self._remove_from_editable_pkgbuilds(pkg.name) installed = [] @@ -2311,7 +2410,7 @@ class ArchManager(SoftwareManager): def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent: local_config = read_config() - max_width = floor(screen_width * 0.15) + max_width = floor(screen_width * 0.22) db_sync_start = self._gen_bool_selector(id_='sync_dbs_start', label_key='arch.config.sync_dbs', @@ -2370,7 +2469,19 @@ class ArchManager(SoftwareManager): tooltip=self.i18n['arch.config.mirrors_sort_limit.tip'], only_int=True, max_width=max_width, - value=local_config['mirrors_sort_limit'] if isinstance(local_config['mirrors_sort_limit'], int) else '') + value=local_config['mirrors_sort_limit'] if isinstance(local_config['mirrors_sort_limit'], int) else ''), + new_select(label=self.i18n['arch.config.edit_aur_pkgbuild'], + tip=self.i18n['arch.config.edit_aur_pkgbuild.tip'], + id_='edit_aur_pkgbuild', + opts=[(self.i18n['yes'].capitalize(), True, None), + (self.i18n['no'].capitalize(), False, None), + (self.i18n['ask'].capitalize(), None, None), + ], + value=local_config['edit_aur_pkgbuild'], + max_width=max_width, + type_=SelectViewType.RADIO, + capitalize_label=False) + ] return PanelComponent([FormComponent(fields, spaces=False)]) @@ -2389,6 +2500,7 @@ class ArchManager(SoftwareManager): config['mirrors_sort_limit'] = form_install.get_component('mirrors_sort_limit').get_int_value() config['repositories_mthread_download'] = form_install.get_component('mthread_download').get_selected() config['automatch_providers'] = form_install.get_component('autoprovs').get_selected() + config['edit_aur_pkgbuild'] = form_install.get_component('edit_aur_pkgbuild').get_selected() try: save_config(config, CONFIG_FILE) @@ -2614,3 +2726,56 @@ class ArchManager(SoftwareManager): def revert_ignored_update(self, pkg: ArchPackage): self._revert_ignored_updates({pkg.name}) pkg.update_ignored = False + + def _add_as_editable_pkgbuild(self, pkgname: str): + try: + Path('/'.join(EDITABLE_PKGBUILDS_FILE.split('/')[0:-1])).mkdir(parents=True, exist_ok=True) + + editable = self._read_editable_pkgbuilds() + + if pkgname not in editable: + editable.add(pkgname) + + self._write_editable_pkgbuilds(editable) + return True + except: + traceback.print_exc() + return False + + def _write_editable_pkgbuilds(self, editable: Set[str]): + if editable: + with open(EDITABLE_PKGBUILDS_FILE, 'w+') as f: + for name in sorted([*editable]): + f.write('{}\n'.format(name)) + else: + os.remove(EDITABLE_PKGBUILDS_FILE) + + def _remove_from_editable_pkgbuilds(self, pkgname: str): + if os.path.exists(EDITABLE_PKGBUILDS_FILE): + try: + editable = self._read_editable_pkgbuilds() + + if pkgname in editable: + editable.remove(pkgname) + + self._write_editable_pkgbuilds(editable) + except: + traceback.print_exc() + return False + + return True + + def _read_editable_pkgbuilds(self) -> Set[str]: + if os.path.exists(EDITABLE_PKGBUILDS_FILE): + with open(EDITABLE_PKGBUILDS_FILE) as f: + return {l.strip() for l in f.readlines() if l and l.strip()} + + return set() + + def enable_pkgbuild_edition(self, pkg: ArchPackage, root_password: str, watcher: ProcessWatcher): + if self._add_as_editable_pkgbuild(pkg.name): + pkg.pkgbuild_editable = True + + def disable_pkgbuild_edition(self, pkg: ArchPackage, root_password: str, watcher: ProcessWatcher): + if self._remove_from_editable_pkgbuilds(pkg.name): + pkg.pkgbuild_editable = False diff --git a/bauh/gems/arch/makepkg.py b/bauh/gems/arch/makepkg.py index 1b9ee6d6..f76d96cb 100644 --- a/bauh/gems/arch/makepkg.py +++ b/bauh/gems/arch/makepkg.py @@ -55,3 +55,14 @@ def make(pkgdir: str, optimize: bool, handler: ProcessHandler) -> Tuple[bool, st handler.watcher.print('Custom optimized makepkg.conf ( {} ) not found'.format(CUSTOM_MAKEPKG_FILE)) return handler.handle_simple(SimpleProcess(cmd, cwd=pkgdir)) + + +def update_srcinfo(project_dir: str) -> bool: + updated_src = run_cmd('makepkg --printsrcinfo', cwd=project_dir) + + if updated_src: + with open('{}/.SRCINFO'.format(project_dir), 'w+') as f: + f.write(updated_src) + return True + + return False diff --git a/bauh/gems/arch/mapper.py b/bauh/gems/arch/mapper.py index f489789a..e4311a2b 100644 --- a/bauh/gems/arch/mapper.py +++ b/bauh/gems/arch/mapper.py @@ -1,3 +1,4 @@ +import os import re from datetime import datetime @@ -110,10 +111,15 @@ class ArchDataMapper: return False def fill_package_build(self, pkg: ArchPackage): - res = self.http_client.get(pkg.get_pkg_build_url()) + cached_pkgbuild = pkg.get_cached_pkgbuild_path() + if os.path.exists(cached_pkgbuild): + with open(cached_pkgbuild) as f: + pkg.pkgbuild = f.read() + else: + res = self.http_client.get(pkg.get_pkg_build_url()) - if res and res.status_code == 200 and res.text: - pkg.pkgbuild = res.text + if res and res.status_code == 200 and res.text: + pkg.pkgbuild = res.text def map_api_data(self, apidata: dict, installed: dict, categories: dict) -> ArchPackage: data = installed.get(apidata.get('Name')) if installed else None diff --git a/bauh/gems/arch/model.py b/bauh/gems/arch/model.py index fc3d452e..d72c256d 100644 --- a/bauh/gems/arch/model.py +++ b/bauh/gems/arch/model.py @@ -1,13 +1,27 @@ import datetime from typing import List, Set -from bauh.api.abstract.model import SoftwarePackage +from bauh.api.abstract.model import SoftwarePackage, CustomSoftwareAction from bauh.commons import resource from bauh.gems.arch import ROOT_DIR, ARCH_CACHE_PATH from bauh.view.util.translation import I18n CACHED_ATTRS = {'command', 'icon_path', 'repository', 'maintainer', 'desktop_entry', 'categories'} +ACTIONS_AUR_ENABLE_PKGBUILD_EDITION = [CustomSoftwareAction(i18n_label_key='arch.action.enable_pkgbuild_edition', + i18n_status_key='arch.action.enable_pkgbuild_edition.status', + i18n_confirm_key='arch.action.enable_pkgbuild_edition.confirm', + requires_root=False, + manager_method='enable_pkgbuild_edition', + icon_path=resource.get_path('img/mark_pkgbuild.svg', ROOT_DIR))] + +ACTIONS_AUR_DISABLE_PKGBUILD_EDITION = [CustomSoftwareAction(i18n_label_key='arch.action.disable_pkgbuild_edition', + i18n_status_key='arch.action.disable_pkgbuild_edition', + i18n_confirm_key='arch.action.disable_pkgbuild_edition.confirm', + requires_root=False, + manager_method='disable_pkgbuild_edition', + icon_path=resource.get_path('img/unmark_pkgbuild.svg', ROOT_DIR))] + class ArchPackage(SoftwarePackage): @@ -16,7 +30,8 @@ class ArchPackage(SoftwarePackage): first_submitted: datetime.datetime = None, last_modified: datetime.datetime = None, maintainer: str = None, url_download: str = None, pkgbuild: str = None, repository: str = None, desktop_entry: str = None, installed: bool = False, srcinfo: dict = None, dependencies: Set[str] = None, - categories: List[str] = None, i18n: I18n = None, update_ignored: bool = False, arch: str = None): + categories: List[str] = None, i18n: I18n = None, update_ignored: bool = False, arch: str = None, + pkgbuild_editable: bool = None): super(ArchPackage, self).__init__(name=name, version=version, latest_version=latest_version, description=description, installed=installed, categories=categories) @@ -38,6 +53,8 @@ class ArchPackage(SoftwarePackage): self.arch = arch self.i18n = i18n self.update_ignored = update_ignored + self.view_name = name # name displayed on the view + self.pkgbuild_editable = pkgbuild_editable # if the PKGBUILD can be edited by the user (only for AUR) @staticmethod def disk_cache_path(pkgname: str): @@ -48,7 +65,7 @@ class ArchPackage(SoftwarePackage): return 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=' + self.package_base def has_history(self): - return self.installed and self.repository == 'aur' + return self.can_be_downgraded() def has_info(self): return True @@ -148,4 +165,18 @@ class ArchPackage(SoftwarePackage): def __eq__(self, other): if isinstance(other, ArchPackage): + if self.view_name is not None and other.view_name is not None: + return self.view_name == other.view_name and self.repository == other.repository + return self.name == other.name and self.repository == other.repository + + def get_cached_pkgbuild_path(self) -> str: + return '{}/PKGBUILD'.format(self.get_disk_cache_path()) + + def get_custom_supported_actions(self) -> List[CustomSoftwareAction]: + if self.installed and self.pkgbuild_editable is not None and self.repository == 'aur': + if self.pkgbuild_editable: + return ACTIONS_AUR_DISABLE_PKGBUILD_EDITION + else: + return ACTIONS_AUR_ENABLE_PKGBUILD_EDITION + diff --git a/bauh/gems/arch/resources/img/mark_pkgbuild.svg b/bauh/gems/arch/resources/img/mark_pkgbuild.svg new file mode 100644 index 00000000..d9ab0b45 --- /dev/null +++ b/bauh/gems/arch/resources/img/mark_pkgbuild.svg @@ -0,0 +1,120 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bauh/gems/arch/resources/img/unmark_pkgbuild.svg b/bauh/gems/arch/resources/img/unmark_pkgbuild.svg new file mode 100644 index 00000000..43ced941 --- /dev/null +++ b/bauh/gems/arch/resources/img/unmark_pkgbuild.svg @@ -0,0 +1,129 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bauh/gems/arch/resources/locale/ca b/bauh/gems/arch/resources/locale/ca index 12a4dd5d..a8b0ae4d 100644 --- a/bauh/gems/arch/resources/locale/ca +++ b/bauh/gems/arch/resources/locale/ca @@ -3,6 +3,12 @@ arch.action.db_locked.body.l2=It is necessary to unlock it to continue. arch.action.db_locked.confirmation=Unlock and continue arch.action.db_locked.error=It was not possible to unlock the database. arch.action.db_locked.title=Database locked +arch.action.disable_pkgbuild_edition=Unmark PKGBUILD as editable +arch.action.disable_pkgbuild_edition.confirm=Unmark PKGBUILD of {} as editable ? +arch.action.disable_pkgbuild_edition.status=Unmarking PKGBUILD as editable +arch.action.enable_pkgbuild_edition=Mark PKGBUILD as editable +arch.action.enable_pkgbuild_edition.confirm=Mark PKGBUILD of {} as editable ? +arch.action.enable_pkgbuild_edition.status=Marking PKGBUILD as editable arch.aur.install.pgp.body=Per a instal·lar {} cal rebre les claus PGP següents arch.aur.install.pgp.receive_fail=Could not receive PGP key {} arch.aur.install.pgp.sign_fail=No s’ha pogut rebre la clau PGP {} @@ -26,6 +32,8 @@ arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.clean_cache=Elimina les versions antigues arch.config.clean_cache.tip=Si cal eliminar les versions antigues d'un paquet emmagatzemat al disc durant la desinstal·lació +arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=If the PKGBUILD file of an AUR package should be displayed for editing before its installation/upgrade/downgrade arch.config.mirrors_sort_limit=Mirrors sort limit arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that will be used for speed sorting. Use 0 for no limit or leave it blank to disable sorting. arch.config.optimize=optimize diff --git a/bauh/gems/arch/resources/locale/de b/bauh/gems/arch/resources/locale/de index 053c80d3..add22c05 100644 --- a/bauh/gems/arch/resources/locale/de +++ b/bauh/gems/arch/resources/locale/de @@ -3,6 +3,12 @@ arch.action.db_locked.body.l2=It is necessary to unlock it to continue. arch.action.db_locked.confirmation=Unlock and continue arch.action.db_locked.error=It was not possible to unlock the database. arch.action.db_locked.title=Database locked +arch.action.disable_pkgbuild_edition=Unmark PKGBUILD as editable +arch.action.disable_pkgbuild_edition.confirm=Unmark PKGBUILD of {} as editable ? +arch.action.disable_pkgbuild_edition.status=Unmarking PKGBUILD as editable +arch.action.enable_pkgbuild_edition=Mark PKGBUILD as editable +arch.action.enable_pkgbuild_edition.confirm=Mark PKGBUILD of {} as editable ? +arch.action.enable_pkgbuild_edition.status=Marking PKGBUILD as editable arch.aur.install.pgp.body=Um {} zu installieren sind folgende PGP Schlüssel nötig arch.aur.install.pgp.receive_fail=PGP Schlüssel {} konnte nicht empfangen werden arch.aur.install.pgp.sign_fail=PGP Schlüssel {} konnte nicht signiert werden @@ -26,6 +32,8 @@ arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.clean_cache=Remove old versions arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall +arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=If the PKGBUILD file of an AUR package should be displayed for editing before its installation/upgrade/downgrade arch.config.mirrors_sort_limit=Mirrors sort limit arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that will be used for speed sorting. Use 0 for no limit or leave it blank to disable sorting. arch.config.optimize=optimize diff --git a/bauh/gems/arch/resources/locale/en b/bauh/gems/arch/resources/locale/en index 197975e8..581655f1 100644 --- a/bauh/gems/arch/resources/locale/en +++ b/bauh/gems/arch/resources/locale/en @@ -3,6 +3,13 @@ arch.action.db_locked.body.l2=It is necessary to unlock it to continue. arch.action.db_locked.confirmation=Unlock and continue arch.action.db_locked.error=It was not possible to unlock the database. arch.action.db_locked.title=Database locked +arch.action.disable_pkgbuild_edition=Unmark PKGBUILD as editable +arch.action.disable_pkgbuild_edition.confirm=Unmark PKGBUILD of {} as editable ? +arch.action.disable_pkgbuild_edition.status=Unmarking PKGBUILD as editable +arch.action.enable_pkgbuild_edition=Mark PKGBUILD as editable +arch.action.enable_pkgbuild_edition.confirm=Mark PKGBUILD of {} as editable ? +arch.action.enable_pkgbuild_edition.status=Marking PKGBUILD as editable +arch.aur.action.edit_pkgbuild.body=Edit the PKGBUILD file of {} before continuing ? arch.aur.install.pgp.body=To install {} is necessary to receive the following PGP keys arch.aur.install.pgp.receive_fail=Could not receive PGP key {} arch.aur.install.pgp.sign_fail=Could not sign PGP key {} @@ -26,6 +33,8 @@ arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.clean_cache=Remove old versions arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall +arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=If the PKGBUILD file of an AUR package should be displayed for editing before its installation/upgrade/downgrade arch.config.mirrors_sort_limit=Mirrors sort limit arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that will be used for speed sorting. Use 0 for no limit or leave it blank to disable sorting. arch.config.optimize=optimize diff --git a/bauh/gems/arch/resources/locale/es b/bauh/gems/arch/resources/locale/es index b69b0b21..01ffa1fe 100644 --- a/bauh/gems/arch/resources/locale/es +++ b/bauh/gems/arch/resources/locale/es @@ -3,6 +3,12 @@ arch.action.db_locked.body.l2=Es necesario desbloquearla para continuar. arch.action.db_locked.confirmation=Desbloquear y continuar arch.action.db_locked.error=No fue posible desbloquear la base de datos. arch.action.db_locked.title=Base de dados bloqueada +arch.action.disable_pkgbuild_edition=Desmarcar PKGBUILD como editable +arch.action.disable_pkgbuild_edition.confirm=Desmarcar PKGBUILD de {} como editable ? +arch.action.disable_pkgbuild_edition.status=Desmarcando PKGBUILD como editable +arch.action.enable_pkgbuild_edition=Marcar PKGBUILD como editable +arch.action.enable_pkgbuild_edition.confirm=Marcar PKGBUILD de {} como editable ? +arch.action.enable_pkgbuild_edition.status=Marcando PKGBUILD como editable arch.aur.install.pgp.body=Para instalar {} es necesario recibir las siguientes claves PGP arch.aur.install.pgp.receive_fail=Could not receive PGP key {} arch.aur.install.pgp.sign_fail=No fue posible recibir la clave PGP {} @@ -26,6 +32,8 @@ arch.config.automatch_providers=Autodefinir proveedores de dependencia arch.config.automatch_providers.tip=Elige automáticamente qué proveedor se usará para una dependencia de paquete cuando ambos nombres son iguales. arch.config.clean_cache=Eliminar versiones antiguas arch.config.clean_cache.tip=Si las versiones antiguas de un paquete almacenado en el disco deben ser eliminadas durante la desinstalación +arch.config.edit_aur_pkgbuild=Editar PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=Si el archivo PKGBUILD de un paquete AUR debe ser exhibido para edición antes de su instalación/actualización/degradación arch.config.mirrors_sort_limit=Límite de ordenación de espejos arch.config.mirrors_sort_limit.tip=Define el número máximo de espejos que se utilizarán para la ordenación por velocidad. Use 0 para no limitar o déjelo en blanco para deshabilitar la clasificación. arch.config.optimize=optimizar diff --git a/bauh/gems/arch/resources/locale/it b/bauh/gems/arch/resources/locale/it index 4294be60..50301ffb 100644 --- a/bauh/gems/arch/resources/locale/it +++ b/bauh/gems/arch/resources/locale/it @@ -3,6 +3,12 @@ arch.action.db_locked.body.l2=It is necessary to unlock it to continue. arch.action.db_locked.confirmation=Unlock and continue arch.action.db_locked.error=It was not possible to unlock the database. arch.action.db_locked.title=Database locked +arch.action.disable_pkgbuild_edition=Unmark PKGBUILD as editable +arch.action.disable_pkgbuild_edition.confirm=Unmark PKGBUILD of {} as editable ? +arch.action.disable_pkgbuild_edition.status=Unmarking PKGBUILD as editable +arch.action.enable_pkgbuild_edition=Mark PKGBUILD as editable +arch.action.enable_pkgbuild_edition.confirm=Mark PKGBUILD of {} as editable ? +arch.action.enable_pkgbuild_edition.status=Marking PKGBUILD as editable arch.aur.install.pgp.body=Per installare {} è necessario ricevere le seguenti chiavi PGP arch.aur.install.pgp.receive_fail=Impossibile ricevere la chiave PGP {} arch.aur.install.pgp.sign_fail=Impossibile firmare la chiave PGP {} @@ -26,6 +32,8 @@ arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.clean_cache=Rimuovi le vecchie versioni arch.config.clean_cache.tip=Se le vecchie versioni di un pacchetto memorizzate sul disco devono essere rimosse durante la disinstallazione +arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=If the PKGBUILD file of an AUR package should be displayed for editing before its installation/upgrade/downgrade arch.config.mirrors_sort_limit=Mirrors sort limit arch.config.mirrors_sort_limit.tip=Defines the maximum number of mirrors that will be used for speed sorting. Use 0 for no limit or leave it blank to disable sorting. arch.config.optimize=optimize diff --git a/bauh/gems/arch/resources/locale/pt b/bauh/gems/arch/resources/locale/pt index e5ba5d0e..109e02ad 100644 --- a/bauh/gems/arch/resources/locale/pt +++ b/bauh/gems/arch/resources/locale/pt @@ -3,6 +3,13 @@ arch.action.db_locked.body.l2=É necessário desbloquea-lo para continuar. arch.action.db_locked.confirmation=Desbloquear e continuar arch.action.db_locked.error=Não foi possível desbloquear o banco de dados. arch.action.db_locked.title=Banco de dados bloqueado +arch.action.disable_pkgbuild_edition=Desmarcar PKGBUILD como editável +arch.action.disable_pkgbuild_edition.confirm=Desmarcar o PKGBUILD de {} como editável ? +arch.action.disable_pkgbuild_edition.status=Desmarcando PKGBUILD como editável +arch.action.enable_pkgbuild_edition=Marcando PKGBUILD como editável +arch.action.enable_pkgbuild_edition.confirm=Marcar o PKGBUILD de {} como editável ? +arch.action.enable_pkgbuild_edition.status=Marcando PKGBUILD como editável +arch.aur.action.edit_pkgbuild.body=Editar o arquivo PKGBUILD de {} antes de continuar ? arch.aur.install.pgp.body=Para instalar {} é necessário receber as seguintes chaves PGP arch.aur.install.pgp.receive_fail=Não foi possível receber a chave PGP {} arch.aur.install.pgp.sign_fail=Não foi possível assinar a chave PGP {} @@ -26,6 +33,8 @@ arch.config.automatch_providers=Auto-definir provedores de dependências arch.config.automatch_providers.tip=Escolhe automaticamente qual provedor será utilizado para determinada dependência de um pacote caso os nomes de ambos sejam iguais. arch.config.clean_cache=Remover versões antigas arch.config.clean_cache.tip=Se versões antigas de um pacote armazenadas em disco devem ser removidas durante a desinstalação +arch.config.edit_aur_pkgbuild=Editar PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=Se o arquivo PKGBUILD de um pacote do AUR deve ser exibido para edição antes da instalação/atualização/reversão arch.config.mirrors_sort_limit=Limite de ordenação de espelhos arch.config.mirrors_sort_limit.tip=Define o número máximo de espelhos que serão utilizados para a ordenação por velocidade. Use 0 para não limitar ou deixe em branco para desabilitar a ordenação. arch.config.optimize=Otimizar diff --git a/bauh/gems/arch/resources/locale/ru b/bauh/gems/arch/resources/locale/ru index ed3444f3..cd80b584 100644 --- a/bauh/gems/arch/resources/locale/ru +++ b/bauh/gems/arch/resources/locale/ru @@ -3,6 +3,12 @@ arch.action.db_locked.body.l2=It is necessary to unlock it to continue. arch.action.db_locked.confirmation=Unlock and continue arch.action.db_locked.error=It was not possible to unlock the database. arch.action.db_locked.title=Database locked +arch.action.disable_pkgbuild_edition=Unmark PKGBUILD as editable +arch.action.disable_pkgbuild_edition.confirm=Unmark PKGBUILD of {} as editable ? +arch.action.disable_pkgbuild_edition.status=Unmarking PKGBUILD as editable +arch.action.enable_pkgbuild_edition=Mark PKGBUILD as editable +arch.action.enable_pkgbuild_edition.confirm=Mark PKGBUILD of {} as editable ? +arch.action.enable_pkgbuild_edition.status=Marking PKGBUILD as editable arch.aur.install.pgp.body=Для установки {} необходимо получить следующие PGP ключи arch.aur.install.pgp.receive_fail=Не удалось получить PGP-ключ {} arch.aur.install.pgp.sign_fail=Не удалось подписать PGP-ключ {} @@ -26,6 +32,8 @@ arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.clean_cache=Remove old versions arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall +arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=If the PKGBUILD file of an AUR package should be displayed for editing before its installation/upgrade/downgrade arch.config.mirrors_sort_limit=Ограничение сортировки зеркал arch.config.mirrors_sort_limit.tip=Определяет максимальное количество зеркал, которые будут использоваться для сортировки по скорости. Используйте 0 для No limit или оставьте его пустым, чтобы отключить сортировку. arch.config.optimize=Оптимизация diff --git a/bauh/gems/arch/resources/locale/tr b/bauh/gems/arch/resources/locale/tr index ebe03ea9..ce5ed856 100644 --- a/bauh/gems/arch/resources/locale/tr +++ b/bauh/gems/arch/resources/locale/tr @@ -3,6 +3,12 @@ arch.action.db_locked.body.l2=Devam etmek için veritabanı kilidini açmak gere arch.action.db_locked.confirmation=Veritabanı kilidini aç ve devam et arch.action.db_locked.error=Veritabanının kilidini açmak mümkün olmadı. arch.action.db_locked.title=Veritabanı kilitli +arch.action.disable_pkgbuild_edition=Unmark PKGBUILD as editable +arch.action.disable_pkgbuild_edition.confirm=Unmark PKGBUILD of {} as editable ? +arch.action.disable_pkgbuild_edition.status=Unmarking PKGBUILD as editable +arch.action.enable_pkgbuild_edition=Mark PKGBUILD as editable +arch.action.enable_pkgbuild_edition.confirm=Mark PKGBUILD of {} as editable ? +arch.action.enable_pkgbuild_edition.status=Marking PKGBUILD as editable arch.aur.install.pgp.body={} kurmak için aşağıdaki PGP anahtarlarını almak gereklidir arch.aur.install.pgp.receive_fail=PGP anahtarı alınamadı {} arch.aur.install.pgp.sign_fail=PGP anahtarı {} imzalanamadı @@ -26,6 +32,8 @@ arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.clean_cache=Önbelleği temizle arch.config.clean_cache.tip=Disk üzerinde kurulu bir paketin eski sürümlerinin kaldırma sırasında kaldırılıp kaldırılmayacağı +arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) +arch.config.edit_aur_pkgbuild.tip=If the PKGBUILD file of an AUR package should be displayed for editing before its installation/upgrade/downgrade arch.config.mirrors_sort_limit=Yansı sıralama sınırı arch.config.mirrors_sort_limit.tip=Hız sıralama için kullanılacak maksimum yansı sayısını tanımlar. Sınırsız olması için 0 kullanın veya sıralamayı devre dışı bırakmak için boş bırakın. arch.config.optimize=optimize diff --git a/bauh/gems/snap/controller.py b/bauh/gems/snap/controller.py index 6bf69e60..43eea85a 100644 --- a/bauh/gems/snap/controller.py +++ b/bauh/gems/snap/controller.py @@ -40,10 +40,11 @@ class SnapManager(SoftwareManager): self.info_path = None self.custom_actions = [ CustomSoftwareAction(i18n_status_key='snap.action.refresh.status', - i18_label_key='snap.action.refresh.label', + i18n_label_key='snap.action.refresh.label', icon_path=resource.get_path('img/refresh.svg', context.get_view_path()), manager_method='refresh', - requires_root=True) + requires_root=True, + i18n_confirm_key='snap.action.refresh.confirm') ] def get_info_path(self) -> str: diff --git a/bauh/gems/snap/resources/locale/ca b/bauh/gems/snap/resources/locale/ca index d5c4966c..04da1593 100644 --- a/bauh/gems/snap/resources/locale/ca +++ b/bauh/gems/snap/resources/locale/ca @@ -1,4 +1,5 @@ gem.snap.info=Aplicacions publicades a https://snapcraft.io/store +snap.action.refresh.confirm=Actualitza {} ? snap.action.refresh.label=Actualitza snap.action.refresh.status=S’està actualitzant snap.info.commands=ordres diff --git a/bauh/gems/snap/resources/locale/de b/bauh/gems/snap/resources/locale/de index 5883a71a..da013a37 100644 --- a/bauh/gems/snap/resources/locale/de +++ b/bauh/gems/snap/resources/locale/de @@ -1,4 +1,5 @@ gem.snap.info=Anwendungen von https://snapcraft.io/store +snap.action.refresh.confirm=Erneuern {} ? snap.action.refresh.label=Erneuern snap.action.refresh.status=Erneuern snap.info.commands=Kommandos diff --git a/bauh/gems/snap/resources/locale/en b/bauh/gems/snap/resources/locale/en index 33dcfcbc..5dc82da9 100644 --- a/bauh/gems/snap/resources/locale/en +++ b/bauh/gems/snap/resources/locale/en @@ -1,4 +1,5 @@ gem.snap.info=Applications published at https://snapcraft.io/store +snap.action.refresh.confirm=Refresh {} ? snap.action.refresh.label=Refresh snap.action.refresh.status=Refreshing snap.info.commands=commands diff --git a/bauh/gems/snap/resources/locale/es b/bauh/gems/snap/resources/locale/es index 15319d96..f6494044 100644 --- a/bauh/gems/snap/resources/locale/es +++ b/bauh/gems/snap/resources/locale/es @@ -1,4 +1,5 @@ gem.snap.info=Aplicativos publicados en https://snapcraft.io/store +snap.action.refresh.confirm=Actualizar {} ? snap.action.refresh.label=Actualizar snap.action.refresh.status=Actualizando snap.info.commands=comandos diff --git a/bauh/gems/snap/resources/locale/it b/bauh/gems/snap/resources/locale/it index ed6a1d96..6d66aee1 100644 --- a/bauh/gems/snap/resources/locale/it +++ b/bauh/gems/snap/resources/locale/it @@ -1,4 +1,5 @@ gem.snap.info=Applicazioni pubblicate su https://snapcraft.io/store +snap.action.refresh.confirm=Ripristina {} ? snap.action.refresh.label=Ripristina snap.action.refresh.status=Ripristinare snap.info.commands=commands diff --git a/bauh/gems/snap/resources/locale/pt b/bauh/gems/snap/resources/locale/pt index 0b3ad650..35223efa 100644 --- a/bauh/gems/snap/resources/locale/pt +++ b/bauh/gems/snap/resources/locale/pt @@ -1,4 +1,5 @@ gem.snap.info=Aplicativos publicados em https://snapcraft.io/store +snap.action.refresh.confirm=Atualizar {} ? snap.action.refresh.label=Atualizar snap.action.refresh.status=Atualizando snap.info.commands=comandos diff --git a/bauh/gems/snap/resources/locale/ru b/bauh/gems/snap/resources/locale/ru index 1b3a3564..a7d60891 100644 --- a/bauh/gems/snap/resources/locale/ru +++ b/bauh/gems/snap/resources/locale/ru @@ -1,4 +1,5 @@ gem.snap.info=Приложения, опубликованные на https://snapcraft.io/store +snap.action.refresh.confirm=Обновить {} ? snap.action.refresh.label=Обновить snap.action.refresh.status=Обновляется snap.info.commands=Команды diff --git a/bauh/gems/snap/resources/locale/tr b/bauh/gems/snap/resources/locale/tr index 9e9e5fd7..9347c7ce 100644 --- a/bauh/gems/snap/resources/locale/tr +++ b/bauh/gems/snap/resources/locale/tr @@ -1,4 +1,5 @@ gem.snap.info=https://snapcraft.io/store adresinde yayınlanan uygulamalar +snap.action.refresh.confirm=Yenile {} ? snap.action.refresh.label=Yenile snap.action.refresh.status=Yenileniyor snap.info.commands=komutlar diff --git a/bauh/gems/web/controller.py b/bauh/gems/web/controller.py index b0ec0426..365fb8f5 100644 --- a/bauh/gems/web/controller.py +++ b/bauh/gems/web/controller.py @@ -69,7 +69,7 @@ class WebApplicationManager(SoftwareManager): self.env_thread = None self.suggestions_downloader = suggestions_downloader self.suggestions = {} - self.custom_actions = [CustomSoftwareAction(i18_label_key='web.custom_action.clean_env', + self.custom_actions = [CustomSoftwareAction(i18n_label_key='web.custom_action.clean_env', i18n_status_key='web.custom_action.clean_env.status', manager=self, manager_method='clean_environment', diff --git a/bauh/view/core/controller.py b/bauh/view/core/controller.py index b7379f9e..5affb4db 100755 --- a/bauh/view/core/controller.py +++ b/bauh/view/core/controller.py @@ -53,14 +53,14 @@ class GenericSoftwareManager(SoftwareManager): self.config = config self.settings_manager = settings_manager self.http_client = context.http_client - self.extra_actions = [CustomSoftwareAction(i18_label_key='action.reset', + self.extra_actions = [CustomSoftwareAction(i18n_label_key='action.reset', i18n_status_key='action.reset.status', manager_method='reset', manager=self, icon_path=resource.get_path('img/logo.svg'), requires_root=False, refresh=False)] - self.dynamic_extra_actions = {CustomSoftwareAction(i18_label_key='action.backups', + self.dynamic_extra_actions = {CustomSoftwareAction(i18n_label_key='action.backups', i18n_status_key='action.backups.status', manager_method='launch_timeshift', manager=self, diff --git a/bauh/view/core/settings.py b/bauh/view/core/settings.py index dddcfece..ef920d6a 100644 --- a/bauh/view/core/settings.py +++ b/bauh/view/core/settings.py @@ -12,6 +12,7 @@ from bauh.api.abstract.download import FileDownloader from bauh.api.abstract.view import ViewComponent, TabComponent, InputOption, TextComponent, MultipleSelectComponent, \ PanelComponent, FormComponent, TabGroupComponent, SingleSelectComponent, SelectViewType, TextInputComponent, \ FileChooserComponent, RangeInputComponent +from bauh.commons.view_utils import new_select from bauh.view.core import config, timeshift from bauh.view.core.config import read_config from bauh.view.core.downloader import AdaptableFileDownloader @@ -100,7 +101,7 @@ class GenericSettingsManager: max_width=default_width, id_="icon_exp") - select_trim_up = self._gen_select(label=self.i18n['core.config.trim.after_upgrade'], + select_trim_up = new_select(label=self.i18n['core.config.trim.after_upgrade'], tip=self.i18n['core.config.trim.after_upgrade.tip'], value=core_config['disk']['trim']['after_upgrade'], max_width=default_width, @@ -141,7 +142,7 @@ class GenericSettingsManager: if current_mthread_client not in available_mthread_clients: current_mthread_client = None - return self._gen_select(label=self.i18n['core.config.download.multithreaded_client'], + return new_select(label=self.i18n['core.config.download.multithreaded_client'], tip=self.i18n['core.config.download.multithreaded_client.tip'], id_="mthread_client", max_width=default_width, @@ -293,7 +294,7 @@ class GenericSettingsManager: max_width=default_width, id_="sugs_by_type") - inp_reboot = self._gen_select(label=self.i18n['core.config.updates.reboot'], + inp_reboot = new_select(label=self.i18n['core.config.updates.reboot'], tip=self.i18n['core.config.updates.reboot.tip'], id_='ask_for_reboot', max_width=default_width, @@ -479,64 +480,51 @@ class GenericSettingsManager: (self.i18n['no'].capitalize(), False, None), (self.i18n['ask'].capitalize(), None, None)] - install_mode = self._gen_select(label=self.i18n['core.config.backup.install'], - tip=None, - value=core_config['backup']['install'], - opts=ops_opts, - max_width=default_width, - id_='install') + install_mode = new_select(label=self.i18n['core.config.backup.install'], + tip=None, + value=core_config['backup']['install'], + opts=ops_opts, + max_width=default_width, + id_='install') - uninstall_mode = self._gen_select(label=self.i18n['core.config.backup.uninstall'], - tip=None, - value=core_config['backup']['uninstall'], - opts=ops_opts, - max_width=default_width, - id_='uninstall') + uninstall_mode = new_select(label=self.i18n['core.config.backup.uninstall'], + tip=None, + value=core_config['backup']['uninstall'], + opts=ops_opts, + max_width=default_width, + id_='uninstall') - upgrade_mode = self._gen_select(label=self.i18n['core.config.backup.upgrade'], - tip=None, - value=core_config['backup']['upgrade'], - opts=ops_opts, - max_width=default_width, - id_='upgrade') + upgrade_mode = new_select(label=self.i18n['core.config.backup.upgrade'], + tip=None, + value=core_config['backup']['upgrade'], + opts=ops_opts, + max_width=default_width, + id_='upgrade') - downgrade_mode = self._gen_select(label=self.i18n['core.config.backup.downgrade'], - tip=None, - value=core_config['backup']['downgrade'], - opts=ops_opts, - max_width=default_width, - id_='downgrade') + downgrade_mode = new_select(label=self.i18n['core.config.backup.downgrade'], + tip=None, + value=core_config['backup']['downgrade'], + opts=ops_opts, + max_width=default_width, + id_='downgrade') - mode = self._gen_select(label=self.i18n['core.config.backup.mode'], - tip=None, - value=core_config['backup']['mode'], - opts=[ - (self.i18n['core.config.backup.mode.incremental'], 'incremental', - self.i18n['core.config.backup.mode.incremental.tip']), - (self.i18n['core.config.backup.mode.only_one'], 'only_one', - self.i18n['core.config.backup.mode.only_one.tip']) - ], - max_width=default_width, - id_='mode') - type_ = self._gen_select(label=self.i18n['type'].capitalize(), - tip=None, - value=core_config['backup']['type'], - opts=[('rsync', 'rsync', None), ('btrfs', 'btrfs', None)], - max_width=default_width, - id_='type') + mode = new_select(label=self.i18n['core.config.backup.mode'], + tip=None, + value=core_config['backup']['mode'], + opts=[ + (self.i18n['core.config.backup.mode.incremental'], 'incremental', + self.i18n['core.config.backup.mode.incremental.tip']), + (self.i18n['core.config.backup.mode.only_one'], 'only_one', + self.i18n['core.config.backup.mode.only_one.tip']) + ], + max_width=default_width, + id_='mode') + type_ = new_select(label=self.i18n['type'].capitalize(), + tip=None, + value=core_config['backup']['type'], + opts=[('rsync', 'rsync', None), ('btrfs', 'btrfs', None)], + max_width=default_width, + id_='type') sub_comps = [FormComponent([enabled_opt, mode, type_, install_mode, uninstall_mode, upgrade_mode, downgrade_mode], spaces=False)] return TabComponent(self.i18n['core.config.tab.backup'].capitalize(), PanelComponent(sub_comps), None, 'core.bkp') - - def _gen_select(self, label: str, tip: str, id_: str, opts: List[tuple], value: object, max_width: int, type_: SelectViewType = SelectViewType.RADIO): - inp_opts = [InputOption(label=o[0].capitalize(), value=o[1], tooltip=o[2]) for o in opts] - def_opt = [o for o in inp_opts if o.value == value] - return SingleSelectComponent(label=label, - tooltip=tip, - options=inp_opts, - default_option=def_opt[0] if def_opt else inp_opts[0], - max_per_line=len(inp_opts), - max_width=max_width, - type_=type_, - id_=id_) - diff --git a/bauh/view/qt/apps_table.py b/bauh/view/qt/apps_table.py index 6c717b3b..397f4165 100644 --- a/bauh/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -12,7 +12,7 @@ from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidg from bauh.api.abstract.cache import MemoryCache from bauh.api.abstract.model import PackageStatus -from bauh.commons.html import strip_html +from bauh.commons.html import strip_html, bold from bauh.view.qt import dialog from bauh.view.qt.colors import GREEN, BROWN from bauh.view.qt.components import IconButton @@ -167,15 +167,20 @@ class AppsTable(QTableWidget): if bool(pkg.model.get_custom_supported_actions()): for action in pkg.model.get_custom_supported_actions(): - item = QAction(self.i18n[action.i18_label_key]) + item = QAction(self.i18n[action.i18n_label_key]) if action.icon_path: item.setIcon(QIcon(action.icon_path)) def custom_action(): + if action.i18n_confirm_key: + body = self.i18n[action.i18n_confirm_key].format(bold(pkg.model.name)) + else: + body = '{} ?'.format(self.i18n[action.i18n_label_key]) + if dialog.ask_confirmation( - title=self.i18n[action.i18_label_key], - body=self._parag('{} {} ?'.format(self.i18n[action.i18_label_key], self._bold(str(pkg)))), + title=self.i18n[action.i18n_label_key], + body=self._parag(body), i18n=self.i18n): self.window.begin_execute_custom_action(pkg, action) diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index 90603fdf..006d4f95 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -7,11 +7,11 @@ from PyQt5.QtCore import Qt, QSize, QTimer from PyQt5.QtGui import QIcon, QPixmap, QIntValidator, QCursor from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \ QLabel, QSizePolicy, QLineEdit, QToolButton, QHBoxLayout, QFormLayout, QFileDialog, QTabWidget, QVBoxLayout, \ - QSlider, QScrollArea, QFrame, QAction, QSpinBox + QSlider, QScrollArea, QFrame, QAction, QSpinBox, QPlainTextEdit from bauh.api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType, \ TextInputComponent, FormComponent, FileChooserComponent, ViewComponent, TabGroupComponent, PanelComponent, \ - TwoStateButtonComponent, TextComponent, SpacerComponent, RangeInputComponent, ViewObserver + TwoStateButtonComponent, TextComponent, SpacerComponent, RangeInputComponent, ViewObserver, TextInputType from bauh.view.qt import css from bauh.view.qt.colors import RED from bauh.view.util import resource @@ -434,7 +434,24 @@ class QLineEditObserver(QLineEdit, ViewObserver): super(QLineEditObserver, self).__init__(**kwargs) def on_change(self, change: str): - self.setText(change if change is not None else '') + if self.text() != change: + self.setText(change if change is not None else '') + + +class QPlainTextEditObserver(QPlainTextEdit, ViewObserver): + + def __init__(self, **kwargs): + super(QPlainTextEditObserver, self).__init__(**kwargs) + + def on_change(self, change: str): + self.setText(change) + + def setText(self, text: str): + if text != self.toPlainText(): + self.setPlainText(text if text is not None else '') + + def setCursorPosition(self, idx: int): + self.textCursor().setPosition(idx) class TextInputQt(QGroupBox): @@ -449,7 +466,7 @@ class TextInputQt(QGroupBox): if self.model.max_width > 0: self.setMaximumWidth(self.model.max_width) - self.text_input = QLineEditObserver() + self.text_input = QLineEditObserver() if model.type == TextInputType.SINGLE_LINE else QPlainTextEditObserver() if model.only_int: self.text_input.setValidator(QIntValidator()) @@ -469,8 +486,9 @@ class TextInputQt(QGroupBox): self.model.observers.append(self.text_input) self.layout().addWidget(self.text_input, 0, 1) - def _update_model(self, text: str): - self.model.set_value(val=text, caller=self) + def _update_model(self, *args): + change = args[0] if args else self.text_input.toPlainText() + self.model.set_value(val=change, caller=self) class MultipleSelectQt(QGroupBox): @@ -775,29 +793,29 @@ class FormQt(QGroupBox): return tip_icon def _new_text_input(self, c: TextInputComponent) -> Tuple[QLabel, QLineEdit]: - line_edit = QLineEditObserver() + view = QLineEditObserver() if c.type == TextInputType.SINGLE_LINE else QPlainTextEditObserver() if c.only_int: - line_edit.setValidator(QIntValidator()) + view.setValidator(QIntValidator()) if c.tooltip: - line_edit.setToolTip(c.tooltip) + view.setToolTip(c.tooltip) if c.placeholder: - line_edit.setPlaceholderText(c.placeholder) + view.setPlaceholderText(c.placeholder) if c.value: - line_edit.setText(str(c.value) if c.value else '') - line_edit.setCursorPosition(0) + view.setText(str(c.value) if c.value else '') + view.setCursorPosition(0) if c.read_only: - line_edit.setEnabled(False) + view.setEnabled(False) def update_model(text: str): - c.set_value(val=text, caller=line_edit) + c.set_value(val=text, caller=view) - line_edit.textChanged.connect(update_model) - c.observers.append(line_edit) + view.textChanged.connect(update_model) + c.observers.append(view) label = QWidget() label.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) @@ -812,7 +830,7 @@ class FormQt(QGroupBox): if c.tooltip: label.layout().addWidget(self.gen_tip_icon(c.tooltip)) - return label, self._wrap(line_edit, c) + return label, self._wrap(view, c) def _new_range_input(self, model: RangeInputComponent) -> QSpinBox: spinner = QSpinBox() diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index 33631520..5ff7b61d 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -1394,7 +1394,7 @@ class ManageWindow(QWidget): def begin_execute_custom_action(self, pkg: PackageView, action: CustomSoftwareAction): if pkg is None and not dialog.ask_confirmation(title=self.i18n['confirmation'].capitalize(), - body=self.i18n['custom_action.proceed_with'].capitalize().format('"{}"'.format(self.i18n[action.i18_label_key])), + body=self.i18n['custom_action.proceed_with'].capitalize().format('"{}"'.format(self.i18n[action.i18n_label_key])), icon=QIcon(action.icon_path) if action.icon_path else QIcon(resource.get_path('img/logo.svg')), i18n=self.i18n): return False @@ -1450,7 +1450,7 @@ class ManageWindow(QWidget): self.settings_window.show() def _map_custom_action(self, action: CustomSoftwareAction) -> QAction: - custom_action = QAction(self.i18n[action.i18_label_key]) + custom_action = QAction(self.i18n[action.i18n_label_key]) if action.icon_path: try: diff --git a/bauh/view/resources/img/ignore_update.svg b/bauh/view/resources/img/ignore_update.svg index e1148552..804dafb4 100644 --- a/bauh/view/resources/img/ignore_update.svg +++ b/bauh/view/resources/img/ignore_update.svg @@ -7,128 +7,128 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - inkscape:version="1.0 (4035a4fb49, 2020-05-01)" - height="24" - width="23.515306" - sodipodi:docname="ignore_update.svg" - xml:space="preserve" - viewBox="0 0 23.515307 24" - y="0px" - x="0px" + version="1.1" id="Capa_1" - version="1.1">image/svg+xml + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="739" + id="namedview973" + showgrid="false" + showborder="true" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:zoom="9.4874926" + inkscape:cx="25.836555" + inkscape:cy="15.198259" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="Capa_1" /> + id="g942" + transform="translate(-99.310818,-31.505501)"> + id="g944" + transform="translate(-99.310818,-31.505501)"> + id="g946" + transform="translate(-99.310818,-31.505501)"> + id="g948" + transform="translate(-99.310818,-31.505501)"> + id="g950" + transform="translate(-99.310818,-31.505501)"> + id="g952" + transform="translate(-99.310818,-31.505501)"> + id="g954" + transform="translate(-99.310818,-31.505501)"> + id="g956" + transform="translate(-99.310818,-31.505501)"> + id="g958" + transform="translate(-99.310818,-31.505501)"> + id="g960" + transform="translate(-99.310818,-31.505501)"> + id="g962" + transform="translate(-99.310818,-31.505501)"> + id="g964" + transform="translate(-99.310818,-31.505501)"> + id="g966" + transform="translate(-99.310818,-31.505501)"> + id="g968" + transform="translate(-99.310818,-31.505501)"> + id="g970" + transform="translate(-99.310818,-31.505501)"> + id="g940"> + style="fill:#ff0000" + id="g938"> + d="M 213.333,0 C 95.467,0 0,95.467 0,213.333 0,331.199 95.467,426.666 213.333,426.666 331.199,426.666 426.667,331.2 426.667,213.333 426.667,95.466 331.2,0 213.333,0 Z M 42.667,213.333 c 0,-94.293 76.373,-170.667 170.667,-170.667 39.467,0 75.627,13.547 104.533,35.947 L 78.613,317.867 C 56.213,288.96 42.667,252.8 42.667,213.333 Z M 213.333,384 C 173.866,384 137.706,370.453 108.8,348.053 L 348.053,108.8 C 370.453,137.707 384,173.867 384,213.333 384,307.627 307.627,384 213.333,384 Z" /> diff --git a/pictures/releases/0.9.7/aur_pkgbuild.png b/pictures/releases/0.9.7/aur_pkgbuild.png new file mode 100644 index 00000000..edfe89cd Binary files /dev/null and b/pictures/releases/0.9.7/aur_pkgbuild.png differ diff --git a/pictures/releases/0.9.7/mark_pkgbuild.png b/pictures/releases/0.9.7/mark_pkgbuild.png new file mode 100644 index 00000000..438068ce Binary files /dev/null and b/pictures/releases/0.9.7/mark_pkgbuild.png differ diff --git a/pictures/releases/0.9.7/unmark_pkgbuild.png b/pictures/releases/0.9.7/unmark_pkgbuild.png new file mode 100644 index 00000000..6e356129 Binary files /dev/null and b/pictures/releases/0.9.7/unmark_pkgbuild.png differ