Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 704990
Collapse All | Expand All

(-)a/Tupfile (-1 / +1 lines)
Lines 23-29 ifeq (@(TUP_SUDO_SUID),y) Link Here
23
suid = ; chown root:$(TUP_SUID_GROUP) tup; chmod u+s tup
23
suid = ; chown root:$(TUP_SUID_GROUP) tup; chmod u+s tup
24
endif
24
endif
25
25
26
LDFLAGS += `pkg-config fuse --libs`
26
LDFLAGS += `pkg-config fuse3 --libs`
27
LDFLAGS += -lm
27
LDFLAGS += -lm
28
: 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
28
: 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
29
29
(-)a/Tuprules.tup (-1 / +1 lines)
Lines 34-40 LDFLAGS += -m32 Link Here
34
endif
34
endif
35
35
36
export PKG_CONFIG_PATH
36
export PKG_CONFIG_PATH
37
CFLAGS += `pkg-config fuse --cflags`
37
CFLAGS += `pkg-config fuse3 --cflags`
38
38
39
# Compatibility function prototypes and include path for wrapper functions
39
# Compatibility function prototypes and include path for wrapper functions
40
MINGWCFLAGS += -include $(TUP_CWD)/src/compat/win32/mingw.h
40
MINGWCFLAGS += -include $(TUP_CWD)/src/compat/win32/mingw.h
(-)a/build.sh (-2 / +2 lines)
Lines 2-9 Link Here
2
2
3
label=${TUP_LABEL:-bootstrap}
3
label=${TUP_LABEL:-bootstrap}
4
os=`uname -s`
4
os=`uname -s`
5
plat_cflags="`pkg-config fuse --cflags`"
5
plat_cflags="`pkg-config fuse3 --cflags`"
6
plat_ldflags="`pkg-config fuse --libs`"
6
plat_ldflags="`pkg-config fuse3 --libs`"
7
plat_files=""
7
plat_files=""
8
LDFLAGS="-lm"
8
LDFLAGS="-lm"
9
CC=gcc
9
CC=gcc
(-)a/src/tup/luaparser.c (-4 / +4 lines)
Lines 210-216 static int tuplua_function_definerule(lua_State *ls) Link Here
210
	if(parse_dependent_tupfiles(&input_path_list, tf) < 0)
210
	if(parse_dependent_tupfiles(&input_path_list, tf) < 0)
211
		return luaL_error(ls, "Error while parsing dependent Tupfiles");
211
		return luaL_error(ls, "Error while parsing dependent Tupfiles");
212
	if(get_name_list(tf, &input_path_list, &nl, 1) < 0)
212
	if(get_name_list(tf, &input_path_list, &nl, 1) < 0)
213
		return -1;
213
		return luaL_error(ls, "Error while scanning 'inputs'.");
214
214
215
	init_name_list(&r.inputs);
215
	init_name_list(&r.inputs);
216
	init_name_list(&r.order_only_inputs);
216
	init_name_list(&r.order_only_inputs);
Lines 329-335 static int tuplua_function_getrelativedir(lua_State *ls) Link Here
329
	struct estring e;
329
	struct estring e;
330
330
331
	if(estring_init(&e) < 0)
331
	if(estring_init(&e) < 0)
332
		return -1;
332
		return luaL_error(ls, "No memory");
333
333
334
	dirname = tuplua_tostring(ls, -1);
334
	dirname = tuplua_tostring(ls, -1);
335
	if(!dirname)
335
	if(!dirname)
Lines 338-344 static int tuplua_function_getrelativedir(lua_State *ls) Link Here
338
	if(dest < 0)
338
	if(dest < 0)
339
		return luaL_error(ls, "Failed to find tup entry for '%s' relative to the current Tupfile", dirname);
339
		return luaL_error(ls, "Failed to find tup entry for '%s' relative to the current Tupfile", dirname);
340
	if(get_relative_dir(NULL, &e, NULL, dest, tf->tupid, NULL) < 0)
340
	if(get_relative_dir(NULL, &e, NULL, dest, tf->tupid, NULL) < 0)
341
		return -1;
341
		return luaL_error(ls, "get_relative_dir() failed");
342
	lua_pushlstring(ls, e.s, e.len);
342
	lua_pushlstring(ls, e.s, e.len);
343
	free(e.s);
343
	free(e.s);
344
	return 1;
344
	return 1;
Lines 359-365 static int tuplua_function_getconfig(lua_State *ls) Link Here
359
		return luaL_error(ls, "Must be passed an config variable name as an argument.");
