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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
b7e068b7
Commit
b7e068b7
authored
14 years ago
by
Adam Vandenberg
Browse files
Options
Downloads
Patches
Plain Diff
'brew fetch' now an official command
parent
4f22b70b
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/Contributions/examples/brew-fetch.rb
+0
-27
0 additions, 27 deletions
Library/Contributions/examples/brew-fetch.rb
Library/Homebrew/cmd/fetch.rb
+30
-0
30 additions, 0 deletions
Library/Homebrew/cmd/fetch.rb
with
30 additions
and
27 deletions
Library/Contributions/examples/brew-fetch.rb
deleted
100755 → 0
+
0
−
27
View file @
4f22b70b
# Downloads the tarballs for the given formulae to the Cache
require
'formula'
require
'fileutils'
ARGV
.
formulae
.
each
do
|
f
|
if
ARGV
.
include?
"--force"
or
ARGV
.
include?
"-f"
where_to
=
`brew --cache
#{
f
.
name
}
`
.
strip
FileUtils
.
rm_rf
where_to
unless
where_to
.
empty?
end
the_tarball
=
f
.
downloader
.
fetch
next
unless
the_tarball
.
kind_of?
Pathname
previous_md5
=
f
.
instance_variable_get
(
:@md5
)
previous_sha1
=
f
.
instance_variable_get
(
:@sha1
)
puts
"MD5:
#{
the_tarball
.
md5
}
"
puts
"SHA1:
#{
the_tarball
.
sha1
}
"
unless
previous_md5
.
nil?
or
the_tarball
.
md5
==
previous_md5
opoo
"Formula reports different MD5:
#{
previous_md5
}
"
end
unless
previous_sha1
.
nil?
or
the_tarball
.
sha1
==
previous_sha1
opoo
"Formula reports different SHA1:
#{
previous_sha1
}
"
end
end
This diff is collapsed.
Click to expand it.
Library/Homebrew/cmd/fetch.rb
0 → 100644
+
30
−
0
View file @
b7e068b7
require
'formula'
# Downloads the tarballs for the given formulae to the Cache
module
Homebrew
extend
self
def
fetch
ARGV
.
formulae
.
each
do
|
f
|
if
ARGV
.
include?
"--force"
or
ARGV
.
include?
"-f"
where_to
=
`brew --cache
#{
f
.
name
}
`
.
strip
FileUtils
.
rm_rf
where_to
unless
where_to
.
empty?
end
the_tarball
=
f
.
downloader
.
fetch
next
unless
the_tarball
.
kind_of?
Pathname
previous_md5
=
f
.
instance_variable_get
(
:@md5
)
previous_sha1
=
f
.
instance_variable_get
(
:@sha1
)
puts
"MD5:
#{
the_tarball
.
md5
}
"
puts
"SHA1:
#{
the_tarball
.
sha1
}
"
unless
previous_md5
.
nil?
or
previous_md5
.
empty?
or
the_tarball
.
md5
==
previous_md5
opoo
"Formula reports different MD5:
#{
previous_md5
}
"
end
unless
previous_sha1
.
nil?
or
previous_sha1
.
empty?
or
the_tarball
.
sha1
==
previous_sha1
opoo
"Formula reports different SHA1:
#{
previous_sha1
}
"
end
end
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