Commit Graph

586 Commits

Author SHA1 Message Date
reddevillg a07c17b654 fix: clean sources directory on every build
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-16 15:48:53 +08:00
reddevillg 39dcd0b581 fix: add rbind option alongside copy-symlink
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-16 15:48:53 +08:00
reddevillg b5dabe595c fix: fix compiler error on nlohmann_json 3.9.1
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-16 15:48:53 +08:00
reddevillg 82d2037a55 fix: Set LINGLONG_LD_SO_CACHE for compatibility
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-16 15:48:53 +08:00
reddevillg bd74af25ae fix: check directory existence before creation
create_directories may fail with an error code if the destination is a
symbolic link to a directory.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-16 15:48:53 +08:00
reddevillg d9e1e9cd15 fix: treat /etc/localtime as fixed mount node
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-08 14:49:12 +08:00
myml 3d10b81429 fix: skip rewrite for files with a single hard link
为了兼容上个版本直接对source进行重写,这里需要判断原始文件的硬链接数
如果硬链接数为1,则说明原始文件重写过了,就跳过重写
因为多次重写会导致应用出问题
2025-07-04 14:57:11 +08:00
dengbo 214988c3ac chore: remove unused file
Remove 90_legacy.cpp.
2025-07-04 14:57:11 +08:00
dengbo c82b8a5ff9 fix: the context menu of the file manager displays abnormally
Add optional file suffix filtering to exportDir, ensures only files matching the specified suffix are processed.
2025-07-02 10:51:03 +08:00
reddevillg 2b1dc8879c fix: Isolate app-specific patches in dedicated directories
Previously, app-specific patches were identified by matching the patch
filename (without the extension) against the application ID. This
approach was flawed as it caused patch conflicts between different
applications. For example, a patch named `com.app.A.json`, intended
only for `com.app.A`, would be incorrectly applied as a global patch
to `com.app.B`.

This commit introduces a directory-based mechanism to correctly isolate
application-specific patches. All patches for a specific app must now
reside within a subdirectory named after the app ID.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-02 10:51:03 +08:00
reddevillg 0149c3cb77 fix: ensure correct localtime and resolv.conf mounting
Mounting may fail if the file types differed between the build layer and
host (e.g., regular file vs. symbolic link).

Implemented solution through two approaches
1. Build phase: Proactively remove /etc/localtime and /etc/resolv.conf
   from base layer during overlayfs preparation to prevent conflicts
   with host.
2. Container configuration: Introduced dedicated buildMountLocalTime
   and buildNetworkConf methods to handle timezone and resolv.conf
   mounts, with enableSelfAdjustingMount properly managing these cases.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-02 10:51:03 +08:00
myml 2606b26217 fix: invert condition in filterPackageInfosByType
invert condition in filterPackageInfosByType to correctly filter package types
2025-07-02 10:51:03 +08:00
reddevillg 476946b63d fix: copy hidden files
see issue #1246

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-02 10:51:03 +08:00
reddevillg c111b38c69 fix: improve ld.so.cache validation and regeneration
- Add content-based validation for ld.so.conf to detect layer path
  changes
- Include configuration sources hash in ld.so.conf for validation
- In PackageManager GenerateCache always generate cache,
  tryGenerateCache will skip it if cache directory exists
- use memcpy in sha256 to avoid unaligned visit

This ensures that ld.so.cache is properly regenerated when the
underlying layer configuration changes, preventing stale cache issues.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-07-02 10:51:03 +08:00
ComixHe 0bd4bb270a fix: add missing header
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-07-02 10:51:03 +08:00
reddevillg 7ecb38f429 fix: fix compiler error when use CPM nlohmann
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-20 18:15:10 +08:00
reddevillg 13e7061526 fix: correctly pass argument by vector
use quoteBashArg if run with bash -c or write to bash script.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-20 18:15:10 +08:00
myml 3f690ff252 feat: add PackageInfoDisplay schema and update related components
在ll-cli list --json中添加install_time字段,用于表示包的安装时间
2025-06-20 14:54:51 +08:00
reddevillg af9af89c85 fix: fix build failure caused by removed file
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-20 14:54:51 +08:00
reddevillg ca9afbdc63 fix: generate ld cache before builder run
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-20 14:54:51 +08:00
reddevillg 45e482b7f1 fix: Correctly quote arguments in container entrypoint script
This change introduces a quoting mechanism (`quoteArg`) that:
1. Encloses each argument in single quotes.
2. Escapes embedded single quotes within an argument (e.g., `it's`
   becomes `'it'\''s'`).
