-
-
Notifications
You must be signed in to change notification settings - Fork 781
feat: add install-release package count support #2342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -431,7 +431,7 @@ static uint32_t getPacmanPackages(FFstrbuf* baseDir) { | |
| uint32_t baseDirLen = baseDir->length; | ||
| ffStrbufAppendS(baseDir, "/etc/pacman.conf"); | ||
|
|
||
| bool confFound = ffParsePropFileValues(baseDir->chars, 2, (FFpropquery[]) { | ||
| bool confFound = ffParsePropFileValues(baseDir->chars, 2, (FFpropquery[]){ | ||
| { "DBPath =", &dbPath }, | ||
| { "RootDir =", &rootDir }, | ||
| }); | ||
|
|
@@ -648,4 +648,19 @@ void ffDetectPackagesImpl(FFPackagesResult* result, FFPackagesOptions* options) | |
| result->appimage += getNumElementsBySuffix(&baseDir, "/AppImages", ".appimage"); | ||
| result->appimage += getNumElementsBySuffix(&baseDir, "/Applications", ".appimage"); | ||
| } | ||
|
|
||
| if (!(options->disabled & FF_PACKAGES_FLAG_INSTALLRELEASE_BIT)) { | ||
| FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateCopy(&baseDir); | ||
| ffStrbufAppendS(&path, ".config/install_release/state.json"); | ||
| if (ffPathExists(path.chars, FF_PATHTYPE_FILE)) { | ||
| yyjson_doc* doc = yyjson_read_file(path.chars, YYJSON_READ_NOFLAG, NULL, NULL); | ||
| if (doc != NULL) { | ||
| yyjson_val* root = yyjson_doc_get_root(doc); | ||
| if (yyjson_is_obj(root)) { | ||
| result->installrelease = (uint32_t) yyjson_obj_size(root); | ||
| } | ||
| yyjson_doc_free(doc); | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+652
to
+665
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM RISK Suggestion: The logic for detecting 'install-release' packages should be extracted into a separate static helper function, such as
|
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -89,6 +89,7 @@ bool ffPrintPackages(FFPackagesOptions* options) { | |||||
| } else { | ||||||
| FF_PRINT_PACKAGE_NAME(hpkgSystem, "hpkg") | ||||||
| } | ||||||
| FF_PRINT_PACKAGE_NAME(installrelease, "install-release") | ||||||
| FF_PRINT_PACKAGE(kiss) | ||||||
| FF_PRINT_PACKAGE(linglong) | ||||||
| FF_PRINT_PACKAGE(lpkg) | ||||||
|
|
@@ -167,6 +168,7 @@ bool ffPrintPackages(FFPackagesOptions* options) { | |||||
| FF_ARG(hpkgAll, "hpkg-all"), | ||||||
| FF_ARG(counts.hpkgSystem, "hpkg-system"), | ||||||
| FF_ARG(counts.hpkgUser, "hpkg-user"), | ||||||
| FF_ARG(counts.installrelease, "install-release"), | ||||||
| FF_ARG(counts.kiss, "kiss"), | ||||||
| FF_ARG(counts.linglong, "linglong"), | ||||||
| FF_ARG(counts.lpkg, "lpkg"), | ||||||
|
|
@@ -278,6 +280,11 @@ void ffParsePackagesJsonObject(FFPackagesOptions* options, yyjson_val* module) { | |||||
| ; | ||||||
| FF_TEST_PACKAGE_NAME(HPKG) | ||||||
| break; | ||||||
| case 'I': | ||||||
| if (false) | ||||||
| ; | ||||||
| FF_TEST_PACKAGE_NAME(INSTALLRELEASE) | ||||||
| break; | ||||||
| case 'K': | ||||||
| if (false) | ||||||
| ; | ||||||
|
|
@@ -445,6 +452,7 @@ bool ffGeneratePackagesJsonResult(FF_A_UNUSED FFPackagesOptions* options, yyjson | |||||
| FF_APPEND_PACKAGE_COUNT(guixUser) | ||||||
| FF_APPEND_PACKAGE_COUNT(hpkgSystem) | ||||||
| FF_APPEND_PACKAGE_COUNT(hpkgUser) | ||||||
| FF_APPEND_PACKAGE_COUNT(installrelease) | ||||||
| FF_APPEND_PACKAGE_COUNT(kiss) | ||||||
| FF_APPEND_PACKAGE_COUNT(linglong) | ||||||
| FF_APPEND_PACKAGE_COUNT(lpkg) | ||||||
|
|
@@ -522,6 +530,7 @@ FFModuleBaseInfo ffPackagesModuleInfo = { | |||||
| { "Total number of all hpkg packages", "hpkg-all" }, | ||||||
| { "Number of hpkg-system packages", "hpkg-system" }, | ||||||
| { "Number of hpkg-user packages", "hpkg-user" }, | ||||||
| { "Number of install-release packages", "install-release"}, | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ LOW RISK Nitpick: Add a space before the closing brace for consistency with surrounding entries.
Suggested change
|
||||||
| { "Number of kiss packages", "kiss" }, | ||||||
| { "Number of linglong packages", "linglong" }, | ||||||
| { "Number of lpkg packages", "lpkg" }, | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ LOW RISK
Nitpick: This formatting change (removing a space before the curly brace) is out of scope for the current feature and should be moved to a separate cleanup PR to keep this diff focused.