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
a628c15a
Commit
a628c15a
authored
9 years ago
by
Xu Cheng
Browse files
Options
Downloads
Patches
Plain Diff
lock keg during migration
parent
b6c64ae4
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/migrator.rb
+16
-0
16 additions, 0 deletions
Library/Homebrew/migrator.rb
with
16 additions
and
0 deletions
Library/Homebrew/migrator.rb
+
16
−
0
View file @
a628c15a
require
"formula"
require
"formula_lock"
require
"keg"
require
"tab"
require
"tap_migrations"
...
...
@@ -132,6 +133,7 @@ class Migrator
begin
oh1
"Migrating
#{
Tty
.
green
}#{
oldname
}#{
Tty
.
white
}
to
#{
Tty
.
green
}#{
newname
}#{
Tty
.
reset
}
"
lock
unlink_oldname
move_to_new_directory
repin
...
...
@@ -147,6 +149,8 @@ class Migrator
puts
e
.
backtrace
if
ARGV
.
debug?
puts
"Backuping..."
ignore_interrupts
{
backup_oldname
}
ensure
unlock
end
end
...
...
@@ -320,4 +324,16 @@ class Migrator
def
backup_old_tabs
old_tabs
.
each
(
&
:write
)
end
def
lock
@newname_lock
=
FormulaLock
.
new
newname
@oldname_lock
=
FormulaLock
.
new
oldname
@newname_lock
.
lock
@oldname_lock
.
lock
end
def
unlock
@newname_lock
.
unlock
@oldname_lock
.
unlock
end
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