Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
apk-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
61
Issues
61
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
apk-tools
Commits
8c425a1e
Commit
8c425a1e
authored
Jun 19, 2013
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dot: new option: --installed
to consider only installed packages
parent
d315c901
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/dot.c
src/dot.c
+13
-2
No files found.
src/dot.c
View file @
8c425a1e
...
...
@@ -19,8 +19,9 @@
#define S_EVALUATING -2
struct
dot_ctx
{
int
errors_only
;
int
not_empty
;
int
not_empty
:
1
;
int
errors_only
:
1
;
int
installed_only
:
1
;
};
static
int
dot_parse
(
void
*
pctx
,
struct
apk_db_options
*
dbopts
,
...
...
@@ -32,6 +33,10 @@ static int dot_parse(void *pctx, struct apk_db_options *dbopts,
case
0x10000
:
ctx
->
errors_only
=
1
;
break
;
case
0x10001
:
ctx
->
installed_only
=
1
;
dbopts
->
open_flags
&=
~
APK_OPENF_NO_INSTALLED
;
break
;
default:
return
-
1
;
}
...
...
@@ -68,6 +73,9 @@ static int dump_pkg(struct dot_ctx *ctx, struct apk_package *pkg)
struct
apk_provider
*
p0
;
int
r
,
ret
=
0
;
if
(
ctx
->
installed_only
&&
pkg
->
ipkg
==
NULL
)
return
0
;
if
(
pkg
->
state_int
==
S_EVALUATED
)
return
0
;
...
...
@@ -89,6 +97,8 @@ static int dump_pkg(struct dot_ctx *ctx, struct apk_package *pkg)
}
foreach_array_item
(
p0
,
name
->
providers
)
{
if
(
ctx
->
installed_only
&&
p0
->
pkg
->
ipkg
==
NULL
)
continue
;
if
(
!
apk_dep_is_provided
(
dep
,
p0
))
continue
;
...
...
@@ -148,6 +158,7 @@ static int dot_main(void *pctx, struct apk_database *db, struct apk_string_array
static
struct
apk_option
dot_options
[]
=
{
{
0x10000
,
"errors"
,
"Output only parts of the graph which are considered "
"errorneus: e.g. cycles and missing packages"
},
{
0x10001
,
"installed"
,
"Consider only installed packages"
},
};
static
struct
apk_applet
apk_dot
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment