]>
Commit | Line | Data |
---|---|---|
2cf5c3c8 ER |
1 | TODO: |
2 | make this patch smarter, combine the parsing into common place | |
3 | perhaps even make it configurable (so upstream would accept it) | |
4 | ||
04655dbc ER |
5 | --- incron-0.5.10/usertable.cpp 2012-04-07 01:19:27.000000000 +0300 |
6 | +++ incron-0.5.10.glen/usertable.cpp 2012-10-21 19:06:15.091453806 +0300 | |
7 | @@ -177,6 +177,28 @@ | |
8 | g_fFinish = true; | |
9 | } | |
10 | else if (!e.GetName().empty()) { | |
11 | + const char *fn = e.GetName().c_str(); | |
12 | + size_t len = strlen(fn); | |
13 | + | |
14 | + /* | |
15 | + * skip file names beginning with "." or "#" to skip hidden files | |
16 | + */ | |
17 | + if (fn[0] == '.' || fn[0] == '#') { | |
18 | + continue; | |
19 | + } | |
20 | + | |
21 | + /* ignore files ending with '~' */ | |
22 | + if (fn[len - 1] == '~') { | |
23 | + continue; | |
24 | + } | |
25 | + | |
26 | + /* ignore *.rpmnew, *.rpmsave and *.rpmorig files */ | |
27 | + if ((len > 7 && strstr(&fn[len - 7], ".rpmnew")) || | |
28 | + (len > 8 && strstr(&fn[len - 8], ".rpmsave")) || | |
29 | + (len > 8 && strstr(&fn[len - 8], ".rpmorig"))) { | |
30 | + continue; | |
31 | + } | |
32 | + | |
33 | SUT_MAP::iterator it = g_ut.find(IncronCfg::BuildPath(m_pSys->GetPath(), e.GetName())); | |
34 | if (it != g_ut.end()) { | |
35 | UserTable* pUt = (*it).second; | |
2cf5c3c8 ER |
36 | --- incron-0.5.10/icd-main.cpp~ 2012-10-21 19:15:17.000000000 +0300 |
37 | +++ incron-0.5.10/icd-main.cpp 2012-10-21 19:19:01.599754423 +0300 | |
38 | @@ -142,8 +142,30 @@ | |
39 | struct dirent* pDe = NULL; | |
40 | while ((pDe = readdir(d)) != NULL) { | |
41 | std::string un(pDe->d_name); | |
42 | - std::string path(IncronCfg::BuildPath(s, pDe->d_name)); | |
43 | - | |
44 | + std::string path(IncronCfg::BuildPath(s, pDe->d_name)); | |
45 | + | |
46 | + const char *fn = pDe->d_name; | |
47 | + size_t len = strlen(fn); | |
48 | + | |
49 | + /* | |
50 | + * skip file names beginning with "." or "#" to skip hidden files | |
51 | + */ | |
52 | + if (fn[0] == '.' || fn[0] == '#') { | |
53 | + continue; | |
54 | + } | |
55 | + | |
56 | + /* ignore files ending with '~' */ | |
57 | + if (fn[len - 1] == '~') { | |
58 | + continue; | |
59 | + } | |
60 | + | |
61 | + /* ignore *.rpmnew, *.rpmsave and *.rpmorig files */ | |
62 | + if ((len > 7 && strstr(&fn[len - 7], ".rpmnew")) || | |
63 | + (len > 8 && strstr(&fn[len - 8], ".rpmsave")) || | |
64 | + (len > 8 && strstr(&fn[len - 8], ".rpmorig"))) { | |
65 | + continue; | |
66 | + } | |
67 | + | |
68 | bool ok = pDe->d_type == DT_REG; | |
69 | if (pDe->d_type == DT_UNKNOWN) { | |
70 | struct stat st; |