Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
28ac033b
Commit
28ac033b
authored
Apr 02, 2012
by
Mikkel Krautz
Committed by
Andrew Gerrand
Apr 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dist: make sure OS X packages follow symlinks when installing
R=adg CC=golang-dev
https://golang.org/cl/5970061
parent
cb871ce3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
misc/dist/bindist.go
misc/dist/bindist.go
+34
-3
No files found.
misc/dist/bindist.go
View file @
28ac033b
...
@@ -240,6 +240,11 @@ func (b *Build) Do() error {
...
@@ -240,6 +240,11 @@ func (b *Build) Do() error {
return
err
return
err
}
}
// build package
// build package
pkginfo
,
err
:=
createPackageInfo
(
work
)
if
err
!=
nil
{
return
err
}
defer
os
.
Remove
(
pkginfo
)
pm
:=
packageMaker
pm
:=
packageMaker
if
!
exists
(
pm
)
{
if
!
exists
(
pm
)
{
pm
=
"/Developer"
+
pm
pm
=
"/Developer"
+
pm
...
@@ -252,11 +257,10 @@ func (b *Build) Do() error {
...
@@ -252,11 +257,10 @@ func (b *Build) Do() error {
_
,
err
=
b
.
run
(
""
,
pm
,
"-v"
,
_
,
err
=
b
.
run
(
""
,
pm
,
"-v"
,
"-r"
,
work
,
"-r"
,
work
,
"-o"
,
targ
,
"-o"
,
targ
,
"--info"
,
pkginfo
,
"--scripts"
,
scripts
,
"--scripts"
,
scripts
,
"--id"
,
"com.googlecode.go"
,
"--title"
,
"Go"
,
"--title"
,
"Go"
,
"--version"
,
"1.0"
,
"--target"
,
"10.5"
)
"--target"
,
"10.6"
)
targs
=
append
(
targs
,
targ
)
targs
=
append
(
targs
,
targ
)
case
"windows"
:
case
"windows"
:
// Create ZIP file.
// Create ZIP file.
...
@@ -794,3 +798,30 @@ func tarFileInfoHeader(fi os.FileInfo, filename string) (*tar.Header, error) {
...
@@ -794,3 +798,30 @@ func tarFileInfoHeader(fi os.FileInfo, filename string) (*tar.Header, error) {
}
}
return
h
,
nil
return
h
,
nil
}
}
// createPackageInfo creates a PackageInfo template file for use with PackageMaker.
// The returned filename points to a file in a temporary directory on the filesystem,
// and should be removed after use.
func
createPackageInfo
(
work
string
)
(
filename
string
,
err
error
)
{
var
size
,
nfiles
int64
err
=
filepath
.
Walk
(
work
,
func
(
path
string
,
info
os
.
FileInfo
,
err
error
)
error
{
nfiles
++
size
+=
info
.
Size
()
return
nil
})
if
err
!=
nil
{
return
""
,
err
}
pi
,
err
:=
ioutil
.
TempFile
(
""
,
"PackageInfo"
)
if
err
!=
nil
{
return
""
,
err
}
defer
pi
.
Close
()
_
,
err
=
fmt
.
Fprintf
(
pi
,
"<pkg-info identifier=
\"
com.googlecode.go
\"
version=
\"
1.0
\"
followSymLinks=
\"
true
\"
>
\n
"
+
"
\t
<payload installKBytes=
\"
%v
\"
numberOfFiles=
\"
%v
\"
/>
\n
"
+
"</pkg-info>
\n
"
,
size
/
1024
,
nfiles
)
if
err
!=
nil
{
return
""
,
err
}
return
pi
.
Name
(),
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment