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
a648e46d
Commit
a648e46d
authored
15 years ago
by
Max Howell
Browse files
Options
Downloads
Patches
Plain Diff
Leave permissions of installed files in sensible state
No write permission for files, executable when required etc.
parent
9f9d95c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Library/Homebrew/brewkit.rb
+21
-15
21 additions, 15 deletions
Library/Homebrew/brewkit.rb
Library/Homebrew/unittest.rb
+5
-0
5 additions, 0 deletions
Library/Homebrew/unittest.rb
bin/brew
+1
-0
1 addition, 0 deletions
bin/brew
with
27 additions
and
15 deletions
Library/Homebrew/brewkit.rb
+
21
−
15
View file @
a648e46d
...
...
@@ -98,7 +98,10 @@ class Pathname
end
def
install
src
FileUtils
.
mv
src
,
to_s
if
File
.
exist?
src
mkpath
FileUtils
.
mv
src
,
to_s
end
end
def
cp
dst
...
...
@@ -166,12 +169,6 @@ class AbstractFormula
# end ruby is weird section
end
private
def
maybe_mkpath
path
path
.
mkpath
unless
path
.
exist?
return
path
end
public
def
prefix
raise
"@name.nil!"
if
@name
.
nil?
...
...
@@ -179,22 +176,22 @@ public
$cellar
+
@name
+
@version
end
def
bin
maybe_mkpath
prefix
+
'bin'
prefix
+
'bin'
end
def
doc
maybe_mkpath
prefix
+
'share'
+
'doc'
+
name
prefix
+
'share'
+
'doc'
+
name
end
def
man
maybe_mkpath
prefix
+
'share'
+
'man'
prefix
+
'share'
+
'man'
end
def
man1
maybe_mkpath
prefix
+
'share'
+
'man'
+
'man1'
prefix
+
'share'
+
'man'
+
'man1'
end
def
lib
maybe_mkpath
prefix
+
'lib'
prefix
+
'lib'
end
def
include
maybe_mkpath
prefix
+
'include'
prefix
+
'include'
end
def
caveats
...
...
@@ -247,14 +244,23 @@ public
else
fo
=
`file -h
#{
path
}
`
args
=
nil
chmod
=
0444
args
=
'-SxX'
if
fo
=~
/Mach-O dynamically linked shared library/
args
=
''
if
fo
=~
/Mach-O executable/
#defaults strip everything
if
fo
=~
/Mach-O executable/
#defaults strip everything
args
=
''
# still do the strip
chmod
=
0544
end
if
args
puts
"Stripping:
#{
path
}
"
if
ARGV
.
include?
'--verbose'
path
.
chmod
0644
# so we can strip
`strip
#{
args
}
#{
path
}
`
end
path
.
chmod
chmod
end
end
}
# remove empty directories
`perl -MFile::Find -e"finddepth(sub{rmdir},'
#{
prefix
}
')"`
end
protected
...
...
@@ -328,7 +334,7 @@ end
class
Formula
<
UnidentifiedFormula
def
initialize
name
super
name
@version
=
extract_version
Pathname
.
new
(
File
.
basename
(
@url
)).
stem
@version
=
extract_version
Pathname
.
new
(
File
.
basename
(
@url
)).
stem
unless
@version
end
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/unittest.rb
+
5
−
0
View file @
a648e46d
...
...
@@ -42,6 +42,11 @@ class BeerTasting <Test::Unit::TestCase
assert_equal
'R13B'
,
r
.
version
end
def
test_p7zip_version_style
r
=
TestFormula
.
new
"http://kent.dl.sourceforge.net/sourceforge/p7zip/p7zip_9.04_src_all.tar.bz2"
assert_equal
'9.04'
,
r
.
version
end
def
test_astyle_verson_style
r
=
TestFormula
.
new
"http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz"
assert_equal
'1.23'
,
r
.
version
...
...
This diff is collapsed.
Click to expand it.
bin/brew
+
1
−
0
View file @
a648e46d
...
...
@@ -82,6 +82,7 @@ end
def rm keg
#TODO if multiple versions don't rm all unless --force
path=$cellar+keg
`chmod -R u+rw
#{
path
}
` # we leave things read only
path.rmtree
puts "
#{
path
}
removed (
#{
prune
}
files)"
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