Revert "do not manually update trace files for Debian"
This reverts commit 9db55faec9
.
I forgot that other distros (e.g. Ubuntu) still use csc-sync-debian.
This commit is contained in:
parent
9db55faec9
commit
52b5945857
|
@ -4,6 +4,8 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"git.csclub.uwaterloo.ca/public/merlin/config"
|
||||
)
|
||||
|
@ -48,8 +50,25 @@ func zfsSync(repo *config.Repo) {
|
|||
func postSyncTraceUpdate(repo *config.Repo) {
|
||||
switch repo.SyncType {
|
||||
case "csc-sync-debian":
|
||||
// The ftpsync script provided by Debian takes care of updating the trace
|
||||
// file, so we don't need to do this manually anymore.
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue