Imported Upstream version 3.2.1 upstream/3.2.1
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:16:31 +0000 (16:16 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:16:31 +0000 (16:16 +0900)
16 files changed:
AUTHORS.html
INSTALL.html
LICENSE.html
MANUAL.html
MANUAL.txt
NEWS.html
NEWS.txt
ccache.1
ccache.c
cleanup.c
stats.c
test.sh
test/framework.c
test/test_util.c
util.c
version.c

index 0ddc35c5dcaa54b5b98f4de178d7f99c2e447895..f6931c23b2b56f017e335360aa856463d67c812b 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache authors</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -960,8 +960,8 @@ Yiding Jia &lt;<a href="mailto:yiding@fb.com">yiding@fb.com</a>&gt;
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-17 19:55:54 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
 </div>\r
 </div>\r
 </body>\r
index 3f29e9fb729c7f0eb3cb84231e981ec28100ae6a..734cbc4392c5679c317b93e642ba62be018a63da 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache installation</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -853,8 +853,8 @@ above.</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-15 16:04:58 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
 </div>\r
 </div>\r
 </body>\r
index aea9be7ab7935f915fd6b7b3fa61bb99b576f917..6def0cdc71402bb5fbc4571b995ab8c0acdcf2ef 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -1205,8 +1205,8 @@ following license:</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-15 16:04:58 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
 </div>\r
 </div>\r
 </body>\r
index 82707f69776e4f81f9cd0d8335d0311a05fde6a5..57a922d0ee6a629d34f2aefc592d5b24198064c2 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -1301,12 +1301,22 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>stats</strong> (<strong>CCACHE_STATS</strong>) [boolean]\r
+<strong>max_files</strong> (<strong>CCACHE_MAXFILES</strong>)\r
 </dt>\r
 <dd>\r
 <p>\r
-    If true, ccache will update the statistics counters on each compilation.\r
-    The default is true.\r
+    This option specifies the maximum number of files to keep in the cache. Use\r
+    0 for no limit (which is the default).\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>max_size</strong> (<strong>CCACHE_MAXSIZE</strong>)\r
+</dt>\r
+<dd>\r
+<p>\r
+    This option specifies the maximum size of the cache. Use 0 for no limit.\r
+    The default value is 5G. Available suffixes: k, M, G, T (decimal) and Ki,\r
+    Mi, Gi, Ti (binary). The default suffix is "G".\r
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
@@ -1353,7 +1363,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>reache</strong> (<strong>CCACHE_RECACHE</strong>) [boolean]\r
+<strong>recache</strong> (<strong>CCACHE_RECACHE</strong>) [boolean]\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1447,6 +1457,15 @@ the <strong>prefix_command</strong> setting if possible. See
 information.</p></div>\r
 </dd>\r
 <dt class="hdlist1">\r
+<strong>stats</strong> (<strong>CCACHE_STATS</strong>) [boolean]\r
+</dt>\r
+<dd>\r
+<p>\r
+    If true, ccache will update the statistics counters on each compilation.\r
+    The default is true.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 <strong>temporary_dir</strong> (<strong>CCACHE_TEMPDIR</strong>)\r
 </dt>\r
 <dd>\r
@@ -2141,8 +2160,8 @@ maintained by Joel Rosdahl. See AUTHORS.txt or AUTHORS.html and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-15 16:04:58 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-09 21:16:57 CET\r
 </div>\r
 </div>\r
 </body>\r
index dd0c96908885fbea9a611488564b65aa01e8f372..4ac113e12154d472934b2f56b8f3df2fba31e60f 100644 (file)
@@ -376,10 +376,16 @@ WRAPPERS>>.
     If set to a file path, ccache will write information on what it is doing to
     the specified file. This is useful for tracking down problems.
 
-*stats* (*CCACHE_STATS*) [boolean]::
+*max_files* (*CCACHE_MAXFILES*)::
 
-    If true, ccache will update the statistics counters on each compilation.
-    The default is true.
+    This option specifies the maximum number of files to keep in the cache. Use
+    0 for no limit (which is the default).
+
+*max_size* (*CCACHE_MAXSIZE*)::
+
+    This option specifies the maximum size of the cache. Use 0 for no limit.
+    The default value is 5G. Available suffixes: k, M, G, T (decimal) and Ki,
+    Mi, Gi, Ti (binary). The default suffix is "G".
 
 *path* (*CCACHE_PATH*)::
 
@@ -409,7 +415,7 @@ WRAPPERS>>.
     from the cache using the direct mode, not the preprocessor mode. See
     documentation for *read_only* regarding using a read-only ccache directory.
 
-*reache* (*CCACHE_RECACHE*) [boolean]::
+*recache* (*CCACHE_RECACHE*) [boolean]::
 
     If true, ccache will not use any previously stored result. New results will
     still be cached, possibly overwriting any pre-existing results.
@@ -454,6 +460,11 @@ WRAPPERS>>.
 See the discussion under <<_troubleshooting,TROUBLESHOOTING>> for more
 information.
 
+*stats* (*CCACHE_STATS*) [boolean]::
+
+    If true, ccache will update the statistics counters on each compilation.
+    The default is true.
+
 *temporary_dir* (*CCACHE_TEMPDIR*)::
 
     This setting specifies where ccache will put temporary files. The default
index f90da226d587ce88c198fd5b1084c3d5e5192078..912ecec1a541390bb30b6b6f1aab6fdec2cfd051 100644 (file)
--- a/NEWS.html
+++ b/NEWS.html
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache news</h1>\r
-<span id="revnumber">version 3.2</span>\r
+<span id="revnumber">version 3.2.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -742,6 +742,47 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_ccache_3_2_1">ccache 3.2.1</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2014-12-10</p></div>\r
+<div class="sect2">\r
+<h3 id="_bug_fixes">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed regression in temporary file handling, which lead to incorrect\r
+  permissions for stats, manifest and ccache.conf files in the cache.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<code>CACHEDIR.TAG</code> files are now created in the [0-9a-f] subdirectories so that\r
+  ccache.conf is not lost in backups.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Made the default cache size suffix <code>G</code>, as previously documented.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<code>-fdiagnostics-color=auto</code> is now passed to the compiler even if stderr is\r
+  redirected. This fixes a problem when, for instance, a configure test probes\r
+  if the compiler (wrapped via ccache) supports <code>-fdiagnostics-color=auto</code>.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Added missing documentation for <code>max_files</code> and <code>max_size</code> configuration\r
+  options.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_2">ccache 3.2</h2>\r
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2014-11-17</p></div>\r
@@ -937,7 +978,7 @@ Various other improvements of the test suite.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1020,7 +1061,7 @@ Stale files in the internal temporary directory (<code>&lt;ccache_dir&gt;/tmp</c
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1060,7 +1101,7 @@ Fixed problem with logging of current working directory.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2013-01-06</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1131,7 +1172,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1179,7 +1220,7 @@ Fixed <code>static_assert</code> macro definition clash with GCC 4.7.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2012-01-08</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1262,7 +1303,7 @@ Rewrite argument to <code>--sysroot</code> if <code>CCACHE_BASEDIR</code> is use
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1315,7 +1356,7 @@ Improved order of statistics counters in <code>ccache -s</code> output.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1348,7 +1389,7 @@ Systems that lack (and don&#8217;t need to be linked with) libm are now supporte
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1381,7 +1422,7 @@ The file handle in now correctly closed on write error when trying to create
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-28</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1408,7 +1449,7 @@ Portability fixes for HP-UX 11.00 and other esoteric systems.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-21</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1456,7 +1497,7 @@ The test suite now also works on systems that lack a /dev/zero.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-07</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1578,7 +1619,7 @@ Added <code>-install_name</code> as an option known to take an argument. (This i
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1664,7 +1705,7 @@ New <code>HACKING.txt</code> file with some notes about ccache code conventions.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1853,7 +1894,7 @@ The following options are no longer hashed in the preprocessor mode:
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1998,8 +2039,8 @@ Statistics counters are now correctly updated for -E option failures and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2<br />\r
-Last updated 2014-11-17 19:56:32 CET\r
+Version 3.2.1<br />\r
+Last updated 2014-12-10 20:38:47 CET\r
 </div>\r
 </div>\r
 </body>\r
index c67a77d24f72b5e11a38a966f2028f33e7490500..ca57aedcef391679adef01e0be15c72a3ebd6b40 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -2,6 +2,30 @@ ccache news
 ===========
 
 
+ccache 3.2.1
+------------
+Release date: 2014-12-10
+
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed regression in temporary file handling, which lead to incorrect
+  permissions for stats, manifest and ccache.conf files in the cache.
+
+- `CACHEDIR.TAG` files are now created in the [0-9a-f] subdirectories so that
+  ccache.conf is not lost in backups.
+
+- Made the default cache size suffix `G`, as previously documented.
+
+- `-fdiagnostics-color=auto` is now passed to the compiler even if stderr is
+  redirected. This fixes a problem when, for instance, a configure test probes
+  if the compiler (wrapped via ccache) supports `-fdiagnostics-color=auto`.
+
+- Added missing documentation for `max_files` and `max_size` configuration
+  options.
+
+
 ccache 3.2
 ----------
 Release date: 2014-11-17
index 186c50ac0c089ebd06a98d5b76c4dfd4e9ce5ee6..87abbe90722a6e02953fbd043ce88b0bb0273e81 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 11/17/2014
+.\"      Date: 12/10/2014
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.2
+.\"    Source: ccache 3.2.1
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "11/17/2014" "ccache 3\&.2" "ccache Manual"
+.TH "CCACHE" "1" "12/10/2014" "ccache 3\&.2\&.1" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -490,9 +490,14 @@ If true, ccache will include the current working directory in the hash that is u
 If set to a file path, ccache will write information on what it is doing to the specified file\&. This is useful for tracking down problems\&.
 .RE
 .PP
-\fBstats\fR (\fBCCACHE_STATS\fR) [boolean]
+\fBmax_files\fR (\fBCCACHE_MAXFILES\fR)
 .RS 4
-If true, ccache will update the statistics counters on each compilation\&. The default is true\&.
+This option specifies the maximum number of files to keep in the cache\&. Use 0 for no limit (which is the default)\&.
+.RE
+.PP
+\fBmax_size\fR (\fBCCACHE_MAXSIZE\fR)
+.RS 4
+This option specifies the maximum size of the cache\&. Use 0 for no limit\&. The default value is 5G\&. Available suffixes: k, M, G, T (decimal) and Ki, Mi, Gi, Ti (binary)\&. The default suffix is "G"\&.
 .RE
 .PP
 \fBpath\fR (\fBCCACHE_PATH\fR)
@@ -524,7 +529,7 @@ except that ccache will only try to retrieve results from the cache using the di
 regarding using a read\-only ccache directory\&.
 .RE
 .PP
-\fBreache\fR (\fBCCACHE_RECACHE\fR) [boolean]
+\fBrecache\fR (\fBCCACHE_RECACHE\fR) [boolean]
 .RS 4
 If true, ccache will not use any previously stored result\&. New results will still be cached, possibly overwriting any pre\-existing results\&.
 .RE
@@ -581,6 +586,11 @@ TROUBLESHOOTING
 for more information\&.
 .RE
 .PP
+\fBstats\fR (\fBCCACHE_STATS\fR) [boolean]
+.RS 4
+If true, ccache will update the statistics counters on each compilation\&. The default is true\&.
+.RE
+.PP
 \fBtemporary_dir\fR (\fBCCACHE_TEMPDIR\fR)
 .RS 4
 This setting specifies where ccache will put temporary files\&. The default is
index f3a6a0383aeadf23886adfd2b8e44f68c6904a97..c407760fe87674af5d618e65bd672c690508d139 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -291,8 +291,8 @@ clean_up_pending_tmp_files(void)
        while (p) {
                tmp_unlink(p->path);
                p = p->next;
-               /* Leak p->path and p here because clean_up_pending_tmp_files needs to be signal
-                * safe. */
+               /* Leak p->path and p here because clean_up_pending_tmp_files needs to be
+                * signal safe. */
        }
 }
 
@@ -930,15 +930,27 @@ to_cache(struct args *args)
        put_file_in_cache(output_obj, cached_obj);
        stats_update(STATS_TOCACHE);
 
-       /* Make sure we have a CACHEDIR.TAG
-        * This can be almost anywhere, but might as well do it near the end
-        * as if we exit early we save the stat call
+       /* 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.
         */
-       if (create_cachedirtag(conf->cache_dir) != 0) {
-               cc_log("Failed to create %s/CACHEDIR.TAG (%s)\n",
-                      conf->cache_dir, strerror(errno));
-               stats_update(STATS_ERROR);
-               failed();
+       {
+               char *first_level_dir = dirname(stats_file);
+               if (create_cachedirtag(first_level_dir) != 0) {
+                       cc_log("Failed to create %s/CACHEDIR.TAG (%s)\n",
+                              first_level_dir, strerror(errno));
+                       stats_update(STATS_ERROR);
+                       failed();
+               }
+               free(first_level_dir);
+
+               /* 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", conf->cache_dir);
+                       unlink(path);
+                       free(path);
+               }
        }
 
        free(tmp_stderr);
@@ -1999,6 +2011,8 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                                /* Output is redirected, so color output must be forced. */
                                args_add(stripped_args, "-fdiagnostics-color=always");
                                cc_log("Automatically forcing colors");
+                       } else {
+                               args_add(stripped_args, argv[i]);
                        }
                        found_color_diagnostics = true;
                        continue;
@@ -2200,7 +2214,8 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
        output_is_precompiled_header =
                actual_language && strstr(actual_language, "-header");
 
-       if (output_is_precompiled_header && !(conf->sloppiness & SLOPPY_PCH_DEFINES)) {
+       if (output_is_precompiled_header
+           && !(conf->sloppiness & SLOPPY_PCH_DEFINES)) {
                cc_log("You have to specify \"pch_defines,time_macros\" sloppiness when"
                       " creating precompiled headers");
                stats_update(STATS_CANTUSEPCH);
index a8b4cf0b9020d2795cc9c46c84f393111d2e0437..ee872ccbf12295abed9b291b76dfc9d27e6e3b49 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -80,6 +80,10 @@ traverse_fn(const char *fname, struct stat *st)
                }
        }
 
+       if (strstr(p, "CACHEDIR.TAG")) {
+               goto out;
+       }
+
        if (num_files == allocated) {
                allocated = 10000 + num_files*2;
                files = (struct files **)x_realloc(files, sizeof(struct files *)*allocated);
diff --git a/stats.c b/stats.c
index 71fbb7af6af14b554bef7dd65836e8df9e56a542..aef628f9f1a6db6001c71b216c465777e0f17691 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -373,7 +373,8 @@ stats_zero(void)
 
 /* Get the per directory limits */
 void
-stats_get_obsolete_limits(const char *dir, unsigned *maxfiles, uint64_t *maxsize)
+stats_get_obsolete_limits(const char *dir, unsigned *maxfiles,
+                          uint64_t *maxsize)
 {
        struct counters *counters = counters_init(STATS_END);
        char *sname = format("%s/stats", dir);
diff --git a/test.sh b/test.sh
index 79e3e0d1ee57031388234570f59cfb980a3395a5..b511146c797fd359580d78d6b1933582a9d0abf8 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -43,6 +43,7 @@ unset CCACHE_SLOPPINESS
 unset CCACHE_TEMPDIR
 unset CCACHE_UMASK
 unset CCACHE_UNIFY
+unset GCC_COLORS
 
 # Many tests backdate files, which updates their ctimes.  In those tests, we
 # must ignore ctimes.  Might as well do so everywhere.
index bbb0480099f696ebf8489677ebd98b37a07339e3..3590d032c2476695e7d92ebb74c489a75a409fb8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2012 Joel Rosdahl
+ * Copyright (C) 2010-2014 Joel Rosdahl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -18,6 +18,7 @@
 
 #include "ccache.h"
 #include "test/framework.h"
+#include "util.h"
 
 #if defined(HAVE_TERMIOS_H)
 #define USE_COLOR
@@ -64,6 +65,7 @@ cct_run(suite_fn *suites, int verbose_output)
        suite_fn *suite;
        int tty = is_tty(1);
 
+       x_unsetenv("GCC_COLORS"); /* Avoid confusing argument processing tests. */
        verbose = verbose_output;
 
        for (suite = suites; *suite; suite++) {
index a9c54793b1976746b94f1a5b8189bd6726602d19..156789d63b4ec18d18ca37e0cd660283424249f0 100644 (file)
@@ -164,7 +164,7 @@ TEST(parse_size_with_suffix)
        size_t i;
        struct { const char *size; int64_t expected; } sizes[] = {
                {"0", 0},
-               {"42", 42},
+               {"42", (int64_t)42 * 1000 * 1000 * 1000}, /* Default suffix: G */
 
                {"78k",       78 * 1000},
                {"78K",       78 * 1000},
diff --git a/util.c b/util.c
index f453959e534a71ab6b34684347c286235eccab32..80eb58b6e8d5b2c30e762f836eb944df5ed9ed01 100644 (file)
--- a/util.c
+++ b/util.c
@@ -223,6 +223,21 @@ mkstemp(char *template)
 }
 #endif
 
+#ifndef _WIN32
+static mode_t
+get_umask(void)
+{
+       static bool mask_retrieved = false;
+       static mode_t mask;
+       if (!mask_retrieved) {
+               mask = umask(0);
+               umask(mask);
+               mask_retrieved = true;
+       }
+       return mask;
+}
+#endif
+
 /*
  * Copy src to dest, decompressing src if needed. compress_level > 0 decides
  * whether dest will be compressed, and with which compression level.
@@ -235,9 +250,6 @@ copy_file(const char *src, const char *dest, int compress_level)
        char buf[10240];
        int n, written;
        char *tmp_name;
-#ifndef _WIN32
-       mode_t mask;
-#endif
        struct stat st;
        int errnum;
 
@@ -337,10 +349,7 @@ copy_file(const char *src, const char *dest, int compress_level)
        }
 
 #ifndef _WIN32
-       /* get perms right on the tmp file */
-       mask = umask(0);
-       fchmod(fd_out, 0666 & ~mask);
-       umask(mask);
+       fchmod(fd_out, 0666 & ~get_umask());
 #endif
 
        /* the close can fail on NFS if out of space */
@@ -947,6 +956,9 @@ parse_size_with_suffix(const char *str, uint64_t *size)
                default:
                        return false;
                }
+       } else {
+               /* Default suffix: G. */
+               x *= 1000 * 1000 * 1000;
        }
        *size = x;
        return true;
@@ -1061,6 +1073,11 @@ create_tmp_fd(char **fname)
        if (fd == -1) {
                fatal("Failed to create file %s: %s", template, strerror(errno));
        }
+
+#ifndef _WIN32
+       fchmod(fd, 0666 & ~get_umask());
+#endif
+
        free(*fname);
        *fname = template;
        return fd;
index 61f42e4f43f407dd02e14c6ec4173a8be2740e9c..4bf7d25f506b40e505796141af0b59f0b9b8d610 100644 (file)
--- a/version.c
+++ b/version.c
@@ -1 +1 @@
-const char CCACHE_VERSION[] = "3.2";
+const char CCACHE_VERSION[] = "3.2.1";