Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
9624c1ca
Commit
9624c1ca
authored
7 years ago
by
Mike McQuaid
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2553 from MikeMcQuaid/audit-new-formula-git
audit: fix audit of new formulae.
parents
c6c93017
5647fdb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/dev-cmd/audit.rb
+18
-22
18 additions, 22 deletions
Library/Homebrew/dev-cmd/audit.rb
Library/Homebrew/formula_versions.rb
+7
-3
7 additions, 3 deletions
Library/Homebrew/formula_versions.rb
with
25 additions
and
25 deletions
Library/Homebrew/dev-cmd/audit.rb
+
18
−
22
View file @
9624c1ca
...
...
@@ -750,7 +750,7 @@ class FormulaAuditor
current_version_scheme
=
formula
.
version_scheme
[
:stable
,
:devel
].
each
do
|
spec
|
spec_version_scheme_map
=
attributes_map
[
:version_scheme
][
spec
]
next
if
spec_version_scheme_map
.
nil?
||
spec_version_scheme_map
.
empty?
next
if
spec_version_scheme_map
.
empty?
version_schemes
=
spec_version_scheme_map
.
values
.
flatten
max_version_scheme
=
version_schemes
.
max
...
...
@@ -783,28 +783,24 @@ class FormulaAuditor
end
current_revision
=
formula
.
revision
if
formula
.
stable
if
revision_map
=
attributes_map
[
:revision
][
:stable
]
if
!
revision_map
.
nil?
&&
!
revision_map
.
empty?
stable_revisions
=
revision_map
[
formula
.
stable
.
version
]
stable_revisions
||=
[]
current_revision
=
formula
.
revision
max_revision
=
stable_revisions
.
max
||
0
if
current_revision
<
max_revision
problem
"revision should not decrease (from
#{
max_revision
}
to
#{
current_revision
}
)"
end
revision_map
=
attributes_map
[
:revision
][
:stable
]
if
formula
.
stable
&&
!
revision_map
.
empty?
stable_revisions
=
revision_map
[
formula
.
stable
.
version
]
stable_revisions
||=
[]
max_revision
=
stable_revisions
.
max
||
0
if
current_revision
<
max_revision
problem
"revision should not decrease (from
#{
max_revision
}
to
#{
current_revision
}
)"
end
stable_revisions
-=
[
formula
.
revision
]
if
!
current_revision
.
zero?
&&
stable_revisions
.
empty?
&&
revision_map
.
keys
.
length
>
1
problem
"'revision
#{
formula
.
revision
}
' should be removed"
elsif
current_revision
>
1
&&
current_revision
!=
max_revision
&&
!
stable_revisions
.
include?
(
current_revision
-
1
)
problem
"revisions should only increment by 1"
end
end
stable_revisions
-=
[
formula
.
revision
]
if
!
current_revision
.
zero?
&&
stable_revisions
.
empty?
&&
revision_map
.
keys
.
length
>
1
problem
"'revision
#{
formula
.
revision
}
' should be removed"
elsif
current_revision
>
1
&&
current_revision
!=
max_revision
&&
!
stable_revisions
.
include?
(
current_revision
-
1
)
problem
"revisions should only increment by 1"
end
elsif
!
current_revision
.
zero?
# head/devel-only formula
problem
"'revision
#{
current_revision
}
' should be removed"
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/formula_versions.rb
+
7
−
3
View file @
9624c1ca
...
...
@@ -67,11 +67,17 @@ class FormulaVersions
attributes_map
=
{}
return
attributes_map
if
attributes
.
empty?
attributes
.
each
do
|
attribute
|
attributes_map
[
attribute
]
||=
{
stable:
{},
devel:
{},
}
end
stable_versions_seen
=
0
rev_list
(
branch
)
do
|
rev
|
formula_at_revision
(
rev
)
do
|
f
|
attributes
.
each
do
|
attribute
|
attributes_map
[
attribute
]
||=
{}
map
=
attributes_map
[
attribute
]
set_attribute_map
(
map
,
f
,
attribute
)
...
...
@@ -89,12 +95,10 @@ class FormulaVersions
def
set_attribute_map
(
map
,
f
,
attribute
)
if
f
.
stable
map
[
:stable
]
||=
{}
map
[
:stable
][
f
.
stable
.
version
]
||=
[]
map
[
:stable
][
f
.
stable
.
version
]
<<
f
.
send
(
attribute
)
end
return
unless
f
.
devel
map
[
:devel
]
||=
{}
map
[
:devel
][
f
.
devel
.
version
]
||=
[]
map
[
:devel
][
f
.
devel
.
version
]
<<
f
.
send
(
attribute
)
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment