Commit Graph

95 Commits

Author SHA1 Message Date
reddevillg bb4ed7b3e8 feat: Add --force option to uninstall command
build / ubuntu_24.04 (push) Has been cancelled Details
build / ubuntu_22.04 (push) Has been cancelled Details
coverage / codecov (push) Has been cancelled Details
Introduces a `--force` flag to the `ll-cli uninstall` command, allowing
users to forcefully uninstall packages that are typically protected,
such as base and runtime dependencies.

This commit also includes significant refactoring:
- The dependency pulling logic in `PackageManager::pullDependency` has
  been refactored to prioritize newer remote packages over existing local
  ones, ensuring dependencies are kept up-to-date.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-11-11 16:28:50 +08:00
wrj97 d1091e3955 feat: enable git submodule fetching with environment variable control
1. Add environment variable support to Cmd class for process execution
2. Set GIT_SUBMODULES=true when executing source fetch scripts
3. Conditionally execute git submodule commands based on GIT_SUBMODULES
env var
4. Fix member variable naming in Cmd class (command -> m_command)
5. Pass environment variables to command existence checking process

This change allows git submodules to be fetched only when explicitly
enabled through the GIT_SUBMODULES environment variable, providing
better control over the source fetching process. The environment
variable mechanism was added to the Cmd utility class to support this
feature, and existing command execution logic was updated to use proper
member variable naming conventions.

Log: Added conditional git submodule fetching support in source fetcher

Influence:
1. Test git repository fetching with submodules enabled
2. Verify git repository fetching without submodules (default behavior)
3. Test environment variable passing in command execution
4. Verify command existence checking with environment variables
5. Test source fetching for projects with and without submodules
6. Validate that existing git fetch functionality remains unchanged

feat: 通过环境变量控制启用 git 子模块获取

1. 为 Cmd 类添加环境变量支持以执行进程
2. 在执行源码获取脚本时设置 GIT_SUBMODULES=true
3. 基于 GIT_SUBMODULES 环境变量条件性执行 git 子模块命令
4. 修正 Cmd 类中的成员变量命名(command -> m_command)
5. 将环境变量传递给命令存在性检查进程

此变更允许仅在通过 GIT_SUBMODULES 环境变量明确启用时才获取 git 子模块,
从而更好地控制源码获取过程。为支持此功能,向 Cmd 工具类添加了环境变量机
制,并更新了现有命令执行逻辑以使用正确的成员变量命名约定。

Log: 在源码获取器中添加条件性 git 子模块获取支持

Influence:
1. 测试启用子模块的 git 仓库获取
2. 验证不带子模块的 git 仓库获取(默认行为)
3. 测试命令执行中的环境变量传递
4. 验证带环境变量的命令存在性检查
5. 测试带和不带子模块的项目源码获取
6. 验证现有 git 获取功能保持不变
2025-09-17 13:26:36 +08:00
reddevillg d6e0931419 refactor: Move uninstall logic to package manager service
This refactoring moves the core uninstall logic from the cli to PM.

Key changes:
- Support uninstall extension
- Added robust error handling for uninstalling:
  - Returns an error if multiple versions are installed and the user
    input is ambiguous.
  - Prevents uninstalling 'base' or 'runtime' packages directly.
  - Checks if an application or its dependencies are running before
    proceeding.

Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-09-09 14:05:10 +08:00
myml bdf2cde3c9 feat: add mirror enable/disable functionality for repos
1. Added new CLI commands `enable-mirror` and `disable-mirror` for
repository management
2. Implemented handler functions for mirror enable/disable operations in
both ll-builder and ll-cli
3. Modified repo config handling to support mirrorEnabled flag as
optional boolean
4. Updated test cases to include mirrorEnabled field in test data
5. Improved repo alias handling by using value_or to fallback to
repoName when alias is not provided

These changes allow users to control mirror functionality for
repositories through CLI commands, providing more flexibility in
repository configuration. The mirrorEnabled flag is now properly handled
in the OSTree repo configuration.

feat: 为仓库添加镜像启用/禁用功能

