Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
3780b57a
Commit
3780b57a
authored
Nov 08, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon/chroot: allow no such file errors on upload [GH-588]
parent
17f1ee3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
CHANGELOG.md
CHANGELOG.md
+1
-0
builder/amazon/chroot/communicator.go
builder/amazon/chroot/communicator.go
+18
-1
No files found.
CHANGELOG.md
View file @
3780b57a
...
@@ -14,6 +14,7 @@ IMPROVEMENTS:
...
@@ -14,6 +14,7 @@ IMPROVEMENTS:
BUG FIXES:
BUG FIXES:
*
builder/amazon/chroot: Copying empty directories works. [GH-588]
*
builder/amazon/chroot: Chroot commands work with shell provisioners. [GH-581]
*
builder/amazon/chroot: Chroot commands work with shell provisioners. [GH-581]
*
builder/vmware: VMX modifications are now case-insensitive. [GH-608]
*
builder/vmware: VMX modifications are now case-insensitive. [GH-608]
...
...
builder/amazon/chroot/communicator.go
View file @
3780b57a
package
chroot
package
chroot
import
(
import
(
"bytes"
"fmt"
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
"io"
"io"
...
@@ -9,6 +10,7 @@ import (
...
@@ -9,6 +10,7 @@ import (
"os"
"os"
"os/exec"
"os/exec"
"path/filepath"
"path/filepath"
"strings"
"syscall"
"syscall"
)
)
...
@@ -85,7 +87,22 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
...
@@ -85,7 +87,22 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
return
err
return
err
}
}
return
ShellCommand
(
cpCmd
)
.
Run
()
var
stderr
bytes
.
Buffer
cmd
:=
ShellCommand
(
cpCmd
)
cmd
.
Env
=
append
(
cmd
.
Env
,
os
.
Environ
()
...
)
cmd
.
Env
=
append
(
cmd
.
Env
,
"LANG=C"
)
cmd
.
Stderr
=
&
stderr
err
:=
cmd
.
Run
()
if
err
==
nil
{
return
err
}
if
strings
.
Contains
(
stderr
.
String
(),
"No such file"
)
{
// This just means that the directory was empty. Just ignore it.
return
nil
}
return
err
}
}
func
(
c
*
Communicator
)
Download
(
src
string
,
w
io
.
Writer
)
error
{
func
(
c
*
Communicator
)
Download
(
src
string
,
w
io
.
Writer
)
error
{
...
...
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