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
60
Issues
60
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
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
536c2197
Commit
536c2197
authored
Feb 28, 2012
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solver: allow multiple packages with same virtual provides
ref
#574
parent
b7a22e55
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
src/solver.c
src/solver.c
+14
-8
test/provides.repo
test/provides.repo
+2
-4
test/provides4.test
test/provides4.test
+3
-1
No files found.
src/solver.c
View file @
536c2197
...
...
@@ -116,6 +116,7 @@ struct apk_name_state {
unsigned
short
requirers
;
unsigned
short
install_ifs
;
unsigned
short
preferred_pinning
;
unsigned
short
locked
;
/* one time prepare/finish flags */
unsigned
solver_flags_local
:
4
;
...
...
@@ -129,7 +130,6 @@ struct apk_name_state {
/* dynamic state flags */
unsigned
none_excluded
:
1
;
unsigned
locked
:
1
;
unsigned
name_touched
:
1
;
};
...
...
@@ -761,9 +761,14 @@ static inline void assign_name(
{
struct
apk_name_state
*
ns
=
name_to_ns
(
name
);
ASSERT
(
!
ns
->
locked
,
"Assigning locked name"
);
ns
->
locked
=
1
;
if
(
p
.
version
==
&
apk_null_blob
)
{
ASSERT
(
!
ns
->
locked
||
ns
->
chosen
.
version
==
&
apk_null_blob
,
"Assigning locked name with version"
);
}
else
{
ASSERT
(
!
ns
->
locked
,
"Assigning locked name"
);
}
ns
->
chosen
=
p
;
ns
->
locked
++
;
if
(
list_hashed
(
&
ns
->
unsolved_list
))
{
list_del
(
&
ns
->
unsolved_list
);
list_init
(
&
ns
->
unsolved_list
);
...
...
@@ -775,11 +780,12 @@ static inline void unassign_name(struct apk_solver_state *ss, struct apk_name *n
struct
apk_name_state
*
ns
=
name_to_ns
(
name
);
ASSERT
(
ns
->
locked
,
"Unassigning unlocked name"
);
ns
->
locked
=
0
;
ns
->
chosen
=
CHOSEN_NONE
;
ns
->
name_touched
=
1
;
demote_name
(
ss
,
name
);
ns
->
locked
--
;
if
(
ns
->
locked
==
0
)
{
ns
->
chosen
=
CHOSEN_NONE
;
ns
->
name_touched
=
1
;
demote_name
(
ss
,
name
);
}
}
...
...
test/provides.repo
View file @
536c2197
...
...
@@ -31,14 +31,12 @@ P:server-a
V:1
S:1
I:1
p:theservice
D:!theservice
p:theservice=1
C:Q1eVpkasfqZAukAXFYbgwt444EEEe=
P:server-b
V:1
S:1
I:1
p:theservice
D:!theservice
p:theservice=2
test/provides4.test
View file @
536c2197
...
...
@@ -2,4 +2,6 @@
--
test
-
repo
provides
.
repo
add
mymailreader
mailreadplus
@
EXPECT
(
1
/
2
)
Installing
mymailreader
(
1
)
(
2
/
2
)
Installing
mailreadplus
(
1
)
OK
:
0
MiB
in
0
packages
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