mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 03:34:15 +02:00
[appimage] fix -> manual file installation: crashing the application icon is not on the extracted folder root path
This commit is contained in:
@@ -21,6 +21,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- 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.
|
||||
|
||||
### Fixes
|
||||
- AppImage
|
||||
- manual file installation:
|
||||
- crashing the application icon is not on the extracted folder root path [#132](https://github.com/vinifmor/bauh/issues/132)
|
||||
- Arch
|
||||
- not able to upgrade a package that explicitly defines a conflict with itself (e.g: grub)
|
||||
- Downloading some AUR packages sources twice when multi-threaded download is enabled
|
||||
|
||||
@@ -419,10 +419,9 @@ class AppImageManager(SoftwareManager):
|
||||
return f
|
||||
|
||||
def _find_icon_file(self, folder: str) -> str:
|
||||
for r, d, files in os.walk(folder):
|
||||
for f in files:
|
||||
if RE_ICON_ENDS_WITH.match(f):
|
||||
return f
|
||||
for f in glob.glob(folder + ('/**' if not folder.endswith('/') else '**'), recursive=True):
|
||||
if RE_ICON_ENDS_WITH.match(f):
|
||||
return f
|
||||
|
||||
def install(self, pkg: AppImage, root_password: str, disk_loader: DiskCacheLoader, watcher: ProcessWatcher) -> TransactionResult:
|
||||
handler = ProcessHandler(watcher)
|
||||
@@ -508,8 +507,8 @@ class AppImageManager(SoftwareManager):
|
||||
extracted_icon = self._find_icon_file(extracted_folder)
|
||||
|
||||
if extracted_icon:
|
||||
icon_path = out_dir + '/logo.' + extracted_icon.split('.')[-1]
|
||||
shutil.copy('{}/{}'.format(extracted_folder, extracted_icon), icon_path)
|
||||
icon_path = out_dir + '/logo.' + extracted_icon.split('/')[-1].split('.')[-1]
|
||||
shutil.copy(extracted_icon, icon_path)
|
||||
de_content = RE_DESKTOP_ICON.sub('Icon={}\n'.format(icon_path), de_content)
|
||||
pkg.icon_path = icon_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user