Ejemplo n.º 1
0
func (p *Pacman) clean() (err error) {
	pkgPaths, err := utils.FindExt(p.Pack.Home, ".pkg.tar.xz")
	if err != nil {
		return
	}

	for _, pkgPath := range pkgPaths {
		_ = utils.Remove(pkgPath)
	}

	return
}
Ejemplo n.º 2
0
func (g *GenKey) Generate() (err error) {
	confPath, err := g.createConf()
	if err != nil {
		return
	}
	defer utils.Remove(confPath)

	err = utils.Exec(g.Root, "gpg", "--batch", "--gen-key", confPath)
	if err != nil {
		return
	}

	return
}
Ejemplo n.º 3
0
func (r *Redhat) clean() (err error) {
	pkgPaths, err := utils.FindExt(r.Pack.Home, ".rpm")
	if err != nil {
		return
	}

	match, ok := constants.ReleasesMatch[r.Pack.FullRelease]
	if !ok {
		err = &BuildError{
			errors.Newf("redhat: Failed to find match for '%s'",
				r.Pack.FullRelease),
		}
		return
	}

	for _, pkgPath := range pkgPaths {
		if strings.Contains(filepath.Base(pkgPath), match) {
			_ = utils.Remove(pkgPath)
		}
	}

	return
}