From: Joel Rosdahl Date: Sun, 18 Sep 2011 19:22:17 +0000 (+0200) Subject: config: Remove detect_shebang since it's only used for tests X-Git-Tag: v3.2~171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b33c7a620f5ac0b69f782e565ea9f807eed5b40e;p=thirdparty%2Fccache.git config: Remove detect_shebang since it's only used for tests --- diff --git a/MANUAL.txt b/MANUAL.txt index 0a67b9f1d..d6a315f0d 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -254,13 +254,6 @@ WRAPPERS>>. intermediate filename extensions used in this optimisation, in which case this option could allow ccache to be used anyway. -*CCACHE_DETECT_SHEBANG*:: - - The *CCACHE_DETECT_SHEBANG* environment variable only has meaning on - Windows. It instructs ccache to open the executable file to detect the - *#!/bin/sh* string, in which case ccache will search for *sh.exe* in - *PATH* and use that to launch the executable. - *CCACHE_DIR*:: The *CCACHE_DIR* environment variable specifies where ccache will keep its diff --git a/conf.c b/conf.c index 3747b46f4..7b1cefdb9 100644 --- a/conf.c +++ b/conf.c @@ -296,7 +296,6 @@ conf_create(void) conf->compiler_check = x_strdup("mtime"); conf->compression = false; conf->cpp_extension = x_strdup(""); - conf->detect_shebang = false; conf->direct_mode = true; conf->disable = false; conf->extra_files_to_hash = x_strdup(""); @@ -531,9 +530,6 @@ conf_print_items(struct conf *conf, reformat(&s, "cpp_extension = %s", conf->cpp_extension); printer(s, conf->item_origins[find_conf("cpp_extension")->number], context); - reformat(&s, "detect_shebang = %s", conf->detect_shebang ? "true" : "false"); - printer(s, conf->item_origins[find_conf("detect_shebang")->number], context); - reformat(&s, "direct_mode = %s", conf->direct_mode ? "true" : "false"); printer(s, conf->item_origins[find_conf("direct_mode")->number], context); diff --git a/conf.h b/conf.h index d4e9587c4..e95a26869 100644 --- a/conf.h +++ b/conf.h @@ -11,7 +11,6 @@ struct conf { char *compiler_check; bool compression; char *cpp_extension; - bool detect_shebang; bool direct_mode; bool disable; char *extra_files_to_hash; diff --git a/confitems.gperf b/confitems.gperf index fe67b84c4..75c6765ad 100644 --- a/confitems.gperf +++ b/confitems.gperf @@ -14,22 +14,21 @@ compiler, 3, ITEM(compiler, string) compiler_check, 4, ITEM(compiler_check, string) compression, 5, ITEM(compression, bool) cpp_extension, 6, ITEM(cpp_extension, string) -detect_shebang, 7, ITEM(detect_shebang, bool) -direct_mode, 8, ITEM(direct_mode, bool) -disable, 9, ITEM(disable, bool) -extra_files_to_hash, 10, ITEM(extra_files_to_hash, env_string) -hard_link, 11, ITEM(hard_link, bool) -hash_dir, 12, ITEM(hash_dir, bool) -log_file, 13, ITEM(log_file, env_string) -max_files, 14, ITEM(max_files, unsigned) -max_size, 15, ITEM(max_size, size) -path, 16, ITEM(path, env_string) -prefix_command, 17, ITEM(prefix_command, env_string) -read_only, 18, ITEM(read_only, bool) -recache, 19, ITEM(recache, bool) -run_second_cpp, 20, ITEM(run_second_cpp, bool) -sloppiness, 21, ITEM(sloppiness, sloppiness) -stats, 22, ITEM(stats, bool) -temporary_dir, 23, ITEM(temporary_dir, env_string) -umask, 24, ITEM(umask, umask) -unify, 25, ITEM(unify, bool) +direct_mode, 7, ITEM(direct_mode, bool) +disable, 8, ITEM(disable, bool) +extra_files_to_hash, 9, ITEM(extra_files_to_hash, env_string) +hard_link, 10, ITEM(hard_link, bool) +hash_dir, 11, ITEM(hash_dir, bool) +log_file, 12, ITEM(log_file, env_string) +max_files, 13, ITEM(max_files, unsigned) +max_size, 14, ITEM(max_size, size) +path, 15, ITEM(path, env_string) +prefix_command, 16, ITEM(prefix_command, env_string) +read_only, 17, ITEM(read_only, bool) +recache, 18, ITEM(recache, bool) +run_second_cpp, 19, ITEM(run_second_cpp, bool) +sloppiness, 20, ITEM(sloppiness, sloppiness) +stats, 21, ITEM(stats, bool) +temporary_dir, 22, ITEM(temporary_dir, env_string) +umask, 23, ITEM(umask, umask) +unify, 24, ITEM(unify, bool) diff --git a/confitems_lookup.c b/confitems_lookup.c index 1fc88e035..877a7e300 100644 --- a/confitems_lookup.c +++ b/confitems_lookup.c @@ -55,7 +55,7 @@ confitems_hash (register const char *str, register unsigned int len) 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 0, 25, 0, - 10, 15, 45, 45, 18, 0, 45, 45, 15, 10, + 5, 15, 45, 45, 30, 5, 45, 45, 15, 10, 0, 0, 0, 45, 10, 0, 0, 5, 45, 45, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, @@ -86,7 +86,7 @@ confitems_get (register const char *str, register unsigned int len) { enum { - TOTAL_KEYWORDS = 26, + TOTAL_KEYWORDS = 25, MIN_WORD_LENGTH = 4, MAX_WORD_LENGTH = 19, MIN_HASH_VALUE = 4, @@ -97,17 +97,17 @@ confitems_get (register const char *str, register unsigned int len) { {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, -#line 26 "confitems.gperf" - {"path", 16, ITEM(path, env_string)}, -#line 32 "confitems.gperf" - {"stats", 22, ITEM(stats, bool)}, +#line 25 "confitems.gperf" + {"path", 15, ITEM(path, env_string)}, +#line 31 "confitems.gperf" + {"stats", 21, ITEM(stats, bool)}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, #line 13 "confitems.gperf" {"compiler", 3, ITEM(compiler, string)}, #line 11 "confitems.gperf" {"cache_dir", 1, ITEM(cache_dir, env_string)}, -#line 35 "confitems.gperf" - {"unify", 25, ITEM(unify, bool)}, +#line 34 "confitems.gperf" + {"unify", 24, ITEM(unify, bool)}, #line 15 "confitems.gperf" {"compression", 5, ITEM(compression, bool)}, {"",0,NULL,0,NULL}, @@ -118,46 +118,45 @@ confitems_get (register const char *str, register unsigned int len) {"",0,NULL,0,NULL}, #line 12 "confitems.gperf" {"cache_dir_levels", 2, ITEM_V(cache_dir_levels, unsigned, dir_levels)}, -#line 19 "confitems.gperf" - {"disable", 9, ITEM(disable, bool)}, -#line 25 "confitems.gperf" - {"max_size", 15, ITEM(max_size, size)}, -#line 24 "confitems.gperf" - {"max_files", 14, ITEM(max_files, unsigned)}, -#line 34 "confitems.gperf" - {"umask", 24, ITEM(umask, umask)}, #line 18 "confitems.gperf" - {"direct_mode", 8, ITEM(direct_mode, bool)}, - {"",0,NULL,0,NULL}, + {"disable", 8, ITEM(disable, bool)}, +#line 24 "confitems.gperf" + {"max_size", 14, ITEM(max_size, size)}, #line 23 "confitems.gperf" - {"log_file", 13, ITEM(log_file, env_string)}, -#line 27 "confitems.gperf" - {"prefix_command", 17, ITEM(prefix_command, env_string)}, -#line 31 "confitems.gperf" - {"sloppiness", 21, ITEM(sloppiness, sloppiness)}, -#line 22 "confitems.gperf" - {"hash_dir", 12, ITEM(hash_dir, bool)}, -#line 21 "confitems.gperf" - {"hard_link", 11, ITEM(hard_link, bool)}, + {"max_files", 13, ITEM(max_files, unsigned)}, #line 33 "confitems.gperf" - {"temporary_dir", 23, ITEM(temporary_dir, env_string)}, + {"umask", 23, ITEM(umask, umask)}, +#line 17 "confitems.gperf" + {"direct_mode", 7, ITEM(direct_mode, bool)}, + {"",0,NULL,0,NULL}, +#line 22 "confitems.gperf" + {"log_file", 12, ITEM(log_file, env_string)}, +#line 26 "confitems.gperf" + {"prefix_command", 16, ITEM(prefix_command, env_string)}, #line 30 "confitems.gperf" - {"run_second_cpp", 20, ITEM(run_second_cpp, bool)}, + {"sloppiness", 20, ITEM(sloppiness, sloppiness)}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, +#line 32 "confitems.gperf" + {"temporary_dir", 22, ITEM(temporary_dir, env_string)}, #line 29 "confitems.gperf" - {"recache", 19, ITEM(recache, bool)}, + {"run_second_cpp", 19, ITEM(run_second_cpp, bool)}, + {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, +#line 28 "confitems.gperf" + {"recache", 18, ITEM(recache, bool)}, #line 10 "confitems.gperf" {"base_dir", 0, ITEM_V(base_dir, env_string, absolute_path)}, -#line 28 "confitems.gperf" - {"read_only", 18, ITEM(read_only, bool)}, - {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, +#line 27 "confitems.gperf" + {"read_only", 17, ITEM(read_only, bool)}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, -#line 17 "confitems.gperf" - {"detect_shebang", 7, ITEM(detect_shebang, bool)}, + {"",0,NULL,0,NULL}, +#line 21 "confitems.gperf" + {"hash_dir", 11, ITEM(hash_dir, bool)}, +#line 20 "confitems.gperf" + {"hard_link", 10, ITEM(hard_link, bool)}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL}, -#line 20 "confitems.gperf" - {"extra_files_to_hash", 10, ITEM(extra_files_to_hash, env_string)} +#line 19 "confitems.gperf" + {"extra_files_to_hash", 9, ITEM(extra_files_to_hash, env_string)} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) @@ -174,4 +173,4 @@ confitems_get (register const char *str, register unsigned int len) } return 0; } -static const size_t CONFITEMS_TOTAL_KEYWORDS = 26; +static const size_t CONFITEMS_TOTAL_KEYWORDS = 25; diff --git a/envtoconfitems.gperf b/envtoconfitems.gperf index d4ae4301b..a528af5b6 100644 --- a/envtoconfitems.gperf +++ b/envtoconfitems.gperf @@ -13,7 +13,6 @@ CC, "compiler" COMPILERCHECK, "compiler_check" COMPRESS, "compression" CPP2, "run_second_cpp" -DETECT_SHEBANG, "detect_shebang" DIR, "cache_dir" DIRECT, "direct_mode" DISABLE, "disable" diff --git a/envtoconfitems_lookup.c b/envtoconfitems_lookup.c index 57962ea8e..c21f2a267 100644 --- a/envtoconfitems_lookup.c +++ b/envtoconfitems_lookup.c @@ -31,7 +31,7 @@ #line 9 "envtoconfitems.gperf" struct env_to_conf_item; -/* maximum key range = 42, duplicates = 0 */ +/* maximum key range = 41, duplicates = 0 */ #ifdef __GNUC__ __inline @@ -45,32 +45,32 @@ envtoconfitems_hash (register const char *str, register unsigned int len) { static const unsigned char asso_values[] = { - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 15, 0, 0, 0, 0, - 44, 44, 20, 0, 44, 44, 15, 5, 15, 10, - 0, 44, 5, 0, 10, 10, 44, 44, 0, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44 + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 10, 5, 0, 0, 0, + 43, 43, 20, 0, 43, 43, 15, 10, 20, 10, + 0, 43, 5, 0, 10, 5, 43, 43, 0, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43 }; return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]]; } @@ -86,11 +86,11 @@ envtoconfitems_get (register const char *str, register unsigned int len) { enum { - TOTAL_KEYWORDS = 26, + TOTAL_KEYWORDS = 25, MIN_WORD_LENGTH = 2, - MAX_WORD_LENGTH = 14, + MAX_WORD_LENGTH = 13, MIN_HASH_VALUE = 2, - MAX_HASH_VALUE = 43 + MAX_HASH_VALUE = 42 }; static const struct env_to_conf_item wordlist[] = @@ -98,38 +98,37 @@ envtoconfitems_get (register const char *str, register unsigned int len) {"",""}, {"",""}, #line 12 "envtoconfitems.gperf" {"CC", "compiler"}, -#line 17 "envtoconfitems.gperf" +#line 16 "envtoconfitems.gperf" {"DIR", "cache_dir"}, #line 15 "envtoconfitems.gperf" {"CPP2", "run_second_cpp"}, {"",""}, -#line 18 "envtoconfitems.gperf" +#line 17 "envtoconfitems.gperf" {"DIRECT", "direct_mode"}, -#line 19 "envtoconfitems.gperf" +#line 18 "envtoconfitems.gperf" {"DISABLE", "disable"}, {"",""}, -#line 20 "envtoconfitems.gperf" +#line 19 "envtoconfitems.gperf" {"EXTENSION", "cpp_extension"}, -#line 21 "envtoconfitems.gperf" +#line 20 "envtoconfitems.gperf" {"EXTRAFILES", "extra_files_to_hash"}, -#line 29 "envtoconfitems.gperf" +#line 28 "envtoconfitems.gperf" {"PREFIX", "prefix_command"}, -#line 31 "envtoconfitems.gperf" - {"RECACHE", "recache"}, #line 30 "envtoconfitems.gperf" + {"RECACHE", "recache"}, +#line 29 "envtoconfitems.gperf" {"READONLY", "read_only"}, -#line 16 "envtoconfitems.gperf" - {"DETECT_SHEBANG", "detect_shebang"}, -#line 33 "envtoconfitems.gperf" +#line 27 "envtoconfitems.gperf" + {"PATH", "path"}, +#line 32 "envtoconfitems.gperf" {"STATS", "stats"}, {"",""}, -#line 34 "envtoconfitems.gperf" +#line 33 "envtoconfitems.gperf" {"TEMPDIR", "temporary_dir"}, #line 14 "envtoconfitems.gperf" {"COMPRESS", "compression"}, -#line 28 "envtoconfitems.gperf" - {"PATH", "path"}, -#line 35 "envtoconfitems.gperf" + {"",""}, +#line 34 "envtoconfitems.gperf" {"UMASK", "umask"}, {"",""}, #line 11 "envtoconfitems.gperf" @@ -137,27 +136,27 @@ envtoconfitems_get (register const char *str, register unsigned int len) #line 13 "envtoconfitems.gperf" {"COMPILERCHECK", "compiler_check"}, {"",""}, -#line 32 "envtoconfitems.gperf" +#line 31 "envtoconfitems.gperf" {"SLOPPINESS", "sloppiness"}, {"",""}, -#line 26 "envtoconfitems.gperf" - {"MAXSIZE", "max_size"}, #line 25 "envtoconfitems.gperf" + {"MAXSIZE", "max_size"}, +#line 24 "envtoconfitems.gperf" {"MAXFILES", "max_files"}, {"",""}, -#line 36 "envtoconfitems.gperf" +#line 35 "envtoconfitems.gperf" {"UNIFY", "unify"}, {"",""}, -#line 24 "envtoconfitems.gperf" +#line 23 "envtoconfitems.gperf" {"LOGFILE", "log_file"}, {"",""}, {"",""}, {"",""}, {"",""}, -#line 27 "envtoconfitems.gperf" - {"NLEVELS", "cache_dir_levels"}, - {"",""}, {"",""}, {"",""}, {"",""}, -#line 23 "envtoconfitems.gperf" - {"HASHDIR", "hash_dir"}, #line 22 "envtoconfitems.gperf" - {"HARDLINK", "hard_link"} + {"HASHDIR", "hash_dir"}, +#line 21 "envtoconfitems.gperf" + {"HARDLINK", "hard_link"}, + {"",""}, {"",""}, {"",""}, +#line 26 "envtoconfitems.gperf" + {"NLEVELS", "cache_dir_levels"} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) @@ -174,4 +173,4 @@ envtoconfitems_get (register const char *str, register unsigned int len) } return 0; } -static const size_t ENVTOCONFITEMS_TOTAL_KEYWORDS = 26; +static const size_t ENVTOCONFITEMS_TOTAL_KEYWORDS = 25; diff --git a/execute.c b/execute.c index 048835b13..a12c563e2 100644 --- a/execute.c +++ b/execute.c @@ -100,7 +100,7 @@ win32getshell(char *path) ext = get_extension(path); if (ext && strcasecmp(ext, ".sh") == 0 && (path_env = getenv("PATH"))) sh = find_executable_in_path("sh.exe", NULL, path_env); - if (!sh && conf->detect_shebang) { + if (!sh && gevenv("CCACHE_DETECT_SHEBANG")) { /* Detect shebang. */ FILE *fp; fp = fopen(path, "r"); diff --git a/test/test_conf.c b/test/test_conf.c index 692ffc9a1..cfb00a542 100644 --- a/test/test_conf.c +++ b/test/test_conf.c @@ -20,7 +20,7 @@ #include "test/framework.h" #include "test/util.h" -#define N_CONFIG_ITEMS 26 +#define N_CONFIG_ITEMS 25 static struct { char *descr; const char *origin; @@ -58,7 +58,6 @@ TEST(conf_create) CHECK_STR_EQ("mtime", conf->compiler_check); CHECK(!conf->compression); CHECK_STR_EQ("", conf->cpp_extension); - CHECK(!conf->detect_shebang); CHECK(conf->direct_mode); CHECK(!conf->disable); CHECK_STR_EQ("", conf->extra_files_to_hash); @@ -99,7 +98,6 @@ TEST(conf_read_valid_config) "compiler_check = none\n" "compression=true\n" "cpp_extension = .foo\n" - "detect_shebang = true\n" "direct_mode = false\n" "disable = true\n" "extra_files_to_hash = a:b c:$USER\n" @@ -128,7 +126,6 @@ TEST(conf_read_valid_config) CHECK_STR_EQ("none", conf->compiler_check); CHECK(conf->compression); CHECK_STR_EQ(".foo", conf->cpp_extension); - CHECK(conf->detect_shebang); CHECK(!conf->direct_mode); CHECK(conf->disable); CHECK_STR_EQ_FREE1(format("a:b c:%s", user), conf->extra_files_to_hash); @@ -349,7 +346,6 @@ TEST(conf_print_items) "cc", true, "ce", - true, false, true, "efth", @@ -378,7 +374,7 @@ TEST(conf_print_items) } conf_print_items(&conf, conf_item_receiver, NULL); - CHECK_INT_EQ(26, n_received_conf_items); + CHECK_INT_EQ(25, n_received_conf_items); CHECK_STR_EQ("base_dir = bd", received_conf_items[n++].descr); CHECK_STR_EQ("cache_dir = cd", received_conf_items[n++].descr); CHECK_STR_EQ("cache_dir_levels = 7", received_conf_items[n++].descr); @@ -386,7 +382,6 @@ TEST(conf_print_items) CHECK_STR_EQ("compiler_check = cc", received_conf_items[n++].descr); CHECK_STR_EQ("compression = true", received_conf_items[n++].descr); CHECK_STR_EQ("cpp_extension = ce", received_conf_items[n++].descr); - CHECK_STR_EQ("detect_shebang = true", received_conf_items[n++].descr); CHECK_STR_EQ("direct_mode = false", received_conf_items[n++].descr); CHECK_STR_EQ("disable = true", received_conf_items[n++].descr); CHECK_STR_EQ("extra_files_to_hash = efth", received_conf_items[n++].descr);