1. 新增了用于仓库管理的`enable-mirror`和`disable-mirror` CLI命令
2. 在ll-builder和ll-cli中实现了镜像启用/禁用操作的处理函数
3. 修改了仓库配置处理以支持可选的mirrorEnabled标志
4. 更新了测试用例,在测试数据中包含mirrorEnabled字段
5. 通过使用value_or在别名未提供时回退到repoName,改进了仓库别名处理

这些变更允许用户通过CLI命令控制仓库的镜像功能,为仓库配置提供更多灵活
性。现在在OSTree仓库配置中正确处理了mirrorEnabled标志。
2025-07-10 19:28:36 +08:00
myml b22c58959e feat: add PackageInfoDisplay schema and update related components
在ll-cli list --json中添加install_time字段,用于表示包的安装时间
2025-06-20 14:32:41 +08:00
reddevillg 49c6660326 feat: add extension schema
Signed-off-by: reddevillg <reddevillg@gmail.com>
2025-05-20 17:18:42 +08:00
ice909 ca321628aa feat: add support for installing packages from specific repositories
1. Added a new --repo option to the install command to specify a
repository for installation
2. Enhanced repository management with priority-based package resolution
3. Implemented methods to get, promote and recover repository priorities
4. Updated package installation logic to respect repository selection
5. Improved error handling for module not found cases
6. Added ReferenceWithRepo struct to track package references with their
source repositories
2025-05-15 12:23:25 +08:00
ice909 bb3624da8e feat: enhance package search with multi-repository support
1. Added repository field to search parameters requiring specifying
repos to search
2. Modified search implementation to support searching in multiple
repositories
3. Restructured search results to group packages by repository source
4. Added --repo option to the CLI search command
5. Updated display format to show repository information in search
results
6. Improved filtering logic to work with the repository-grouped package
structure
7. Added PackageManager1PruneResult type to separate it from search
results
2025-05-09 17:05:28 +08:00
ice909 fb09ada313 feat: optimization error message
Define error codes to identify different errors.
The cli displays error information to users based on error codes.
Add -v,--verbose option to display detailed error information.

Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-16 10:56:11 +08:00
ice909 33f5913209 feat: extract the export paths as a config file
Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-07 17:14:27 +08:00
myml 8ec9eb817d feat: update client swagger
更新api swagger文件, 用于自动生成客户端代码
主要为了将RegisterStruct.size字段改为int64类型, 避免溢出
2025-03-11 17:16:29 +08:00
ice909 c8d3330c9c feat: add priority to the repo config
The default priority for the stable repository is 0.
When adding a new repository, its priority will be set to the current minimum priority minus 100.
If the new repository is set as the default repository, its priority will be set to the current maximum priority plus 100.
Added the set-priority subcommand to allow manual specification of priorities (duplicates are not allowed).
2025-02-25 14:23:22 +08:00
reddevillg f26e6e5046 feat: ll-builder support install package via apt
Provide "build depends" and "depends" for apt build extension, build
phase seperate into build phase and prepare phase. "build depends"
to be installed in build environment before build phase starting, and
preserve in overlayfs. "depends" to be installed in prepare phase, and
will be merged to apps output.
2025-02-24 20:28:37 +08:00
ice909 4b3fed1f00 feat: add --alias option for repo add
Add the --alias option to set aliases for the 'll-cli repo add' and 'll-builder repo add' commands.

So update, remove, and set-default also need to pass alias instead of name.
2025-02-13 20:29:24 +08:00
ComixHe bef4a49985 feat(ll-cli): add subcommand 'inspect'
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-01-20 05:41:29 +00:00
ComixHe 85c17bf538 feat: add optional field 'onlyApp' to UabMetaInfo
Signed-off-by: ComixHe <heyuming@deepin.org>
2025-01-07 11:54:08 +08:00
black-desk ef3d303ec8 feat: auto install some modules
1. Update D-Bus API to allow Install method of PackageManager take
   multiple modules;
2. ll-cli will automatically generate a module list for language modules
   from language related environment variables when install a package
   without specify any modules.
