func CheckDpkg() error {
	_, err := exec.LookPath("dpkg")
	if err != nil {
		return errors.New("Unable to find required command 'dpkg'")
	}
	return nil
}
CheckDpkg checks the host system has the dpkg command installed.
package afutil
import (
	"errors"
	"io"
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"runtime"
	"strconv"
	"github.com/hako/afto/deb"
	"github.com/hako/afto/release"
)
var (
	debFilesNotFound = "no .deb file(s) found. unable to continue"
	debFileNotFound  = " not found. unable to continue"
)
func ParseDir(indir string) (bool, error) {
	var reqfiles = []string{"Packages", "Release"}
	var valid = false
	var reqcount = 0
	files, err := ioutil.ReadDir(indir)
	if err != nil {
		return valid, errors.New("directory " + indir + " not found or valid.")
	}
	for _, file := range files {
		for _, reqfile := range reqfiles {
			if file.Name() == reqfile {
				reqcount++
			}
		}
	}
	if reqcount < len(reqfiles) {
		count := len(reqfiles) - reqcount
		return valid, errors.New(strconv.Itoa(count) + " required files missing. (Need Packages and Release)")
	}
	valid = true
	return valid, nil
}