func (a *ACBuild) End() error {
	_, err := os.Stat(a.ContextPath)
	switch {
	case os.IsNotExist(err):
		return errNoBuildInProgress
	case err != nil:
		return err
	}
	if err = a.lock(); err != nil {
		return err
	}
	err = util.MaybeUnmount(a.OverlayTargetPath)
	if err != nil {
		return err
	}
	err = os.RemoveAll(a.ContextPath)
	if err != nil {
		switch err1 := err.(type) {
		case *os.PathError:
			switch err2 := err1.Err.(type) {
			case syscall.Errno:
				if err2 == syscall.EACCES {
					err = fmt.Errorf("permission denied: please run this as a user with appropriate privileges\n")
				}
			}
		}
		return err
	}
	return nil
}
End will stop the current build. An error will be returned if no build is in
progress.
package lib
import (
	"fmt"
	"os"
	"syscall"
	"github.com/containers/build/util"
)