瀏覽代碼

small batch of edits/corrections to comments

Ben Wiklund 11 年之前
父節點
當前提交
0fccf0f686
共有 6 個文件被更改,包括 16 次插入15 次删除
  1. 1 0
      AUTHORS
  2. 1 1
      archive/changes_test.go
  3. 7 7
      archive/diff.go
  4. 1 1
      archive/stat_linux.go
  5. 5 5
      auth/auth.go
  6. 1 1
      engine/engine_test.go

+ 1 - 0
AUTHORS

@@ -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>

+ 1 - 1
archive/changes_test.go

@@ -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)
 	}
 }

+ 7 - 7
archive/diff.go

@@ -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))

+ 1 - 1
archive/stat_linux.go

@@ -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
 

+ 5 - 5
auth/auth.go

@@ -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

+ 1 - 1
engine/engine_test.go

@@ -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")