2024-12-25 10:21:53 +08:00
kamiyadm 42263b7072 fix: cannot run application after upgrade cli
* Add dbus method GenerateCache, signal GenerateCacheFinished. (PM)
* Add an exclusive write lock to the application cache in
  ensureCache to ensure that the container runs after the cache
  is generated. (cli)

Log:
2024-12-12 17:26:10 +08:00
ComixHe d2e37dc5cf feat: add permission dialog
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-12-10 18:13:49 +08:00
kamiyadm 6ecb60f98b refactor: check permission by method Permissions
Add new method Permissions to PM.

Log:
2024-12-10 16:22:37 +08:00
ComixHe 6ae5725e2c fix: add fallback channel "main" to earlier packageInfo
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-11-23 16:03:16 +08:00
ComixHe ca4f8bc7c7 refactor: re-implement migrate
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-11-19 17:46:22 +08:00
kamiyadm 5f45e6eb52 refactor: adjust the behavior of ll-cli upgrade
-

Log:"
2024-11-08 18:11:17 +08:00
myml 7f3e65f1f9 feat: modules.files type changed from string to array
files从字符串改为字符串数组, 不再需要切分, 避免yaml格式化导致切分错误
当没有配置develop模块并未开启full develop选项, develop使用内置默认值
2024-11-05 09:37:24 +08:00
dengbo11 3b9164c8b1 feat: info.json add compatible_version option
Add compatible_version to record linyaps package is compatible with
linyaps component version.
2024-11-04 13:40:10 +08:00
dengbo11 d724f434b4 feat(ll-builder): optimize cli command line parsing function
Use CLI11 to optimize Qt command line parsing.
2024-11-04 13:39:08 +08:00
ComixHe ec4e2ecd44 feat: implement the 'deferred uninstallation' feature
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-31 13:35:32 +08:00
kamiyadm ca2a4af4e5 refactor: the behavior of InstallFromFile
* Add new arg options(a{sv}) to InstallFromFile(dbus xml).
* Support interaction for installFromFile.

Log:
2024-10-31 13:35:32 +08:00
kamiyadm 353f33bcd8 refactor: add new structure CommonResult
* Add new structure CommontOptions.
* Change 'force' to 'CommonOptions' in PackageManager1InstallParameters.

Log:
2024-10-31 13:35:32 +08:00
kamiyadm 056eea73a4 refactor: adjust the structure of v1.yaml
* Add new struct InteractionMessageType and PackageManager1RequestInteractionAdditonalMessage.
* Add a new member 'force' to PackageManager1InstallParameters.

Log:
2024-10-31 13:35:32 +08:00
kamiyadm d48771a357 refactor: adjust the dbus xml of PackageManager
* Change the arg of ReplyInteraction, ID(s) to task(o).
* Rename requestInteraction to RequestInteraction.
* Change the property of RequestInteraction:
   Remove ID(s).
   messageID(u) -> messageID(i).
   Add new arg additonalMessage(a{sv}).

Log:
2024-10-31 13:35:32 +08:00
ComixHe 032627936c feat: add syncing mecanism between ll-cli and ll-package-manager
ll-package-manager will delay the uninstall process of application
if there are running containers that are using the application that
will be uninstalled and ll-package-manager may not daemonlize anymore
in the future.

So we need a mecanism to sync states and let ll-package-manager to know
how many running container there are and whether container is building
or not.

ll-cli should touch a file under /run/linglong/UID which named
with current pid and left empty to present initialization of ll-cli is
incomplete, ll-package-manager should waiting until all file are valid
(or exit immediately) if ll-package-manager want to uninstalling
package.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-31 13:35:32 +08:00
kamiyadm 263096e6f8 refactor: add a new member to RepositoryCacheLayersItem
* Add 'deleted' to RepositoryCacheLayersItem.
* Set the version of state.json to 2.

Log:
2024-10-31 13:35:32 +08:00
ComixHe fc1088eba4 refactor: the mechanism of task
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-31 13:35:32 +08:00
kamiyadm 3ec1512167 feat: support prune
* Implement Prune in package_manager.cpp.
* Overload the less-than operator of reference.
* Add new signal PruneFinished to package_manager.

