Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
864d2b33
Commit
864d2b33
authored
May 31, 2017
by
Kazushi (Jam) Marukawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change crew to divide expand_dependencies and resolve_dependencies functions.
parent
a1ddd9cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
crew
crew
+22
-15
No files found.
crew
View file @
864d2b33
...
...
@@ -312,7 +312,7 @@ def resolve_dependencies_and_install
begin
origin
=
@pkg
.
name
resolve
D
ependencies
resolve
_d
ependencies
search
origin
,
true
install
...
...
@@ -329,7 +329,7 @@ def resolve_dependencies_and_install
end
end
def
resolveD
ependencies
def
expand_d
ependencies
@dependencies
=
[]
# check source packages existance
...
...
@@ -339,25 +339,25 @@ def resolveDependencies
if
@pkg
.
is_binary?
(
@device
[
:architecture
])
||
(
!
@pkg
.
in_upgrade
&&
@device
[
:installed_packages
].
any?
{
|
pkg
|
pkg
[
:name
]
==
@pkg
.
name
})
# retrieve name of dependencies that doesn't contain :build tag
@
check_deps
=
@pkg
.
dependencies
.
select
{
|
k
,
v
|
!
v
.
include?
(
:build
)}.
map
{
|
k
,
v
|
k
}
check_deps
=
@pkg
.
dependencies
.
select
{
|
k
,
v
|
!
v
.
include?
(
:build
)}.
map
{
|
k
,
v
|
k
}
elsif
@pkg
.
is_fake?
# retrieve name of all dependencies
@
check_deps
=
@pkg
.
dependencies
.
map
{
|
k
,
v
|
k
}
check_deps
=
@pkg
.
dependencies
.
map
{
|
k
,
v
|
k
}
else
# retrieve name of all dependencies
@
check_deps
=
@pkg
.
dependencies
.
map
{
|
k
,
v
|
k
}
check_deps
=
@pkg
.
dependencies
.
map
{
|
k
,
v
|
k
}
# count the number of source packages to add buildessential into dependencies later
@source_package
+=
1
end
# remove a dependent package which is equal to the target
@
check_deps
.
select!
{
|
name
|
@pkgName
!=
name
}
check_deps
.
select!
{
|
name
|
@pkgName
!=
name
}
#
insert only not installed packages into dependencies
@dependencies
=
@check_deps
.
select
{
|
name
|
@device
[
:installed_packages
].
none?
{
|
pkg
|
pkg
[
:name
]
==
name
}}
.
concat
(
@dependencies
)
#
add new dependencies at the beginning of array
@dependencies
=
check_deps
.
clone
.
concat
(
@dependencies
)
# check all dependencies recursively
@
check_deps
.
each
do
|
dep
|
check_deps
.
each
do
|
dep
|
search
dep
,
true
push_dependencies
end
...
...
@@ -365,19 +365,26 @@ def resolveDependencies
push_dependencies
# Add buildessential
and solve it
s dependencies if any of dependent
# Add buildessential
'
s dependencies if any of dependent
# packages are made from source
if
@source_package
>
0
search
'buildessential'
,
true
push_dependencies
end
@dependencies
.
uniq
end
def
resolve_dependencies
dependencies
=
expand_dependencies
# leave only not installed packages in dependencies
dependencies
.
select!
{
|
name
|
@device
[
:installed_packages
].
none?
{
|
pkg
|
pkg
[
:name
]
==
name
}}
return
if
@
dependencies
.
empty?
return
if
dependencies
.
empty?
puts
"Following packages also need to be installed: "
@dependencies
.
uniq!
@dependencies
.
each
do
|
dep
|
dependencies
.
each
do
|
dep
|
print
dep
+
" "
end
...
...
@@ -396,7 +403,7 @@ def resolveDependencies
end
if
proceed
@
dependencies
.
each
do
|
dep
|
dependencies
.
each
do
|
dep
|
search
dep
install
end
...
...
@@ -455,7 +462,7 @@ def resolve_dependencies_and_build
# mark current package as which is required to compile from source
@pkg
.
build_from_source
=
true
resolve
D
ependencies
resolve
_d
ependencies
search
origin
,
true
build_package
Dir
.
pwd
...
...
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