mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 22:24:14 +02:00
[improvement][web] separate build folder for standard and root users
This commit is contained in:
@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- improved how missing dependencies are checked when installing a new package ( the old way was not identifying some missing dependencies of **anbox-git** ). It is possible to use the old algorithm by setting **simple_checking** to **true** in **~/.config/bauh/arch.yml**. More information at [README](https://github.com/vinifmor/bauh/#aur--arch-).
|
- improved how missing dependencies are checked when installing a new package ( the old way was not identifying some missing dependencies of **anbox-git** ). It is possible to use the old algorithm by setting **simple_checking** to **true** in **~/.config/bauh/arch.yml**. More information at [README](https://github.com/vinifmor/bauh/#aur--arch-).
|
||||||
- checking architecture dependencies (x86_64, i686)
|
- checking architecture dependencies (x86_64, i686)
|
||||||
- architecture dependencies are displayed on the info window as well
|
- architecture dependencies are displayed on the info window as well
|
||||||
|
- Web:
|
||||||
|
- separate temp build folder for standard and root users
|
||||||
- UI:
|
- UI:
|
||||||
- **Settings** available as a tray action as well
|
- **Settings** available as a tray action as well
|
||||||
- minor improvements
|
- minor improvements
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from bauh.api.constants import DESKTOP_ENTRIES_DIR, CONFIG_PATH
|
from bauh.api.constants import DESKTOP_ENTRIES_DIR, CONFIG_PATH
|
||||||
|
from bauh.commons import user
|
||||||
|
|
||||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
WEB_PATH = '{}/.local/share/bauh/web'.format(Path.home())
|
WEB_PATH = '{}/.local/share/bauh/web'.format(Path.home())
|
||||||
@@ -21,7 +22,7 @@ DESKTOP_ENTRY_PATH_PATTERN = DESKTOP_ENTRIES_DIR + '/bauh.web.{name}.desktop'
|
|||||||
URL_FIX_PATTERN = "https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/fix/{url}.js"
|
URL_FIX_PATTERN = "https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/fix/{url}.js"
|
||||||
URL_SUGGESTIONS = "https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/suggestions.yml"
|
URL_SUGGESTIONS = "https://raw.githubusercontent.com/vinifmor/bauh-files/master/web/suggestions.yml"
|
||||||
UA_CHROME = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'
|
UA_CHROME = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'
|
||||||
TEMP_PATH = '/tmp/bauh/web'
|
TEMP_PATH = '/tmp/bauh{}/web'.format('_root' if user.is_root() else '')
|
||||||
SEARCH_INDEX_FILE = '{}/index.yml'.format(TEMP_PATH)
|
SEARCH_INDEX_FILE = '{}/index.yml'.format(TEMP_PATH)
|
||||||
SUGGESTIONS_CACHE_FILE = '{}/suggestions.txt'.format(TEMP_PATH)
|
SUGGESTIONS_CACHE_FILE = '{}/suggestions.txt'.format(TEMP_PATH)
|
||||||
CONFIG_FILE = '{}/web.yml'.format(CONFIG_PATH)
|
CONFIG_FILE = '{}/web.yml'.format(CONFIG_PATH)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ from bauh.commons.config import save_config
|
|||||||
from bauh.commons.html import bold
|
from bauh.commons.html import bold
|
||||||
from bauh.commons.system import ProcessHandler, get_dir_size, get_human_size_str
|
from bauh.commons.system import ProcessHandler, get_dir_size, get_human_size_str
|
||||||
from bauh.gems.web import INSTALLED_PATH, nativefier, DESKTOP_ENTRY_PATH_PATTERN, URL_FIX_PATTERN, ENV_PATH, UA_CHROME, \
|
from bauh.gems.web import INSTALLED_PATH, nativefier, DESKTOP_ENTRY_PATH_PATTERN, URL_FIX_PATTERN, ENV_PATH, UA_CHROME, \
|
||||||
SEARCH_INDEX_FILE, SUGGESTIONS_CACHE_FILE, ROOT_DIR, CONFIG_FILE
|
SEARCH_INDEX_FILE, SUGGESTIONS_CACHE_FILE, ROOT_DIR, CONFIG_FILE, TEMP_PATH
|
||||||
from bauh.gems.web.config import read_config
|
from bauh.gems.web.config import read_config
|
||||||
from bauh.gems.web.environment import EnvironmentUpdater, EnvironmentComponent
|
from bauh.gems.web.environment import EnvironmentUpdater, EnvironmentComponent
|
||||||
from bauh.gems.web.model import WebApplication
|
from bauh.gems.web.model import WebApplication
|
||||||
@@ -615,10 +615,10 @@ class WebApplicationManager(SoftwareManager):
|
|||||||
pkg.custom_icon = icon_path
|
pkg.custom_icon = icon_path
|
||||||
|
|
||||||
# writting the icon in a temporary folder to be used by the nativefier process
|
# writting the icon in a temporary folder to be used by the nativefier process
|
||||||
temp_icon_path = '/tmp/bauh/web/{}'.format(pkg.icon_url.split('/')[-1])
|
temp_icon_path = '{}/{}'.format(TEMP_PATH, pkg.icon_url.split('/')[-1])
|
||||||
install_options.append('--icon={}'.format(temp_icon_path))
|
install_options.append('--icon={}'.format(temp_icon_path))
|
||||||
|
|
||||||
self.logger.info("Writting a temp suggestion icon at {}".format(temp_icon_path))
|
self.logger.info("Writing a temp suggestion icon at {}".format(temp_icon_path))
|
||||||
with open(temp_icon_path, 'wb+') as f:
|
with open(temp_icon_path, 'wb+') as f:
|
||||||
f.write(icon_bytes)
|
f.write(icon_bytes)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user