forked from ALHP/ALHP.GO
added lastupdate for downstream mirrors to check
This commit is contained in:
6
utils.go
6
utils.go
@@ -21,6 +21,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -28,6 +29,7 @@ const (
|
||||
makepkgConf = "/usr/share/devtools/makepkg-x86_64.conf"
|
||||
logDir = "logs"
|
||||
pristineChroot = "root"
|
||||
lastUpdate = "lastupdate"
|
||||
)
|
||||
|
||||
type BuildPackage struct {
|
||||
@@ -102,6 +104,10 @@ func check(e error) {
|
||||
}
|
||||
}
|
||||
|
||||
func updateLastUpdated() {
|
||||
check(os.WriteFile(filepath.Join(conf.Basedir.Repo, lastUpdate), []byte(strconv.FormatInt(time.Now().Unix(), 10)), 0644))
|
||||
}
|
||||
|
||||
func b3sum(filePath string) (string, error) {
|
||||
file, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user