Debian Codegraph @

icmake/loginstall

raw
1 // source and dest, absolute or reachable from g_cwd, should exist.
2 // files and links in source matching dest (if empty: all) are copied to dest
3 // and are logged in g_log
4
5 // Before they are logged, dest is created
6
7 void logInstall(string src, string pattern, string dest)
8 {
9 list entries;
10 int idx;
11
12 chdir(g_cwd);
13
14 md(dest);
15 src += "/";
16 dest += "/";
17
18 if (listlen(makelist(O_DIR, src)) == 0)
19 {
20 printf("Warning: ", src, " not found: can't install ", src, pattern,
21 " at ", dest, "\n");
22 return;
23 }
24
25 entries = findAll("f", src, pattern);
26
27 for (idx = listlen(entries); idx--; )
28 run("cp " + src + entries[idx] + " " + dest);
29
30 chdir(g_cwd);
31 entries = findAll("l", src, pattern);
32
33 for (idx = listlen(entries); idx--; )
34 run("cp " CPOPTS " " + src + entries[idx] + " " + dest);
35 }
36
37
38
39