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
ff51e09e
Commit
ff51e09e
authored
8 years ago
by
ilovezfs
Browse files
Options
Downloads
Patches
Plain Diff
bump-formula-pr: forced_version support for devel
parent
f4cfb9ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/dev-cmd/bump-formula-pr.rb
+15
-7
15 additions, 7 deletions
Library/Homebrew/dev-cmd/bump-formula-pr.rb
with
15 additions
and
7 deletions
Library/Homebrew/dev-cmd/bump-formula-pr.rb
+
15
−
7
View file @
ff51e09e
...
...
@@ -164,17 +164,25 @@ module Homebrew
end
if
forced_version
&&
forced_version
!=
"0"
if
File
.
read
(
formula
.
path
).
include?
(
"version
\"
#{
old_formula_version
}
\"
"
)
replacement_pairs
<<
[
old_formula_version
.
to_s
,
forced_version
]
else
if
new_mirror
replacement_pairs
<<
[
/^( +)(mirror \"
#{
new_mirror
}
\"\n)/m
,
"
\\
1
\\
2
\\
1version
\"
#{
forced_version
}
\"\n
"
]
if
requested_spec
==
:stable
if
File
.
read
(
formula
.
path
).
include?
(
"version
\"
#{
old_formula_version
}
\"
"
)
replacement_pairs
<<
[
old_formula_version
.
to_s
,
forced_version
]
else
replacement_pairs
<<
[
/^( +)(url \"
#{
new_url
}
\"\n)/m
,
"
\\
1
\\
2
\\
1version
\"
#{
forced_version
}
\"\n
"
]
if
new_mirror
replacement_pairs
<<
[
/^( +)(mirror \"
#{
new_mirror
}
\"\n)/m
,
"
\\
1
\\
2
\\
1version
\"
#{
forced_version
}
\"\n
"
]
else
replacement_pairs
<<
[
/^( +)(url \"
#{
new_url
}
\"\n)/m
,
"
\\
1
\\
2
\\
1version
\"
#{
forced_version
}
\"\n
"
]
end
end
elsif
requested_spec
==
:devel
replacement_pairs
<<
[
/( devel do.+?version \")
#{
old_formula_version
}
(\"\n.+?end\n)/m
,
"
\\
1
#{
forced_version
}
\\
2"
]
end
elsif
forced_version
&&
forced_version
==
"0"
replacement_pairs
<<
[
/^ version \"[a-z\d+\.]+\"\n/m
,
""
]
if
requested_spec
==
:stable
replacement_pairs
<<
[
/^ version \"[a-z\d+\.]+\"\n/m
,
""
]
elsif
requested_spec
==
:devel
replacement_pairs
<<
[
/( devel do.+?)^ +version \"[^\n]+\"\n(.+?end\n)/m
,
"
\\
1
\\
2"
]
end
end
new_contents
=
inreplace_pairs
(
formula
.
path
,
replacement_pairs
)
...
...
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