Merge lp:~chipaca/snappy/fix-1468831 into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by John Lenton on 2015-09-01
Status: Merged
Approved by: John Lenton on 2015-09-01
Approved revision: 644
Merged at revision: 643
Proposed branch: lp:~chipaca/snappy/fix-1468831
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 34 lines (+12/-5)
1 file modified
helpers/helpers.go (+12/-5)
To merge this branch: bzr merge lp:~chipaca/snappy/fix-1468831
Reviewer Review Type Date Requested Status
Michael Vogt 2015-09-01 Approve on 2015-09-01
Review via email: mp+269728@code.launchpad.net

Commit Message

Preserve mtime/atime on the directories made by RSyncWithDelete.

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Yay, thanks!

review: Approve
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~chipaca/snappy/fix-1468831 into lp:snappy failed. Below is the output from the failed tests.

Checking docs
Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/blakesmith/ar failed; trying to fetch newer version
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/jessevdk/go-flags failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update github.com/mvo5/uboot-go failed; trying to fetch newer version
github.com/jessevdk/go-flags now at 1acbbaff2f347c412a0c7884873bd72cc9c1f5b4
update golang.org/x/crypto failed; trying to fetch newer version
github.com/mvo5/uboot-go now at 361f6ebcbb54f389d15dc9faefa000e996ba3e37
update gopkg.in/check.v1 failed; trying to fetch newer version
golang.org/x/crypto now at 60052bd85f2d91293457e8811b0cf26b773de469
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update github.com/gosexy/gettext failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/gosexy/gettext now at 98b7b91596d20b96909e6b60d57411547dd9959c
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
Building

# we always run in a fresh dir in tarmac
export GOPATH=$(mktemp -d)
trap 'rm -rf "$GOPATH"' EXIT

# this is a hack, but not sure tarmac is golang friendly
mkdir -p $GOPATH/src/launchpad.net/snappy
cp -a . $GOPATH/src/launchpad.net/snappy/
cd $GOPATH/src/launchpad.net/snappy

./run-checks

if which goctest >/dev/null; then
    goctest="goctest"
else
    goctest="go test"
fi

echo Checking docs
./mdlint.py docs/*.md

echo Checking formatting
fmt=$(gofmt -l .)

if [ -n "$fmt" ]; then
    echo "Formatting wrong in following files"
    echo "$fmt"
    exit 1
fi

echo Installing godeps
go get launchpad.net/godeps
export PATH=$PATH:$GOPATH/bin

echo Install golint
go get github.com/golang/lint/golint
export PATH=$PATH:$GOPATH/bin

echo Obtaining dependencies
godeps -u dependencies.tsv

echo Building
go build -v launchpad.net/snappy/...
github.com/blakesmith/ar
launchpad.net/snappy/logger
github.com/jessevdk/go-flags
launchpad.net/snappy/helpers
golang.org/x/crypto/ssh/terminal
github.com/gosexy/gettext
# launchpad.net/snappy/helpers
helpers/helpers.go:503: impossible type assertion:
 *syscall.Stat_t does not implement os.FileInfo (missing IsDir method)
launchpad.net/snappy/pkg
launchpad.net/snappy/priv
github.com/cheggaaa/pb
launchpad.net/snappy/progress
launchpad.net/snappy/i18n
github.com/mvo5/goconfigparser
gopkg.in/yaml.v2
github.com/mvo5/uboot-go/uenv
launchpad.net/snappy/release
launchpad.net/snappy/i18n/xgettext-go
launchpad.net/snappy/coreconfig

lp:~chipaca/snappy/fix-1468831 updated on 2015-09-01
644. By John Lenton on 2015-09-01

forgot Sys() :(

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'helpers/helpers.go'
2--- helpers/helpers.go 2015-08-25 08:12:10 +0000
3+++ helpers/helpers.go 2015-09-01 10:01:12 +0000
4@@ -486,18 +486,25 @@
5 }
6
7 // then copy or update the data from srcdir to destdir
8- err = filepath.Walk(srcDirName, func(path string, info os.FileInfo, err error) error {
9+ err = filepath.Walk(srcDirName, func(src string, info os.FileInfo, err error) error {
10 if err != nil {
11 return err
12 }
13
14 // relative to the root "srcDirName"
15- relPath := path[len(srcDirName):]
16+ relPath := src[len(srcDirName):]
17+ dst := filepath.Join(destDirName, relPath)
18 if info.IsDir() {
19- return os.MkdirAll(filepath.Join(destDirName, relPath), info.Mode())
20+ if err := os.MkdirAll(dst, info.Mode()); err != nil {
21+ return err
22+ }
23+
24+ // this can panic. The alternative would be to use the "st, ok" pattern, and then if !ok... panic?
25+ st := info.Sys().(*syscall.Stat_t)
26+ ts := []syscall.Timespec{st.Atim, st.Mtim}
27+
28+ return syscall.UtimesNano(dst, ts)
29 }
30- src := path
31- dst := filepath.Join(destDirName, relPath)
32 if !FilesAreEqual(src, dst) {
33 // XXX: we should (eventually) use CopyFile here,
34 // but we need to teach it about preserving

Subscribers

People subscribed via source and target branches