Merge lp:~chipaca/snappy/use-skipdir into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by John Lenton
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 478
Merged at revision: 477
Proposed branch: lp:~chipaca/snappy/use-skipdir
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Prerequisite: lp:~chipaca/snappy/unpackwithdropprivs-to-clickdeb
Diff against target: 18 lines (+5/-3)
1 file modified
snappy/build.go (+5/-3)
To merge this branch: bzr merge lp:~chipaca/snappy/use-skipdir
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Sergio Schvezov Approve
Review via email: mp+260465@code.launchpad.net

Commit message

use filepath.SkipDir in writeHashes

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

looks dandy

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

LGTM, one question/comment inline.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/build.go'
2--- snappy/build.go 2015-05-15 13:33:27 +0000
3+++ snappy/build.go 2015-05-28 11:35:06 +0000
4@@ -268,10 +268,12 @@
5 hashes.ArchiveSha512 = sha512
6
7 err = filepath.Walk(buildDir, func(path string, info os.FileInfo, err error) error {
8- if strings.HasPrefix(path[len(buildDir):], "/DEBIAN") {
9- return nil
10+ // path will always start with buildDir...
11+ if path[len(buildDir):] == "/DEBIAN" {
12+ return filepath.SkipDir
13 }
14- if path == buildDir {
15+ // ...so if path's length is == buildDir, it's buildDir
16+ if len(path) == len(buildDir) {
17 return nil
18 }
19

Subscribers

People subscribed via source and target branches