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
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
59d15ab2
Commit
59d15ab2
authored
Jun 13, 2013
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solver, errors: fix few additional test cases and clean ups
parent
2ff59b7c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
25 deletions
+25
-25
src/commit.c
src/commit.c
+2
-2
src/database.c
src/database.c
+12
-12
src/package.c
src/package.c
+6
-8
test/error1.test
test/error1.test
+1
-1
test/error3.test
test/error3.test
+1
-1
test/error5.test
test/error5.test
+3
-1
No files found.
src/commit.c
View file @
59d15ab2
...
...
@@ -470,8 +470,8 @@ static void print_dep(struct apk_package *pkg0, struct apk_dependency *d0, struc
static
void
print_deps
(
struct
print_state
*
ps
,
struct
apk_package
*
pkg
,
int
match
)
{
ps
->
match
=
match
;
apk_pkg_foreach_matching_dependency
(
NULL
,
ps
->
world
,
ps
->
match
,
pkg
,
print_dep
,
ps
);
apk_pkg_foreach_reverse_dependency
(
pkg
,
ps
->
match
,
print_dep
,
ps
);
apk_pkg_foreach_matching_dependency
(
NULL
,
ps
->
world
,
match
,
pkg
,
print_dep
,
ps
);
apk_pkg_foreach_reverse_dependency
(
pkg
,
match
,
print_dep
,
ps
);
label_end
(
ps
);
}
...
...
src/database.c
View file @
59d15ab2
...
...
@@ -496,25 +496,25 @@ static struct apk_db_file *apk_db_file_get(struct apk_database *db,
static
void
apk_db_pkg_rdepends
(
struct
apk_database
*
db
,
struct
apk_package
*
pkg
)
{
int
i
,
j
;
struct
apk_
name
*
rname
;
struct
apk_name
*
rname
,
**
rd
;
struct
apk_
dependency
*
d
;
for
(
i
=
0
;
i
<
pkg
->
depends
->
num
;
i
++
)
{
rname
=
pkg
->
depends
->
item
[
i
].
name
;
for
(
j
=
0
;
j
<
rname
->
rdepends
->
num
;
j
++
)
if
(
rname
->
rdepends
->
item
[
j
]
==
pkg
->
name
)
for
each_array_item
(
d
,
pkg
->
depends
)
{
rname
=
d
->
name
;
for
each_array_item
(
rd
,
rname
->
rdepends
)
if
(
*
rd
==
pkg
->
name
)
goto
rdeps_done
;
*
apk_name_array_add
(
&
rname
->
rdepends
)
=
pkg
->
name
;
rdeps_done:
;
}
rdeps_done:
for
(
i
=
0
;
i
<
pkg
->
install_if
->
num
;
i
++
)
{
rname
=
pkg
->
install_if
->
item
[
i
].
name
;
for
(
j
=
0
;
j
<
rname
->
rinstall_if
->
num
;
j
++
)
if
(
rname
->
rinstall_if
->
item
[
j
]
==
pkg
->
name
)
foreach_array_item
(
d
,
pkg
->
install_if
)
{
rname
=
d
->
name
;
foreach_array_item
(
rd
,
rname
->
rinstall_if
)
if
(
*
rd
==
pkg
->
name
)
goto
riif_done
;
*
apk_name_array_add
(
&
rname
->
rinstall_if
)
=
pkg
->
name
;
riif_done:
;
}
riif_done:
return
;
}
...
...
src/package.c
View file @
59d15ab2
...
...
@@ -401,7 +401,8 @@ int apk_dep_is_materialized_or_provided(struct apk_dependency *dep, struct apk_p
int
apk_dep_analyze
(
struct
apk_dependency
*
dep
,
struct
apk_package
*
pkg
)
{
int
i
;
struct
apk_dependency
*
p
;
struct
apk_provider
provider
;
if
(
pkg
==
NULL
)
return
APK_DEP_IRRELEVANT
;
...
...
@@ -409,14 +410,11 @@ int apk_dep_analyze(struct apk_dependency *dep, struct apk_package *pkg)
if
(
dep
->
name
==
pkg
->
name
)
return
apk_dep_is_materialized
(
dep
,
pkg
)
?
APK_DEP_SATISFIES
:
APK_DEP_CONFLICTS
;
for
(
i
=
0
;
i
<
pkg
->
provides
->
num
;
i
++
)
{
struct
apk_provider
p
;
if
(
pkg
->
provides
->
item
[
i
].
name
!=
dep
->
name
)
foreach_array_item
(
p
,
pkg
->
provides
)
{
if
(
p
->
name
!=
dep
->
name
)
continue
;
p
=
APK_PROVIDER_FROM_PROVIDES
(
pkg
,
&
pkg
->
provides
->
item
[
i
]);
return
apk_dep_is_provided
(
dep
,
&
p
)
?
APK_DEP_SATISFIES
:
APK_DEP_CONFLICTS
;
provider
=
APK_PROVIDER_FROM_PROVIDES
(
pkg
,
p
);
return
apk_dep_is_provided
(
dep
,
&
provider
)
?
APK_DEP_SATISFIES
:
APK_DEP_CONFLICTS
;
}
return
APK_DEP_IRRELEVANT
;
...
...
test/error1.test
View file @
59d15ab2
...
...
@@ -5,4 +5,4 @@ add a d>1.5
ERROR
:
unsatisfiable
constraints
:
d
-
2.0
:
breaks
:
b
-
1
[
d
<
2.0
]
satisfies
:
world
[
d
>
1.5
]
c
-
1
[
d
>
1.0
]
satisfies
:
world
[
d
>
1.5
]
a
-
3
[
d
>
1.5
]
c
-
1
[
d
>
1.0
]
test/error3.test
View file @
59d15ab2
...
...
@@ -5,7 +5,7 @@ add a !b
ERROR
:
unsatisfiable
constraints
:
d
-
2.0
:
breaks
:
b
-
1
[
d
<
2.0
]
satisfies
:
c
-
1
[
d
>
1.0
]
satisfies
:
a
-
3
[
d
>
1.5
]
c
-
1
[
d
>
1.0
]
b
-
1
:
breaks
:
world
[
!
b
]
satisfies
:
a
-
3
[
b
]
test/error5.test
View file @
59d15ab2
...
...
@@ -3,4 +3,6 @@
add
a
>
2
@
EXPECT
ERROR
:
unsatisfiable
constraints
:
b
-
1
:
d
<
2.0
d
-
1.5
:
breaks
:
a
-
3
[
d
>
1.5
]
satisfies
:
b
-
1
[
d
<
2.0
]
c
-
1
[
d
>
1.0
]
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