small batch of edits/corrections to comments

This commit is contained in:
Ben Wiklund 2013-12-24 16:37:00 -08:00
parent cb1fe939a8
commit 0fccf0f686
6 changed files with 16 additions and 15 deletions

View File

@ -20,6 +20,7 @@ Antony Messerli <amesserl@rackspace.com>
Asbjørn Enge <asbjorn@hanafjedle.net>
Barry Allard <barry.allard@gmail.com>
Ben Toews <mastahyeti@gmail.com>
Ben Wiklund <ben@daisyowl.com>
Benoit Chesneau <bchesneau@gmail.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
Bouke Haarsma <bouke@webatoom.nl>

View File

@ -296,6 +296,6 @@ func TestApplyLayer(t *testing.T) {
}
if len(changes2) != 0 {
t.Fatalf("Unexpected differences after re applying mutation: %v", changes2)
t.Fatalf("Unexpected differences after reapplying mutation: %v", changes2)
}
}

View File

@ -11,9 +11,9 @@ import (
"time"
)
// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes
// The lower 8 bit is the lower 8 bit in the minor, the following 12 bits are the major,
// and then there is the top 12 bits of then minor
// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.
// They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major,
// then the top 12 bits of the minor
func mkdev(major int64, minor int64) uint32 {
return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))
}
@ -58,9 +58,9 @@ func ApplyLayer(dest string, layer Archive) error {
hdr.Name = filepath.Clean(hdr.Name)
if !strings.HasSuffix(hdr.Name, "/") {
// Not the root directory, ensure that the parent directory exists
// Not the root directory, ensure that the parent directory exists.
// This happened in some tests where an image had a tarfile without any
// parent directories
// parent directories.
parent := filepath.Dir(hdr.Name)
parentPath := filepath.Join(dest, parent)
if _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {
@ -85,7 +85,7 @@ func ApplyLayer(dest string, layer Archive) error {
return err
}
} else {
// If path exits we almost always just want to remove and replace it
// If path exits we almost always just want to remove and replace it.
// The only exception is when it is a directory *and* the file from
// the layer is also a directory. Then we want to merge them (i.e.
// just apply the metadata from the layer).
@ -155,7 +155,7 @@ func ApplyLayer(dest string, layer Archive) error {
return err
}
// There is no LChmod, so ignore mode for symlink. Also, this
// There is no LChmod, so ignore mode for symlink. Also, this
// must happen after chown, as that can modify the file mode
if hdr.Typeflag != tar.TypeSymlink {
err = syscall.Chmod(path, uint32(hdr.Mode&07777))

View File

@ -14,7 +14,7 @@ func getLastModification(stat *syscall.Stat_t) syscall.Timespec {
}
func LUtimesNano(path string, ts []syscall.Timespec) error {
// These are not currently availible in syscall
// These are not currently available in syscall
AT_FDCWD := -100
AT_SYMLINK_NOFOLLOW := 0x100

View File

@ -163,7 +163,7 @@ func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, e
loginAgainstOfficialIndex := serverAddress == IndexServerAddress()
// to avoid sending the server address to the server it should be removed before marshalled
// to avoid sending the server address to the server it should be removed before being marshalled
authCopy := *authConfig
authCopy.ServerAddress = ""
@ -254,11 +254,11 @@ func (config *ConfigFile) ResolveAuthConfig(registry string) AuthConfig {
// default to the index server
return config.Configs[IndexServerAddress()]
}
// if its not the index server there are three cases:
// if it's not the index server there are three cases:
//
// 1. this is a full config url -> it should be used as is
// 2. it could be a full url, but with the wrong protocol
// 3. it can be the hostname optionally with a port
// 1. a full config url -> it should be used as is
// 2. a full url, but with the wrong protocol
// 3. a hostname, with an optional port
//
// as there is only one auth entry which is fully qualified we need to start
// parsing and matching

View File

@ -18,7 +18,7 @@ func TestRegister(t *testing.T) {
eng := newTestEngine(t)
//Should fail because globan handlers are copied
//Should fail because global handlers are copied
//at the engine creation
if err := eng.Register("dummy1", nil); err == nil {
t.Fatalf("Expecting error, got none")