diff --git a/Tupfile b/Tupfile index 132e4eaa..7350ed69 100644 --- a/Tupfile +++ b/Tupfile @@ -23,7 +23,7 @@ ifeq (@(TUP_SUDO_SUID),y) suid = ; chown root:$(TUP_SUID_GROUP) tup; chmod u+s tup endif -LDFLAGS += `pkg-config fuse --libs` +LDFLAGS += `pkg-config fuse3 --libs` LDFLAGS += -lm : src/tup/tup/main.o libtup.a src/lua/liblua.a |> ^ LINK tup^ version=`git describe`; echo "const char *tup_version(void) {return \"$version\";}" | $(CC) -x c -c - -o tup-version.o $(CFLAGS) -Wno-missing-prototypes; $(CC) %f tup-version.o -o tup -lpthread $(LDFLAGS) $(suid) |> tup tup-version.o diff --git a/Tuprules.tup b/Tuprules.tup index 3f0953be..df670498 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -34,7 +34,7 @@ LDFLAGS += -m32 endif export PKG_CONFIG_PATH -CFLAGS += `pkg-config fuse --cflags` +CFLAGS += `pkg-config fuse3 --cflags` # Compatibility function prototypes and include path for wrapper functions MINGWCFLAGS += -include $(TUP_CWD)/src/compat/win32/mingw.h diff --git a/build.sh b/build.sh index 173691b7..cdddf2c1 100755 --- a/build.sh +++ b/build.sh @@ -2,8 +2,8 @@ label=${TUP_LABEL:-bootstrap} os=`uname -s` -plat_cflags="`pkg-config fuse --cflags`" -plat_ldflags="`pkg-config fuse --libs`" +plat_cflags="`pkg-config fuse3 --cflags`" +plat_ldflags="`pkg-config fuse3 --libs`" plat_files="" LDFLAGS="-lm" CC=gcc diff --git a/src/tup/luaparser.c b/src/tup/luaparser.c index 081911a2..b4cf1209 100644 --- a/src/tup/luaparser.c +++ b/src/tup/luaparser.c @@ -210,7 +210,7 @@ static int tuplua_function_definerule(lua_State *ls) if(parse_dependent_tupfiles(&input_path_list, tf) < 0) return luaL_error(ls, "Error while parsing dependent Tupfiles"); if(get_name_list(tf, &input_path_list, &nl, 1) < 0) - return -1; + return luaL_error(ls, "Error while scanning 'inputs'."); init_name_list(&r.inputs); init_name_list(&r.order_only_inputs); @@ -329,7 +329,7 @@ static int tuplua_function_getrelativedir(lua_State *ls) struct estring e; if(estring_init(&e) < 0) - return -1; + return luaL_error(ls, "No memory"); dirname = tuplua_tostring(ls, -1); if(!dirname) @@ -338,7 +338,7 @@ static int tuplua_function_getrelativedir(lua_State *ls) if(dest < 0) return luaL_error(ls, "Failed to find tup entry for '%s' relative to the current Tupfile", dirname); if(get_relative_dir(NULL, &e, NULL, dest, tf->tupid, NULL) < 0) - return -1; + return luaL_error(ls, "get_relative_dir() failed"); lua_pushlstring(ls, e.s, e.len); free(e.s); return 1; @@ -359,7 +359,7 @@ static int tuplua_function_getconfig(lua_State *ls) return luaL_error(ls, "Must be passed an config variable name as an argument."); value_size = tup_db_get_varlen(tf->variant, name, name_size) + 1; if(value_size < 0) - luaL_error(ls, "Failed to get config variable length."); + return luaL_error(ls, "Failed to get config variable length."); value = malloc(value_size); value_as_argument = value; diff --git a/src/tup/server/fuse_fs.c b/src/tup/server/fuse_fs.c index e9df1375..ca81662e 100644 --- a/src/tup/server/fuse_fs.c +++ b/src/tup/server/fuse_fs.c @@ -574,7 +574,7 @@ static void add_dir_entries(DIR *dp, void *buf, fuse_fill_dir_t filler, st.st_mode = de->d_type << 12; if(!ignore_dot_tup || strcmp(de->d_name, ".tup") != 0) - if(filler(buf, de->d_name, &st, 0)) + if(filler(buf, de->d_name, &st, 0, FUSE_FILL_DIR_PLUS)) break; } } @@ -703,7 +703,7 @@ static int tup_fs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, put_finfo(finfo); return -1; } - if(filler(buf, realname, &st, 0)) + if(filler(buf, realname, &st, 0, FUSE_FILL_DIR_PLUS)) break; } @@ -735,7 +735,7 @@ static int tup_fs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, if(strchr(realname, '/') != NULL) continue; - if (filler(buf, realname, &st, 0)) + if (filler(buf, realname, &st, 0, FUSE_FILL_DIR_PLUS)) break; } } diff --git a/src/tup/server/fuse_server.c b/src/tup/server/fuse_server.c index 17889f36..6ac8855d 100644 --- a/src/tup/server/fuse_server.c +++ b/src/tup/server/fuse_server.c @@ -42,6 +42,7 @@ #include #include #include +#include #define TUP_MNT ".tup/mnt" @@ -684,7 +685,7 @@ int tup_fuse_server_get_dir_entries(const char *path, void *buf, pd = container_of(st, struct parser_directory, st); RB_FOREACH(st, string_entries, &pd->files) { - if(filler(buf, st->s, NULL, 0)) + if(filler(buf, st->s, NULL, 0, FUSE_FILL_DIR_PLUS)) goto out_unps; } rc = 0; diff --git a/src/tup/server/tup_fuse_fs.h b/src/tup/server/tup_fuse_fs.h index 9a5158a8..ed83342d 100644 --- a/src/tup/server/tup_fuse_fs.h +++ b/src/tup/server/tup_fuse_fs.h @@ -21,7 +21,7 @@ #ifndef tup_fuse_fs_h #define tup_fuse_fs_h -#define FUSE_USE_VERSION 26 +#define FUSE_USE_VERSION 30 #include #include "tup/tupid.h" diff --git a/tup.1 b/tup.1 index 40b6456a..9584e8c6 100644 --- a/tup.1 +++ b/tup.1 @@ -467,10 +467,10 @@ will output the filenames a_binary.bin and b_binary.bin. Only the first glob exp Set the $-variable "var" to the value on the right-hand side. Both forms are the same, and are allowed to more easily support converting old Makefiles. The $-variable "var" can later be referenced by using "$(var)". Variables referenced here are always expanded immediately. As such, setting a variable to have a %-flag does not make sense, because a %-flag is only valid in a :-rule. The syntax $(var_%e) is allowed in a :-rule. Variable references do not nest, so something like $(var1_$(var2)) does not make sense. You also cannot pass variable definitions in the command line or through the environment. Any $-variable that begins with the string "CONFIG_" is automatically converted to the @-variable of the same name minus the "CONFIG_" prefix. In other words, $(CONFIG_FOO) and @(FOO) are interchangeable. Attempting to assign a value to a CONFIG_ variable in a Tupfile results in an error, since these can only be set in the tup.config file. Note that you may see a syntax using back-ticks when setting variables, such as: .nf -CFLAGS += `pkg-config fuse --cflags` +CFLAGS += `pkg-config fuse3 --cflags` .fi -Tup does not do any special processing for back-ticks, so the pkg-config command is not actually executed when the variable is set in this example. Instead, this is passed verbatim to any place that uses it. Therefore if a command later references $(CFLAGS), it will contain the string `pkg-config fuse --cflags`, so it will be parsed by the shell. +Tup does not do any special processing for back-ticks, so the pkg-config command is not actually executed when the variable is set in this example. Instead, this is passed verbatim to any place that uses it. Therefore if a command later references $(CFLAGS), it will contain the string `pkg-config fuse3 --cflags`, so it will be parsed by the shell. .TP .B var += value Append "value" to the end of the current value of "var". If "var" has not been set, this is equivalent to a regular '=' statement. If "var" already has a value, a space is appended to the $-variable before the new value is appended.