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
0d442031
Commit
0d442031
authored
Jan 07, 2017
by
Ed Reel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to search via 'crew whatprovides ^something$'
parent
67833906
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
crew
crew
+17
-10
No files found.
crew
View file @
0d442031
...
...
@@ -67,16 +67,23 @@ end
def
whatprovides
(
pkgName
)
fileArray
=
[]
arg
=
ARGV
[
1
].
dup
op
=
'*'
search
=
arg
if
arg
[
0
]
==
'^'
search
=
pkgName
.
dup
if
search
[
/\*/
]
search
=
search
.
gsub!
'*'
,
''
end
abort
if
not
search
if
search
[
0
]
==
'^'
op
=
'^'
search
=
arg
[
1
..
arg
.
length
-
1
]
search
=
search
[
1
..
search
.
length
-
1
]
end
if
arg
[
-
1
]
==
'$'
op
=
'$'
search
=
arg
[
0
..
arg
.
length
-
2
]
if
search
[
-
1
]
==
'$'
if
op
==
'^'
op
=
'^$'
else
op
=
'$'
end
search
=
search
[
0
..
search
.
length
-
2
]
end
Find
.
find
(
CREW_CONFIG_PATH
+
'meta/'
)
do
|
packageList
|
if
File
.
file?
packageList
...
...
@@ -91,6 +98,8 @@ def whatprovides (pkgName)
found
=
line
[
/^
#{
Regexp
.
quote
(
search
)
}
/
]
when
'$'
found
=
line
[
/
#{
Regexp
.
quote
(
search
)
}
$/
]
when
'^$'
found
=
line
[
/^
#{
Regexp
.
quote
(
search
)
}
$/
]
end
if
found
fileLine
=
packageName
+
': '
+
line
...
...
@@ -103,12 +112,10 @@ def whatprovides (pkgName)
end
end
if
not
fileArray
.
empty?
fileCount
=
0
fileArray
.
sort
.
each
do
|
item
|
puts
item
fileCount
+=
1
end
puts
"
\n
Total found:
#{
file
Count
}
"
puts
"
\n
Total found:
#{
file
Array
.
length
}
"
end
end
...
...
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