Ignore:
Timestamp:
Sep 4, 2016, 3:28:12 AM (9 years ago)
Author:
bird
Message:

Only invalidate the PATH_OUT and TEMP in kWorker.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kWorker/kWorker.c

    r2867 r2868  
    47164716
    47174717    /*
    4718      * Invalidate the missing cache entries.
     4718     * Invalidate the volatile parts of cache (kBuild output directory,
     4719     * temporary directory, whatever).
    47194720     */
    4720     kFsCacheInvalidateMissing(g_pFsCache);
     4721    kFsCacheInvalidateCustomBoth(g_pFsCache);
    47214722    return 0;
    47224723}
     
    52345235int main(int argc, char **argv)
    52355236{
    5236     KSIZE   cbMsgBuf = 0;
    5237     KU8    *pbMsgBuf = NULL;
    5238     int     i;
    5239     HANDLE  hPipe = INVALID_HANDLE_VALUE;
     5237    KSIZE           cbMsgBuf = 0;
     5238    KU8            *pbMsgBuf = NULL;
     5239    int             i;
     5240    HANDLE          hPipe = INVALID_HANDLE_VALUE;
     5241    const char     *pszTmp;
     5242    KFSLOOKUPERROR  enmIgnored;
    52405243
    52415244    /*
    5242      * Create the cache.
     5245     * Create the cache and mark the temporary directory as using the custom revision.
    52435246     */
    52445247    g_pFsCache = kFsCacheCreate(KFSCACHE_F_MISSING_OBJECTS | KFSCACHE_F_MISSING_PATHS);
    52455248    if (!g_pFsCache)
    52465249        return kwErrPrintfRc(3, "kFsCacheCreate failed!\n");
     5250
     5251    pszTmp = getenv("TEMP");
     5252    if (pszTmp && *pszTmp != '\0')
     5253        kFsCacheSetupCustomRevisionForTree(g_pFsCache, kFsCacheLookupA(g_pFsCache, pszTmp, &enmIgnored));
     5254    pszTmp = getenv("TMP");
     5255    if (pszTmp && *pszTmp != '\0')
     5256        kFsCacheSetupCustomRevisionForTree(g_pFsCache, kFsCacheLookupA(g_pFsCache, pszTmp, &enmIgnored));
     5257    pszTmp = getenv("TMPDIR");
     5258    if (pszTmp && *pszTmp != '\0')
     5259        kFsCacheSetupCustomRevisionForTree(g_pFsCache, kFsCacheLookupA(g_pFsCache, pszTmp, &enmIgnored));
    52475260
    52485261    /*
     
    52715284                return kwErrPrintfRc(2, "--pipe takes an argument!\n");
    52725285        }
     5286        else if (strcmp(argv[i], "--volatile") == 0)
     5287        {
     5288            i++;
     5289            if (i < argc)
     5290                kFsCacheSetupCustomRevisionForTree(g_pFsCache, kFsCacheLookupA(g_pFsCache, argv[i], &enmIgnored));
     5291            else
     5292                return kwErrPrintfRc(2, "--volatile takes an argument!\n");
     5293        }
    52735294        else if (strcmp(argv[i], "--test") == 0)
    52745295            return kwTestRun(argc - i - 1, &argv[i + 1]);
     
    52775298                 || strcmp(argv[i], "-?") == 0)
    52785299        {
    5279             printf("usage: kWorker --pipe <pipe-handle>\n"
     5300            printf("usage: kWorker [--volatile dir] --pipe <pipe-handle>\n"
    52805301                   "usage: kWorker <--help|-h>\n"
    52815302                   "usage: kWorker <--version|-V>\n"
    5282                    "usage: kWorker --test [<times> [--chdir <dir>]] -- args\n"
     5303                   "usage: kWorker [--volatile dir] --test [<times> [--chdir <dir>]] -- args\n"
    52835304                   "\n"
    52845305                   "This is an internal kmk program that is used via the builtin_kSubmit.\n");
Note: See TracChangeset for help on using the changeset viewer.