]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove no longer needed cleanup of CACHEDIR.TAG in $CCACHE_DIR
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 17 Jul 2020 16:28:36 +0000 (18:28 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 17 Jul 2020 17:42:18 +0000 (19:42 +0200)
The cleanup functionality was added in 3.2 and it should be safe to
assume that it has performed its task for almost everybody now.

src/ccache.cpp

index e2a457af7cd9efaec3d3c7e8f5706e2c36d44e19..e4d3d7f36a1a3c045f900d52a0a4fe7627da914d 100644 (file)
@@ -1000,21 +1000,11 @@ to_cache(Context& ctx,
   // Make sure we have a CACHEDIR.TAG in the cache part of cache_dir. This can
   // be done almost anywhere, but we might as well do it near the end as we
   // save the stat call if we exit early.
-  {
-    std::string first_level_dir(Util::dir_name(ctx.stats_file()));
-    if (!create_cachedir_tag(first_level_dir)) {
-      cc_log("Failed to create %s/CACHEDIR.TAG (%s)",
-             first_level_dir.c_str(),
-             strerror(errno));
-    }
-
-    // Remove any CACHEDIR.TAG on the cache_dir level where it was located in
-    // previous ccache versions.
-    if (getpid() % 1000 == 0) {
-      char* path = format("%s/CACHEDIR.TAG", ctx.config.cache_dir().c_str());
-      Util::unlink_safe(path);
-      free(path);
-    }
+  std::string first_level_dir(Util::dir_name(ctx.stats_file()));
+  if (!create_cachedir_tag(first_level_dir)) {
+    cc_log("Failed to create %s/CACHEDIR.TAG (%s)",
+           first_level_dir.c_str(),
+           strerror(errno));
   }
 
   // Everything OK.