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
e6d92487
Commit
e6d92487
authored
8 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Separate `fetch` and `stage` steps in `Hbc::Installer`.
parent
7d7ca0cb
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/cask/lib/hbc/installer.rb
+32
-18
32 additions, 18 deletions
Library/Homebrew/cask/lib/hbc/installer.rb
with
32 additions
and
18 deletions
Library/Homebrew/cask/lib/hbc/installer.rb
+
32
−
18
View file @
e6d92487
...
...
@@ -54,8 +54,27 @@ module Hbc
output
end
def
fetch
odebug
"Hbc::Installer#fetch"
satisfy_dependencies
verify_has_sha
if
@require_sha
&&
!
@force
download
verify
end
def
stage
odebug
"Hbc::Installer#stage"
extract_primary_container
save_caskfile
rescue
StandardError
=>
e
purge_versioned_files
raise
e
end
def
install
odebug
"Hbc::Installer
.
install"
odebug
"Hbc::Installer
#
install"
if
@cask
.
installed?
&&
!
force
raise
CaskAlreadyInstalledAutoUpdatesError
,
@cask
if
@cask
.
auto_updates
...
...
@@ -63,20 +82,10 @@ module Hbc
end
print_caveats
begin
satisfy_dependencies
verify_has_sha
if
@require_sha
&&
!
@force
download
verify
extract_primary_container
install_artifacts
save_caskfile
enable_accessibility_access
rescue
StandardError
=>
e
purge_versioned_files
raise
e
end
fetch
stage
install_artifacts
enable_accessibility_access
puts
summary
end
...
...
@@ -89,8 +98,7 @@ module Hbc
def
download
odebug
"Downloading"
download
=
Download
.
new
(
@cask
,
force:
false
)
@downloaded_path
=
download
.
perform
@downloaded_path
=
Download
.
new
(
@cask
,
force:
false
).
perform
odebug
"Downloaded to ->
#{
@downloaded_path
}
"
@downloaded_path
end
...
...
@@ -107,15 +115,18 @@ module Hbc
def
extract_primary_container
odebug
"Extracting primary container"
FileUtils
.
mkdir_p
@cask
.
staged_path
container
=
if
@cask
.
container
&&
@cask
.
container
.
type
Container
.
from_type
(
@cask
.
container
.
type
)
else
Container
.
for_path
(
@downloaded_path
,
@command
)
end
unless
container
raise
CaskError
,
"Uh oh, could not figure out how to unpack '
#{
@downloaded_path
}
'"
end
odebug
"Using container class
#{
container
}
for
#{
@downloaded_path
}
"
container
.
new
(
@cask
,
@downloaded_path
,
@command
).
extract
end
...
...
@@ -245,6 +256,9 @@ module Hbc
See System Preferences to enable it manually.
EOS
end
rescue
StandardError
=>
e
purge_versioned_files
raise
e
end
def
disable_accessibility_access
...
...
@@ -279,7 +293,7 @@ module Hbc
end
def
uninstall
odebug
"Hbc::Installer
.
uninstall"
odebug
"Hbc::Installer
#
uninstall"
disable_accessibility_access
uninstall_artifacts
purge_versioned_files
...
...
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