Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pacman
Namcap
Commits
1b984caf
Commit
1b984caf
authored
Sep 28, 2009
by
Dan McGee
Committed by
Hugo Doria
Oct 12, 2009
Browse files
Clean up output methods
Signed-off-by:
Hugo Doria
<
hugo@archlinux.org
>
parent
2e5c1dd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
namcap.py
View file @
1b984caf
...
...
@@ -89,6 +89,10 @@ def check_rules_exclude(optlist):
args_used
+=
1
return
args_used
def
show_messages
(
name
,
key
,
messages
):
for
msg
in
messages
:
print
"%s %s: %s"
%
(
name
,
key
,
m
(
msg
[
0
])
%
msg
[
1
])
def
process_realpackage
(
package
,
modules
):
extracted
=
0
pkgtar
=
verify_package
(
package
)
...
...
@@ -121,15 +125,10 @@ def process_realpackage(package, modules):
ret
=
[[
'Error running rule ('
+
i
+
')'
],[],[]]
# Output the three types of messages
if
ret
[
0
]
!=
[]:
for
j
in
ret
[
0
]:
print
string
.
ljust
(
pkginfo
.
name
,
10
)
+
" E: "
+
m
(
j
[
0
])
%
j
[
1
]
if
ret
[
1
]
!=
[]:
for
j
in
ret
[
1
]:
print
string
.
ljust
(
pkginfo
.
name
,
10
)
+
" W: "
+
m
(
j
[
0
])
%
j
[
1
]
if
ret
[
2
]
!=
[]
and
info_reporting
:
for
j
in
ret
[
2
]:
print
string
.
ljust
(
pkginfo
.
name
,
10
)
+
" I: "
+
m
(
j
[
0
])
%
j
[
1
]
show_messages
(
pkginfo
.
name
,
'E'
,
ret
[
0
])
show_messages
(
pkginfo
.
name
,
'W'
,
ret
[
1
])
if
info_reporting
:
show_messages
(
pkginfo
.
name
,
'I'
,
ret
[
2
])
# Clean up if we extracted anything
if
extracted
:
...
...
@@ -151,15 +150,11 @@ def process_pkgbuild(package, modules):
ret
=
pkg
.
analyze
(
pkginfo
,
package
)
# Output the PKGBUILD messages
if
ret
[
0
]
!=
[]:
for
j
in
ret
[
0
]:
print
string
.
ljust
(
"PKGBUILD ("
+
pkginfo
.
name
+
")"
,
20
)
+
" E: "
+
m
(
j
[
0
])
%
j
[
1
]
if
ret
[
1
]
!=
[]:
for
j
in
ret
[
1
]:
print
string
.
ljust
(
"PKGBUILD ("
+
pkginfo
.
name
+
")"
,
20
)
+
" W: "
+
m
(
j
[
0
])
%
j
[
1
]
if
ret
[
2
]
!=
[]
and
info_reporting
:
for
j
in
ret
[
2
]:
print
string
.
ljust
(
"PKGBUILD ("
+
pkginfo
.
name
+
")"
,
20
)
+
" I: "
+
m
(
j
[
0
])
%
j
[
1
]
name
=
"PKGBUILD ("
+
pkginfo
.
name
+
")"
show_messages
(
name
,
'E'
,
ret
[
0
])
show_messages
(
name
,
'W'
,
ret
[
1
])
if
info_reporting
:
show_messages
(
name
,
'I'
,
ret
[
2
])
# Main
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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