This ensures that arguments are passed to the `exec` command
in the entrypoint script as single, intact units, even if they
contain spaces or single quotes.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-20 14:54:51 +08:00
ice909 8e867156c2 fix: prevent crash in prune command after loop exit
Added missing return statements after loop.exit() calls in the prune
command
to prevent function execution from continuing after exit is called. This
fixes a crash that occurred when the function continued executing code
after
requesting the event loop to exit, potentially accessing invalid memory.
2025-06-19 15:55:46 +08:00
myml c4038b6bbc fix: handle renaming and copying of non-original linyaps files in exportDir
Updated the exportDir function to rename source files to include a ".linyaps.original" suffix if they are not already named as such, ensuring proper handling during the export process. This change prevents overwriting original files and maintains compatibility with existing export logic.
2025-06-17 21:00:07 +08:00
dengbo be762e3311 fix: dock application icons will lose when upgrading components
If have a custom desktop export directory, you need to ensure compatibility and export the desktop files to both the old and new directories.
2025-06-16 15:23:00 +08:00
myml 783bff6956 fix: update size type to int64_t and initialize struct stat in UABPackager and Builder
Changed the size type from int to int64_t in both Builder and UABPackager to ensure proper handling of larger values. Additionally, initialized struct stat variables to improve code clarity and maintainability.
2025-06-13 18:42:58 +08:00
dengbo 29be0294c7 fix: failed to export uab use com.uniontech.foundation
Adds support for recognizing com.uniontech.foundation.
2025-06-13 11:18:35 +08:00
dengbo a6fde49e93 feat: add sub directory to prevent export file conflicts
Add sub directory using item commit to prevent export file conflicts.
2025-06-13 11:18:25 +08:00
ComixHe bab96b9d4e fix: building failed when using Qt5
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-06-11 16:47:37 +08:00
ComixHe 67aff2635e fix: correct the way of exporting only-app UAB
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-06-11 16:37:05 +08:00
ComixHe 2615ac3525 refactor: remove all generators
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-06-11 16:37:05 +08:00
reddevillg d8a3191d2f fix: Preserve host's HOME env in container.
1. Ensure container HOME env matches the host environment exactly, we
   rely on it before support portal well.
2. remove /run/udev bind, udev database path and file across different
   versions are not guaranteed to be compatible.
3. add all_proxy env to defulat forward list.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-10 18:15:35 +08:00
dengbo b54fd561aa feat: add hooks features
Add hooks features for app install.
2025-06-06 17:33:22 +08:00
reddevillg a77322acc9 fix: preserve set-default compatibility
The set-default command ensures compatibility by setting the priority.
However, its modification to the priority is unidirectional and
one-time, subsequent set-priority invokes will not alter the default
state.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-05 10:20:14 +08:00
reddevillg c6386bdfe5 feat: modify the way container patches work
1. provide application level patches
2. application level patches will apply after global patches

move configure.h.in to src root, becasue lib utils depends on QT,
we don't want to introduce QT in certain scenarios.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-06-04 14:45:07 +08:00
dengbo 286d413070 fix: export desktop to a invalid export path
1. The custom desktop exported directory(CUSTOM_DATA_DIR) should only be in the share dir, not in the subdirectory;
2. LINGLONG_DATA_DIR should be exported;
3. need to update LINGLONG_EXPORT_VERSION to fix export.
2025-06-04 14:10:12 +08:00
ComixHe 881f0d5b1e refactor: move gvfs envs to OstreeRepo ctor
ensure that gvfs module wouldn't be loaded

Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-06-04 10:14:31 +08:00
dengbo 4ed2ad9216 feat: add /etc/hosts to old generators
Bind /etc/hosts to the container to facilitate network debugging.
2025-06-03 09:34:08 +08:00
dengbo 59fbf35dea feat: bind /etc/hosts to container
Bind /etc/hosts to the container to facilitate network debugging.
2025-06-03 09:34:08 +08:00
reddevillg 6e99856fd4 fix: ensure bundle directory is clean
Containers may fail to start if the bundle directory contains residual
files or conflicts from previous run.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-29 11:37:38 +08:00
reddevillg 01455c39f2 feat: support architecture specfied linglong.yaml
1. ll-builder use current directory as project directory.
2. Project yaml file(aka linglong.yaml) must reside within project
   directory or its subdirectories.
3. User can use -f option to specfy a project yaml file.
4. ll-builder will attempt to load project yaml file in the following
   order from the project root directory:
     - linglong.<arch>.yaml (architecture-specific)
     - linglong.yaml (generic)

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-29 11:19:54 +08:00
reddevillg 1fc517735b fix: remove unused code
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-29 11:19:54 +08:00
reddevillg 3e9f0b8902 fix: enable self adjust mount in builder run
If the current RunContext contains innerBinds, self-adjust mount must be
enabled; otherwise, execution may fail due to missing mount points.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-27 17:55:22 +08:00
reddevillg a8127f77de feat: prune support extension
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-27 17:50:05 +08:00
reddevillg c5f2665f12 feat: Support extension environment variables
1. apply extension environment
2. apply app and extension permission binds
3. run ldconfig with -X option in cache generate phase
4. introduce dummy extension which is enabled by default

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-27 17:32:58 +08:00
dengbo a2f07ca8fc fix: uninstall application exception output log
update-desktop-database and update-mime-database will generate system files in
specify a directory. these files do not belong to the applications and should not be
printed in the log.
2025-05-26 13:38:49 +08:00
ComixHe e7814c3cd3 refactor: add getBundlePath
make basePath and bundlePath to be required field

Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-05-22 21:01:09 +08:00
ComixHe 3c85b1ef53 refactor: forwardEnv will forward all envs by default
fix typo

Signed-off-by: ComixHe <heyuming@deepin.org>
2025-05-22 20:25:45 +08:00
reddevillg c32d5d0e7f fix: fix crash when no runtime provided
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-22 19:39:16 +08:00
dengbo 3f19ae56ef fix: update task ends abnormally when there is an application running
Should not terminate the update task when the sub-state is PackageManagerDone.
2025-05-22 16:43:23 +08:00
myml fc16401fa5 feat: handle missing refs gracefully in removeOstreeRef
在删除ref时, 如果ostree不存在对应的ref, 不需要报错,
避免因缓存不一致导致无法卸载应用
2025-05-22 13:08:29 +08:00