do not manually update trace files for Debian
This commit is contained in:
parent
3d269ebd3c
commit
9db55faec9
|
@ -4,8 +4,6 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"git.csclub.uwaterloo.ca/public/merlin/config"
|
"git.csclub.uwaterloo.ca/public/merlin/config"
|
||||||
)
|
)
|
||||||
|
@ -50,25 +48,8 @@ func zfsSync(repo *config.Repo) {
|
||||||
func postSyncTraceUpdate(repo *config.Repo) {
|
func postSyncTraceUpdate(repo *config.Repo) {
|
||||||
switch repo.SyncType {
|
switch repo.SyncType {
|
||||||
case "csc-sync-debian":
|
case "csc-sync-debian":
|
||||||
cscPostDebian(repo)
|
// The ftpsync script provided by Debian takes care of updating the trace
|
||||||
}
|
// file, so we don't need to do this manually anymore.
|
||||||
}
|
|
||||||
|
|
||||||
// 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