Log:
2024-10-31 13:35:32 +08:00
kamiyadm 670e82dd76 refactor: change some api of ll-cli/ll-package-manager
* Change dbus return type to QVariantMap.
* Add new dbus method SetRunningState, Prune.
* Add new subcommand prune.
* Change the parameters in TaskChange.
* Add task for Uninstall.
* Set correct Status and SubStatus.

Log:
2024-10-31 13:35:32 +08:00
kamiyadm be27e22a7d refactor: Change the dbus properties of Task1
* Rename state/subState to State/SubState.
* Change the type of State/SubState to 'u'.
* Add new property Percentage.
* Implement some functions to read these properties.

Log:
2024-10-31 13:35:32 +08:00
kamiyadm 6d45060139 refactor: Change some data structures in the schema
* Remove PackageTaskMessage, PackageManager1ResultWithTaskID.
* Add State, SubState, PackageManager1ResultWithTaskObjectPath.

Log:
2024-10-31 13:35:32 +08:00
ComixHe e03058b404 refactor!: adjust dbus interface and api of package manager
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-31 13:35:32 +08:00
dengbo11 09e0ce0ea5 feat(ll-cli): add ll-cli list --upgradable feature
Add ll-cli list --upgradable to show the latest version list of the
currently installed apps.

Log: add ll-cli list --upgradable feature
2024-10-25 16:09:26 +08:00
ComixHe 10763a1485 feat: support for hiding some directories in a user's home directory via configuration
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-25 04:04:01 +00:00
myml e13e855369 feat: ll-cli support install and uninstall modules
ll-cli添加安装卸载模块的功能, 在运行时会自动使用已安装的所有模块
在安装, 卸载, 更新时会扫描全部已安装的应用,
然后将应用和模块文件合并到merged目录, 在运行应用时优先查找merged目录

卸载binary时会自动将其他模块删除, 在安装模块前要求用户先安装binary
如果需要调试应用, 要先安装base的develop模块, 再安装应用的develop模块
2024-10-22 11:21:39 +08:00
myml 6d5425545e feat: support module split files
实现了调试符号剥离的功能, 在编译前给gcc添加全局-g参数, 在编译后剥离调试符号到$PREFIX/lib/debug目录
实现了按模块拆分文件的功能, 在linglong.yaml中使用modules字段将构建产物拆分到不同的模块中

Log:
2024-10-15 14:18:40 +08:00
dengbo11 972475473b feat(linglong_builder): add build option to skip ldd check
Some appimage packages use libraries in packages(LD_LIBRARY_PATH),
it will cause the ldd check fails. so add build option to skip ldd
check.
2024-10-10 15:47:31 +08:00
ComixHe b203d63996 feat: support migrating data interactively
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe a1e742eeca refactor: redesign some methods of repoCache
Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 6f7b243ec2 feat: add new dbus object for migrating underlying storage
Adding version '1' to dbus service 'org.deepin.linglong.PackageManager' and it's dbus object.

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 7f4890d6c3 refactor(api): redesign repoCache and remove MinifiedInfo
MinifiedInfo is no longer needed after isolating storage

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 7689c505f7 feat: changing the api 'RepositoryCacheLayersItem'
Booking the commit hash of base and runtime in object which depends by
current item.

Adding these properties for the 'minified' feature of UAB

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00
ComixHe 51065863af refactor!: use command to operate configuration of builder and cli
1. We shouldn't operate repository of ll-build mannually by editing
configuration file.
2. Deprecate command 'll-cli repo modify' due to functional confusion of this command.

ll-cli use below commands to operate repository:
  - ll-cli repo add NAME URL
  - ll-cli repo remove NAME
  - ll-cli repo update NAME URL
  - ll-cli repo set-default NAME

ll-builder use below commands to operate repository:
  - ll-builder repo add --name=NAME --url=URL
  - ll-builder repo remove --name=NAME
  - ll-builder repo update --name=NAME --url=URL
  - ll-builder repo set-default --name=NAME

Signed-off-by: ComixHe <heyuming@deepin.org>
2024-10-08 17:40:34 +08:00