forked from ALHP/ALHP.GO
moved some const to utils.go
This commit is contained in:
9
main.go
9
main.go
@@ -28,13 +28,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
pacmanConf = "/usr/share/devtools/pacman-extra.conf"
|
||||
makepkgConf = "/usr/share/devtools/makepkg-x86_64.conf"
|
||||
logDir = "logs"
|
||||
orgChrootName = "root"
|
||||
)
|
||||
|
||||
var (
|
||||
conf = Conf{}
|
||||
repos []string
|
||||
@@ -603,7 +596,7 @@ func main() {
|
||||
setupChroot()
|
||||
syncMarchs()
|
||||
|
||||
alpmHandle, err = initALPM(filepath.Join(conf.Basedir.Chroot, "root"), filepath.Join(conf.Basedir.Chroot, "/root/var/lib/pacman"))
|
||||
alpmHandle, err = initALPM(filepath.Join(conf.Basedir.Chroot, pristineChroot), filepath.Join(conf.Basedir.Chroot, pristineChroot, "/var/lib/pacman"))
|
||||
check(err)
|
||||
|
||||
go buildManager.syncWorker()
|
||||
|
24
utils.go
24
utils.go
@@ -22,13 +22,17 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
SKIPPED = iota
|
||||
FAILED = iota
|
||||
BUILD = iota
|
||||
QUEUED = iota
|
||||
BUILDING = iota
|
||||
LATEST = iota
|
||||
UNKNOWN = iota
|
||||
SKIPPED = iota
|
||||
FAILED = iota
|
||||
BUILD = iota
|
||||
QUEUED = iota
|
||||
BUILDING = iota
|
||||
LATEST = iota
|
||||
UNKNOWN = iota
|
||||
pacmanConf = "/usr/share/devtools/pacman-extra.conf"
|
||||
makepkgConf = "/usr/share/devtools/makepkg-x86_64.conf"
|
||||
logDir = "logs"
|
||||
pristineChroot = "root"
|
||||
)
|
||||
|
||||
type BuildPackage struct {
|
||||
@@ -343,9 +347,9 @@ func isPkgFailed(pkg *BuildPackage) bool {
|
||||
}
|
||||
|
||||
func setupChroot() {
|
||||
if _, err := os.Stat(filepath.Join(conf.Basedir.Chroot, orgChrootName)); err == nil {
|
||||
if _, err := os.Stat(filepath.Join(conf.Basedir.Chroot, pristineChroot)); err == nil {
|
||||
//goland:noinspection SpellCheckingInspection
|
||||
cmd := exec.Command("arch-nspawn", filepath.Join(conf.Basedir.Chroot, orgChrootName), "pacman", "-Syuu", "--noconfirm")
|
||||
cmd := exec.Command("arch-nspawn", filepath.Join(conf.Basedir.Chroot, pristineChroot), "pacman", "-Syuu", "--noconfirm")
|
||||
res, err := cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
check(err)
|
||||
@@ -353,7 +357,7 @@ func setupChroot() {
|
||||
err := os.MkdirAll(conf.Basedir.Chroot, os.ModePerm)
|
||||
check(err)
|
||||
|
||||
cmd := exec.Command("mkarchroot", "-C", pacmanConf, filepath.Join(conf.Basedir.Chroot, orgChrootName), "base-devel")
|
||||
cmd := exec.Command("mkarchroot", "-C", pacmanConf, filepath.Join(conf.Basedir.Chroot, pristineChroot), "base-devel")
|
||||
res, err := cmd.CombinedOutput()
|
||||
log.Debug(string(res))
|
||||
check(err)
|
||||
|
Reference in New Issue
Block a user