Changeset 26345 in vbox for trunk/src/bldprogs
- Timestamp:
- Feb 9, 2010 3:40:02 AM (15 years ago)
- Location:
- trunk/src/bldprogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/Makefile.kmk
r26340 r26345 32 32 33 33 PROGRAMS += scm 34 scm_TEMPLATE = VB oxR3Static34 scm_TEMPLATE = VBOXR3EXE 35 35 scm_SOURCES = scm.cpp 36 36 scm_LIBS = \ -
trunk/src/bldprogs/scm.cpp
r26342 r26345 204 204 static int g_iVerbosity = 2;//99; //0; 205 205 static const char *g_pszFileFilter = "*"; 206 static const char *g_pszFileFilterOut = "*.exe|*.com|20*-*-*.log"; 206 static const char *g_pszFileFilterOut = 207 "*.exe|" 208 "*.com|" 209 "20*-*-*.log|" 210 "*/src/VBox/Runtime/testcase/soundcard.h|" 211 "*/src/VBox/Runtime/include/internal/ldrELF*.h|" 212 "*/src/VBox/Runtime/common/math/x86/fenv-x86.c|" 213 "*/src/VBox/Runtime/common/checksum/md5.cpp|" 214 "/dummy/." 215 ; 207 216 static const char *g_pszDirFilter = NULL; 208 static const char *g_pszDirFilterOut = \217 static const char *g_pszDirFilterOut = 209 218 // generic 210 219 ".svn|" … … 228 237 "*/src/VBox/Devices/PC/Etherboot-src/*/.|" 229 238 "*/src/VBox/Devices/Network/lwip/.|" 230 "*/src/VBox/Devices/Storage/VBoxHDDFormats/StorageCraft/*/." 239 "*/src/VBox/Devices/Storage/VBoxHDDFormats/StorageCraft/*/.|" 240 "*/src/VBox/Runtime/r0drv/solaris/vbi/*/.|" 241 "*/src/VBox/Runtime/common/math/gcc/.|" 242 "/dummy" 231 243 ; 232 244 … … 1863 1875 } 1864 1876 if ( g_pszFileFilterOut 1865 && RTStrSimplePatternMultiMatch(g_pszFileFilterOut, RTSTR_MAX, pszBasename, cchBasename, NULL)) 1877 && ( RTStrSimplePatternMultiMatch(g_pszFileFilterOut, RTSTR_MAX, pszBasename, cchBasename, NULL) 1878 || RTStrSimplePatternMultiMatch(g_pszFileFilterOut, RTSTR_MAX, pszFilename, RTSTR_MAX, NULL)) ) 1866 1879 { 1867 1880 ScmVerbose(4, "file filter out: \"%s\"\n", pszFilename); … … 2095 2108 * 2096 2109 * @returns IPRT status code. 2097 * @param pszDir The directory to start with. 2098 */ 2099 static int scmProcessDirTree(const char *pszDir) 2110 * @param pszDir The directory to start with. This is pointer to 2111 * a RTPATH_MAX sized buffer. 2112 */ 2113 static int scmProcessDirTree(char *pszDir) 2100 2114 { 2101 2115 /* 2102 2116 * Setup the recursion. 2103 2117 */ 2104 char szBuf[RTPATH_MAX]; 2105 int rc = RTPathAbs(pszDir, szBuf, sizeof(szBuf)); 2118 int rc = RTPathAppend(pszDir, RTPATH_MAX, "."); 2106 2119 if (RT_SUCCESS(rc)) 2107 rc = RTPathAppend(szBuf, sizeof(szBuf), "."); 2108 if (RT_FAILURE(rc)) 2109 { 2110 RTMsgError("RTPathAbs/Append: %Rrc\n", rc); 2111 return rc; 2112 } 2113 2114 /* 2115 * Get going. 2116 */ 2117 RTDIRENTRY Entry; 2118 return scmProcessDirTreeRecursion(szBuf, strlen(szBuf), &Entry, 0); 2120 { 2121 RTDIRENTRY Entry; 2122 rc = scmProcessDirTreeRecursion(pszDir, strlen(pszDir), &Entry, 0); 2123 } 2124 else 2125 RTMsgError("RTPathAppend: %Rrc\n", rc); 2126 return rc; 2119 2127 } 2120 2128 … … 2128 2136 static int scmProcessSomething(const char *pszSomething) 2129 2137 { 2130 if (RTFileExists(pszSomething)) 2131 { 2132 const char *pszBasename = RTPathFilename(pszSomething); 2133 if (!pszBasename) 2134 return VERR_IS_A_DIRECTORY; 2135 2136 size_t cchBasename = strlen(pszBasename); 2137 if ( ( g_pszFileFilter 2138 || RTStrSimplePatternMultiMatch(g_pszFileFilter, RTSTR_MAX, 2139 pszBasename, cchBasename, NULL)) 2140 && ( g_pszFileFilterOut == NULL 2141 || !RTStrSimplePatternMultiMatch(g_pszFileFilterOut, RTSTR_MAX, 2142 pszBasename, cchBasename, NULL)) 2143 ) 2144 return scmProcessFile(pszSomething, pszBasename, cchBasename); 2145 return VINF_SUCCESS; 2146 } 2147 2148 /* 2149 * If it's not a file, try treat it as a directory tree. 2150 */ 2151 return scmProcessDirTree(pszSomething); 2138 char szBuf[RTPATH_MAX]; 2139 int rc = RTPathAbs(pszSomething, szBuf, sizeof(szBuf)); 2140 if (RT_SUCCESS(rc)) 2141 { 2142 if (RTFileExists(szBuf)) 2143 { 2144 const char *pszBasename = RTPathFilename(szBuf); 2145 if (pszBasename) 2146 { 2147 size_t cchBasename = strlen(pszBasename); 2148 rc = scmProcessFile(szBuf, pszBasename, cchBasename); 2149 } 2150 else 2151 { 2152 RTMsgError("RTPathFilename: NULL\n"); 2153 rc = VERR_IS_A_DIRECTORY; 2154 } 2155 } 2156 else 2157 rc = scmProcessDirTree(szBuf); 2158 } 2159 else 2160 RTMsgError("RTPathAbs: %Rrc\n", rc); 2161 return rc; 2152 2162 } 2153 2163
Note:
See TracChangeset
for help on using the changeset viewer.