mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[arch] fix -> 'rebuild-detector' integration not working when launched from KDE menu or PyCharm
This commit is contained in:
@@ -323,7 +323,7 @@ def check_enabled_services(*names: str) -> Dict[str, bool]:
|
||||
return {s: status[i].strip().lower() == 'enabled' for i, s in enumerate(names) if s}
|
||||
|
||||
|
||||
def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bool = True, custom_env: Optional[dict] = None) -> Tuple[int, Optional[str]]:
|
||||
def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bool = True, custom_env: Optional[dict] = None, stdin: bool = True) -> Tuple[int, Optional[str]]:
|
||||
params = {
|
||||
'args': cmd.split(' ') if not shell else [cmd],
|
||||
'stdout': subprocess.PIPE if output else subprocess.DEVNULL,
|
||||
@@ -331,6 +331,9 @@ def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bo
|
||||
'shell': shell
|
||||
}
|
||||
|
||||
if not stdin:
|
||||
params['stdin'] = subprocess.DEVNULL
|
||||
|
||||
if cwd is not None:
|
||||
params['cwd'] = cwd
|
||||
|
||||
|
||||
@@ -39,4 +39,4 @@ class ArchConfigManager(YAMLConfigManager):
|
||||
'suggest_optdep_uninstall': False,
|
||||
'aur_idx_exp': 1,
|
||||
'categories_exp': 24,
|
||||
'aur_rebuild_detector': False}
|
||||
'aur_rebuild_detector': True}
|
||||
|
||||
@@ -583,10 +583,6 @@ class ArchManager(SoftwareManager):
|
||||
|
||||
def __fill_packages_to_rebuild(self, output: Dict[str, Set[str]]):
|
||||
if rebuild_detector.is_installed():
|
||||
if 'PYCHARM_CLASSPATH' in os.environ:
|
||||
self.logger.warning("'rebuild-detector' is currently not working within PyCharm. Aborting...")
|
||||
return
|
||||
|
||||
self.logger.info("rebuild-detector: checking")
|
||||
to_rebuild = rebuild_detector.list_required_rebuild()
|
||||
output['to_rebuild'].update(to_rebuild)
|
||||
|
||||
@@ -11,7 +11,7 @@ def is_installed() -> bool:
|
||||
|
||||
|
||||
def list_required_rebuild() -> Set[str]:
|
||||
code, output = system.execute(cmd='checkrebuild')
|
||||
code, output = system.execute(cmd='checkrebuild', shell=True, stdin=False)
|
||||
|
||||
required = set()
|
||||
if code == 0 and output:
|
||||
|
||||
Reference in New Issue
Block a user