bd0a18827dcd91e4fae812f795e2a39968535627 braney Thu Jan 21 16:52:04 2021 -0800 when building beta or public, check on hgwbeta and hgw0 for files referenced by bigDataUrl rather than assuming that they exist if they exist on dev diff --git src/lib/osunix.c src/lib/osunix.c index d993cad..bcfa5a2 100644 --- src/lib/osunix.c +++ src/lib/osunix.c @@ -776,15 +776,29 @@ errnoAbort("lstat failure on %s", path); if ((sb.st_mode & S_IFMT) != S_IFLNK) errnoAbort("path %s not a symlink.", path); return mustReadSymlinkExt(path, &sb); } void makeSymLink(char *oldName, char *newName) /* Return a symbolic link from newName to oldName or die trying */ { int err = symlink(oldName, newName); if (err < 0) errnoAbort("Couldn't make symbolic link from %s to %s\n", oldName, newName); } +boolean remoteFileExists(char *remoteLogin, char *file) +/* Check to see if the file exists on the remote machine. */ +{ +char buffer[4096]; + +// rsync might be a better choice, but checking for non-zero is more complicated +//safef(buffer, sizeof buffer, "rsync -qnav qateam@%s:%s /dev/null 2> /dev/null", server, file); +safef(buffer, sizeof buffer, "ssh %s test -s \"%s\"", remoteLogin, file); + +int ret = system(buffer); +if (ret) + return FALSE; +return TRUE; +}