version 1.35, 2022/01/28 06:18:41 |
version 1.36, 2024/04/23 13:34:50 |
|
|
* b) basename of destination in "install" directive is "." |
* b) basename of destination in "install" directive is "." |
* (e.g. install /tmp/.;) |
* (e.g. install /tmp/.;) |
* c) name on left side of -> directive is a directory on local system. |
* c) name on left side of -> directive is a directory on local system. |
* |
* |
* We need 2 destdir flags (destdir and ddir) because single directory |
* We need 2 destdir flags (destdir and ddir) because single directory |
* source is handled differently. In this case, ddir is 0 (which |
* source is handled differently. In this case, ddir is 0 (which |
* tells install() not to send DIRTARGET directive to remote rdistd) |
* tells install() not to send DIRTARGET directive to remote rdistd) |
* and destdir is 1 (which tells remfilename() how to build the FILE |
* and destdir is 1 (which tells remfilename() how to build the FILE |
* variables correctly). In every other case, destdir and ddir will |
* variables correctly). In every other case, destdir and ddir will |
* have the same value. |
* have the same value. |
*/ |
*/ |
ddir = files->n_next != NULL; /* destination is a directory */ |
ddir = files->n_next != NULL; /* destination is a directory */ |
if (!ddir) { |
if (!ddir) { |
struct stat s; |
struct stat s; |
int isadir = 0; |
int isadir = 0; |
|
|
if (lstat(files->n_name, &s) == 0) |
if (lstat(files->n_name, &s) == 0) |
isadir = S_ISDIR(s.st_mode); |
isadir = S_ISDIR(s.st_mode); |
if (!isadir && sc->sc_name && *sc->sc_name) |
if (!isadir && sc->sc_name && *sc->sc_name) |
ddir = !strcmp(xbasename(sc->sc_name),"."); |
ddir = !strcmp(xbasename(sc->sc_name),"."); |
destdir = isadir | ddir; |
destdir = isadir | ddir; |
} else |
} else |
destdir = ddir; |
destdir = ddir; |
|
|
debugmsg(DM_MISC, |
debugmsg(DM_MISC, |
"Debug files->n_next= %p, destdir=%d, ddir=%d", |
"Debug files->n_next= %p, destdir=%d, ddir=%d", |
files->n_next, destdir, ddir); |
files->n_next, destdir, ddir); |
|
|
if (!sc->sc_name || !*sc->sc_name) { |
if (!sc->sc_name || !*sc->sc_name) { |
destdir = 0; |
destdir = 0; |
ddir = 0; |
ddir = 0; |