359
		return luaL_error(ls, "Must be passed an config variable name as an argument.");
360
	value_size = tup_db_get_varlen(tf->variant, name, name_size) + 1;
360
	value_size = tup_db_get_varlen(tf->variant, name, name_size) + 1;
361
	if(value_size < 0)
361
	if(value_size < 0)
362
		luaL_error(ls, "Failed to get config variable length.");
362
		return luaL_error(ls, "Failed to get config variable length.");
363
	value = malloc(value_size);
363
	value = malloc(value_size);
364
	value_as_argument = value;
364
	value_as_argument = value;
365
365
(-)a/src/tup/server/fuse_fs.c (-3 / +3 lines)
Lines 574-580 static void add_dir_entries(DIR *dp, void *buf, fuse_fill_dir_t filler, Link Here
574
		st.st_mode = de->d_type << 12;
574
		st.st_mode = de->d_type << 12;
575
575
576
		if(!ignore_dot_tup || strcmp(de->d_name, ".tup") != 0)
576
		if(!ignore_dot_tup || strcmp(de->d_name, ".tup") != 0)
577
			if(filler(buf, de->d_name, &st, 0))
577
			if(filler(buf, de->d_name, &st, 0, FUSE_FILL_DIR_PLUS))
578
				break;
578
				break;
579
	}
579
	}
580
}
580
}
Lines 703-709 static int tup_fs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, Link Here
703
				put_finfo(finfo);
703
				put_finfo(finfo);
704
				return -1;
704
				return -1;
705
			}
705
			}
706
			if(filler(buf, realname, &st, 0))
706
			if(filler(buf, realname, &st, 0, FUSE_FILL_DIR_PLUS))
707
				break;
707
				break;
708
		}
708
		}
709
709
Lines 735-741 static int tup_fs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, Link Here
735
				if(strchr(realname, '/') != NULL)
735
				if(strchr(realname, '/') != NULL)
736
					continue;
736
					continue;
737
737
738
				if (filler(buf, realname, &st, 0))
738
				if (filler(buf, realname, &st, 0, FUSE_FILL_DIR_PLUS))
739
					break;
739
					break;
740
			}
740
			}
741
		}
741
		}
(-)a/src/tup/server/fuse_server.c (-1 / +2 lines)
Lines 42-47 Link Here
42
#include <signal.h>
42
#include <signal.h>
43
#include <sys/mount.h>
43
#include <sys/mount.h>
44
#include <sys/wait.h>
44
#include <sys/wait.h>
45
#include <sys/sysmacros.h>
45
46
46
#define TUP_MNT ".tup/mnt"
47
#define TUP_MNT ".tup/mnt"
47
48
Lines 684-690 int tup_fuse_server_get_dir_entries(const char *path, void *buf, Link Here
684
	pd = container_of(st, struct parser_directory, st);
685
	pd = container_of(st, struct parser_directory, st);
685
686
686
	RB_FOREACH(st, string_entries, &pd->files) {
687
	RB_FOREACH(st, string_entries, &pd->files) {
687
		if(filler(buf, st->s, NULL, 0))
688
		if(filler(buf, st->s, NULL, 0, FUSE_FILL_DIR_PLUS))
688
			goto out_unps;
689
			goto out_unps;
689
	}
690
	}
690
	rc = 0;
691
	rc = 0;
(-)a/src/tup/server/tup_fuse_fs.h (-1 / +1 lines)
Lines 21-27 Link Here
21
#ifndef tup_fuse_fs_h
21
#ifndef tup_fuse_fs_h
22
#define tup_fuse_fs_h
22
#define tup_fuse_fs_h
23
23
24
#define FUSE_USE_VERSION 26
24
#define FUSE_USE_VERSION 30
25
25
26
#include <fuse.h>
26
#include <fuse.h>
27
#include "tup/tupid.h"
27
#include "tup/tupid.h"
(-)a/tup.1 (-2 / +2 lines)
Lines 467-476 will output the filenames a_binary.bin and b_binary.bin. Only the first glob exp Link Here
467
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:
467
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:
468
.nf
468
.nf
469
469
470
CFLAGS += `pkg-config fuse --cflags`
470
CFLAGS += `pkg-config fuse3 --cflags`
471
471
472
.fi
472
.fi
473
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.
473
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.
474
.TP
474
.TP
475
.B var += value
475
.B var += value
476
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.
476
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.

Return to bug 704990