示例#1
0
文件: project.go 项目: pacur/pacur
func (p *RedhatProject) Prep() (err error) {
	buildDir, err := p.getBuildDir()
	if err != nil {
		return
	}

	keyPath := filepath.Join(p.Path, "..", "sign.key")
	exists, err := utils.Exists(keyPath)
	if err != nil {
		return
	}

	if exists {
		err = utils.CopyFile("", keyPath, buildDir, true)
		if err != nil {
			return
		}
	}

	err = utils.RsyncExt(p.Path, buildDir, ".rpm")
	if err != nil {
		return
	}

	return
}
示例#2
0
文件: pacman.go 项目: pacur/pacur
func (p *Pacman) copy() (err error) {
	pkgs, err := utils.FindExt(p.pacmanDir, ".pkg.tar.xz")
	if err != nil {
		return
	}

	for _, pkg := range pkgs {
		err = utils.CopyFile("", pkg, p.Pack.Home, false)
		if err != nil {
			return
		}
	}

	return
}
示例#3
0
文件: debian.go 项目: pacur/pacur
func (d *Debian) dpkgDeb() (err error) {
	err = utils.Exec("", "dpkg-deb", "-b", d.Pack.PackageDir)
	if err != nil {
		return
	}

	_, dir := filepath.Split(filepath.Clean(d.Pack.PackageDir))
	path := filepath.Join(d.Pack.Root, dir+".deb")
	newPath := filepath.Join(d.Pack.Home,
		fmt.Sprintf("%s_%s-0%s%s.%s_%s.deb",
			d.Pack.PkgName, d.Pack.PkgVer, d.Pack.Distro, d.Pack.PkgRel,
			d.Pack.Release, d.Pack.Arch))

	os.Remove(newPath)

	err = utils.CopyFile("", path, newPath, false)
	if err != nil {
		return
	}

	return
}