do not manually update trace files for Debian

This commit is contained in:
Max Erenberg 2023-01-28 04:57:08 -05:00 committed by Mirror
parent 3d269ebd3c
commit 9db55faec9
1 changed files with 2 additions and 21 deletions

View File

@ -4,8 +4,6 @@ import (
"io"
"os"
"os/exec"
"path/filepath"
"time"
"git.csclub.uwaterloo.ca/public/merlin/config"
)
@ -50,25 +48,8 @@ func zfsSync(repo *config.Repo) {
func postSyncTraceUpdate(repo *config.Repo) {
switch repo.SyncType {
case "csc-sync-debian":
cscPostDebian(repo)
}
}
// update our trace file's modification date by writing the current time
func cscPostDebian(repo *config.Repo) {
targetDir := filepath.Join(buildDownloadDir(repo), "project/trace")
target := filepath.Join(targetDir, config.Conf.Hostname)
os.MkdirAll(targetDir, 0755)
f, err := os.OpenFile(target, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
repo.Logger.Error("Unable to open trace file: " + target)
return
}
if _, err = f.WriteString(time.Now().UTC().Format(time.RFC1123)); err != nil {
repo.Logger.Error("Unable to write to trace file: " + target)
return
// The ftpsync script provided by Debian takes care of updating the trace
// file, so we don't need to do this manually anymore.
}
}