Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
apk-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alpine
apk-tools
Commits
4e200c8f
"README.md" did not exist on "42496b36c09eb5b726d27f90b73037aa3ba20374"
Commit
4e200c8f
authored
2 years ago
by
Timo Teräs
Browse files
Options
Downloads
Patches
Plain Diff
dot: use apk_db_foreach_matching_name
parent
8a6d213c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app_dot.c
+9
-15
9 additions, 15 deletions
src/app_dot.c
with
9 additions
and
15 deletions
src/app_dot.c
+
9
−
15
View file @
4e200c8f
...
...
@@ -132,9 +132,15 @@ static int dump_pkg(struct dot_ctx *ctx, struct apk_package *pkg)
return
ret
;
}
static
int
foreach_pkg
(
apk_hash_item
item
,
void
*
ctx
)
static
int
dump
(
struct
apk_database
*
db
,
const
char
*
match
,
struct
apk_name
*
name
,
void
*
p
ctx
)
{
dump_pkg
((
struct
dot_ctx
*
)
ctx
,
(
struct
apk_package
*
)
item
);
struct
dot_ctx
*
ctx
=
pctx
;
struct
apk_provider
*
p
;
if
(
!
name
)
return
0
;
foreach_array_item
(
p
,
name
->
providers
)
dump_pkg
(
ctx
,
p
->
pkg
);
return
0
;
}
...
...
@@ -142,20 +148,8 @@ static int dot_main(void *pctx, struct apk_ctx *ac, struct apk_string_array *arg
{
struct
apk_database
*
db
=
ac
->
db
;
struct
dot_ctx
*
ctx
=
(
struct
dot_ctx
*
)
pctx
;
struct
apk_provider
*
p
;
char
**
parg
;
if
(
args
->
num
)
{
foreach_array_item
(
parg
,
args
)
{
struct
apk_name
*
name
=
apk_db_get_name
(
db
,
APK_BLOB_STR
(
*
parg
));
if
(
!
name
)
continue
;
foreach_array_item
(
p
,
name
->
providers
)
dump_pkg
(
ctx
,
p
->
pkg
);
}
}
else
{
apk_hash_foreach
(
&
db
->
available
.
packages
,
foreach_pkg
,
pctx
);
}
apk_db_foreach_matching_name
(
db
,
args
,
dump
,
pctx
);
if
(
!
ctx
->
not_empty
)
return
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment