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
0fdee308
Commit
0fdee308
authored
May 18, 2021
by
satmandu
Committed by
GitHub
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use grep in crew whatprovides (#5797)
* Use grep in crew whatprovides * Add check for working grep. * uprev
parent
003b8772
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
+9
-16
bin/crew
bin/crew
+8
-15
lib/const.rb
lib/const.rb
+1
-1
No files found.
bin/crew
View file @
0fdee308
...
@@ -35,7 +35,7 @@ Usage:
...
@@ -35,7 +35,7 @@ Usage:
crew
search
[
options
]
[<
name
>
...]
crew
search
[
options
]
[<
name
>
...]
crew
update
[
options
]
[<
compatible
>]
crew
update
[
options
]
[<
compatible
>]
crew
upgrade
[
options
]
[-
k
|--
keep
]
[-
s
|--
build
-
from
-
source
]
[<
name
>
...]
crew
upgrade
[
options
]
[-
k
|--
keep
]
[-
s
|--
build
-
from
-
source
]
[<
name
>
...]
crew
whatprovides
[
options
]
<
name
>
...
crew
whatprovides
[
options
]
<
pattern
>
...
-
c
--
color
Use
colors
even
if
standard
out
is
not
a
tty
.
-
c
--
color
Use
colors
even
if
standard
out
is
not
a
tty
.
-
d
--
no
-
color
Disable
colors
even
if
standard
out
is
a
tty
.
-
d
--
no
-
color
Disable
colors
even
if
standard
out
is
a
tty
.
...
@@ -486,20 +486,13 @@ def files (pkgName)
...
@@ -486,20 +486,13 @@ def files (pkgName)
end
end
def
whatprovides
(
regexPat
)
def
whatprovides
(
regexPat
)
fileArray
=
[]
#
Use
grep
version
command
to
ascertain
whether
we
have
a
working
grep
.
needle
=
regexPat
.
gsub
(/-/,
','
).
gsub
(/,/,
'\-'
)
unless
system
(
'grep -V > /dev/null 2>&1'
)
Dir
[
CREW_META_PATH
+
'*.filelist'
].
each
do
|
packageList
|
abort
'Grep is not working. Please install it with \'
crew
install
grep
\
''
.
lightred
packageName
=
File
.
basename
packageList
,
'.filelist'
File
.
readlines
(
packageList
).
each
do
|
line
|
found
=
line
[/#{
needle
}/]
if
line
.
ascii_only
?
if
found
fileLine
=
packageName
+
': '
+
line
unless
fileArray
.
include
?
fileLine
fileArray
.
push
(
fileLine
)
end
end
end
end
end
fileArray
=
[]
@
grepresults
=
%
x
[
grep
"#{regexPat}"
#{
CREW_META_PATH
}*.
filelist
].
chomp
.
gsub
(
'.filelist'
,
''
).
gsub
(
':'
,
': '
).
gsub
(
CREW_META_PATH
,
''
).
split
(/$/).
map
(&:
strip
)
@
grepresults
.
each
{
|
fileLine
|
fileArray
.
push
(
fileLine
)
}
unless
fileArray
.
empty
?
unless
fileArray
.
empty
?
fileArray
.
sort
.
each
do
|
item
|
fileArray
.
sort
.
each
do
|
item
|
puts
item
puts
item
...
@@ -1397,7 +1390,7 @@ def upgrade_command(args)
...
@@ -1397,7 +1390,7 @@ def upgrade_command(args)
end
end
def
whatprovides_command
(
args
)
def
whatprovides_command
(
args
)
args
[
"<
name
>"
].
each
do
|
name
|
args
[
"<
pattern
>"
].
each
do
|
name
|
whatprovides
name
whatprovides
name
end
end
end
end
...
...
lib/const.rb
View file @
0fdee308
# Defines common constants used in different parts of crew
# Defines common constants used in different parts of crew
CREW_VERSION
=
'1.10.
4
'
CREW_VERSION
=
'1.10.
5
'
ARCH_ACTUAL
=
`uname -m`
.
strip
ARCH_ACTUAL
=
`uname -m`
.
strip
# This helps with virtualized builds on aarch64 machines
# This helps with virtualized builds on aarch64 machines
...
...
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