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
bab81f6d
Commit
bab81f6d
authored
15 years ago
by
Max Howell
Browse files
Options
Downloads
Patches
Plain Diff
Prettier command output
Absorb stdout unless --verbose is specified
parent
bbee8886
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
Cellar/homebrew/brewkit.rb
+29
-3
29 additions, 3 deletions
Cellar/homebrew/brewkit.rb
with
29 additions
and
3 deletions
Cellar/homebrew/brewkit.rb
+
29
−
3
View file @
bab81f6d
# Copyright 2009 Max Howell <max@methylblue.com>
# Licensed as per the GPL version 3
require
'find'
require
'pathname'
require
'fileutils'
require
'pathname'
$agent
=
"Homebrew 0.1 (Ruby; Mac OS X 10.5 Leopard)"
$cellar
=
Pathname
.
new
(
__FILE__
).
dirname
.
parent
.
realpath
ENV
[
'MACOSX_DEPLOYMENT_TARGET'
]
=
'10.5'
ENV
[
'CFLAGS'
]
=
ENV
[
'CXXFLAGS'
]
=
'-O3 -w'
def
h1
title
puts
"
\033
[0;34m==>
\033
[0;0;1m
#{
title
}
\033
[0;0m"
end
class
Formula
# if you reimplement, assign @name, @version, @url and @md5
def
initialize
(
url
,
md5
)
...
...
@@ -38,10 +44,12 @@ class Formula
prefix
=
$cellar
+
@name
+
@version
raise
"
#{
prefix
}
already exists!"
if
prefix
.
exist?
h1
"Preparing build"
appsupport
=
File
.
expand_path
"~/Library/Application Support/Homebrew"
FileUtils
.
mkpath
appsupport
unless
File
.
exist?
appsupport
Dir
.
chdir
appsupport
do
tgz
=
Pathname
.
new
self
.
fetch
tgz
=
Pathname
.
new
fetch
()
raise
"MD5 mismatch"
unless
`md5 -q "
#{
tgz
}
"`
.
strip
==
@md5
.
downcase
# we make an additional subdirectory so know exactly what we are
...
...
@@ -65,7 +73,7 @@ class Formula
# stay in appsupport in case any odd files gets created etc.
`
#{
$cellar
}
/homebrew/brew ln
#{
prefix
}
`
if
prefix
.
exist?
puts
"
#{
prefix
}
: "
+
`find
#{
prefix
}
| wc -l`
.
strip
+
' files, '
+
`du -hd0
#{
prefix
}
| cut -d"
\t
" -f1`
.
strip
puts
"
#{
prefix
}
: "
+
`find
#{
prefix
}
-type f
| wc -l`
.
strip
+
' files, '
+
`du -hd0
#{
prefix
}
| cut -d"
\t
" -f1`
.
strip
end
end
...
...
@@ -110,6 +118,24 @@ def inreplace(path, before, after)
`perl -pi -e "s|
#{
before
}
|
#{
after
}
|g" "
#{
path
}
"`
end
def
system
cmd
h1
cmd
out
=
''
IO
.
popen
(
"
#{
cmd
}
2>1"
)
do
|
f
|
until
f
.
eof?
s
=
f
.
gets
out
+=
s
puts
s
if
ARGV
.
include?
'--verbose'
end
end
unless
$?
==
0
puts
out
unless
ARGV
.
include?
'--verbose'
#already did that above
raise
"Failure during:
#{
cmd
}
"
end
end
########################################################################script
if
$0
==
__FILE__
...
...
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