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
20dde0b3
Unverified
Commit
20dde0b3
authored
4 years ago
by
nandahkrishna
Browse files
Options
Downloads
Patches
Plain Diff
Add `head_only?` to Formula, replace `head?` in livecheck
parent
1c4df0ae
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/formula.rb
+6
-0
6 additions, 0 deletions
Library/Homebrew/formula.rb
Library/Homebrew/livecheck/livecheck.rb
+14
-10
14 additions, 10 deletions
Library/Homebrew/livecheck/livecheck.rb
with
20 additions
and
10 deletions
Library/Homebrew/formula.rb
+
6
−
0
View file @
20dde0b3
...
...
@@ -333,6 +333,12 @@ class Formula
active_spec
==
head
end
# Is this formula HEAD-only?
# @private
def
head_only?
head
&&
!
stable
end
delegate
[
# rubocop:disable Layout/HashAlignment
:bottle_unneeded?
,
:bottle_disabled?
,
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/livecheck/livecheck.rb
+
14
−
10
View file @
20dde0b3
...
...
@@ -102,17 +102,21 @@ module Homebrew
formula
.
head
&
.
downloader
&
.
shutup!
current
=
if
formula
.
head?
# Use the `stable` version for comparison except for installed
# head-only formulae. A formula with `stable` and `head` that's
# installed using `--head` will still use the `stable` version for
# comparison.
current
=
if
formula
.
head_only?
formula
.
any_installed_version
.
version
.
commit
else
formula
.
version
formula
.
stable
.
version
end
latest
=
if
formula
.
stable?
latest
=
if
formula
.
head_only?
formula
.
head
.
downloader
.
fetch_last_commit
else
version_info
=
latest_version
(
formula
,
args:
args
)
version_info
[
:latest
]
if
version_info
.
present?
else
formula
.
head
.
downloader
.
fetch_last_commit
end
if
latest
.
blank?
...
...
@@ -128,7 +132,7 @@ module Homebrew
latest
=
Version
.
new
(
m
[
1
])
end
is_outdated
=
if
formula
.
head?
is_outdated
=
if
formula
.
head
_only
?
# A HEAD-only formula is considered outdated if the latest upstream
# commit hash is different than the installed version's commit hash
(
current
!=
latest
)
...
...
@@ -150,7 +154,7 @@ module Homebrew
livecheckable:
formula
.
livecheckable?
,
},
}
info
[
:meta
][
:head_only
]
=
true
if
formula
.
head?
info
[
:meta
][
:head_only
]
=
true
if
formula
.
head
_only
?
info
[
:meta
].
merge!
(
version_info
[
:meta
])
if
version_info
.
present?
&&
version_info
.
key?
(
:meta
)
next
if
args
.
newer_only?
&&
!
info
[
:version
][
:outdated
]
...
...
@@ -211,7 +215,7 @@ module Homebrew
status_hash
[
:meta
]
=
{
livecheckable:
formula
.
livecheckable?
,
}
status_hash
[
:meta
][
:head_only
]
=
true
if
formula
.
head?
status_hash
[
:meta
][
:head_only
]
=
true
if
formula
.
head
_only
?
end
status_hash
...
...
@@ -235,7 +239,7 @@ module Homebrew
return
end
if
formula
.
head?
&&
!
formula
.
any_version_installed?
if
formula
.
head
_only
?
&&
!
formula
.
any_version_installed?
head_only_msg
=
"HEAD only formula must be installed to be livecheckable"
return
status_hash
(
formula
,
"error"
,
[
head_only_msg
],
args:
args
)
if
args
.
json?
...
...
@@ -346,7 +350,7 @@ module Homebrew
if
args
.
debug?
puts
puts
"Formula:
#{
formula_name
(
formula
,
args:
args
)
}
"
puts
"Head only?: true"
if
formula
.
head?
puts
"Head only?: true"
if
formula
.
head
_only
?
puts
"Livecheckable?:
#{
has_livecheckable
?
"Yes"
:
"No"
}
"
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