浏览代码

Merge pull request #6 from alexlarsson/fix-ApplyLayer-remove

archive.ApplyLayer() remove files recursively
Solomon Hykes 11 年之前
父节点
当前提交
78ef0bd998
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      archive/diff.go

+ 2 - 2
archive/diff.go

@@ -35,7 +35,7 @@ func ApplyLayer(dest string, layer Archive) error {
 			return err
 		} else if matched {
 			log.Printf("Removing aufs metadata %s", fullPath)
-			_ = os.Remove(fullPath)
+			_ = os.RemoveAll(fullPath)
 		}
 
 		filename := filepath.Base(path)
@@ -47,7 +47,7 @@ func ApplyLayer(dest string, layer Archive) error {
 			_ = os.Remove(rmTargetPath)
 			// Remove the whiteout itself
 			log.Printf("Removing whiteout %s", fullPath)
-			_ = os.Remove(fullPath)
+			_ = os.RemoveAll(fullPath)
 		}
 		return nil
 	})