File: fuse3.patch

package info (click to toggle)
apt-cacher-ng 3.7.5-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,312 kB
  • sloc: cpp: 20,821; sh: 641; perl: 383; makefile: 147
file content (182 lines) | stat: -rw-r--r-- 6,329 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
From: Tim Woodall <debianbugs@woodall.me.uk>
Bug-Debian: 1084459


diff -urN apt-cacher-ng-3.7.5.orig/CMakeLists.txt apt-cacher-ng-3.7.5/CMakeLists.txt
--- apt-cacher-ng-3.7.5.orig/CMakeLists.txt	2024-07-22 15:32:18.000000000 +0000
+++ apt-cacher-ng-3.7.5/CMakeLists.txt	2024-07-22 15:32:18.000000000 +0000
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
 
 # try to set the best C++ language level
 set(CMAKE_CXX_STANDARD 20)
diff -urN apt-cacher-ng-3.7.5.orig/fs/CMakeLists.txt apt-cacher-ng-3.7.5/fs/CMakeLists.txt
--- apt-cacher-ng-3.7.5.orig/fs/CMakeLists.txt	2024-07-22 15:32:18.000000000 +0000
+++ apt-cacher-ng-3.7.5/fs/CMakeLists.txt	2024-07-22 15:32:18.000000000 +0000
@@ -3,16 +3,16 @@
 ## Attempt to build acngfs where possible ##
 ############################################
 
-pkg_check_modules(fuse fuse)
+pkg_check_modules(fuse fuse3)
 
 _append(acngfs_cflags ${fuse_CFLAGS} ${CFLAGS_PTHREAD})
 
 # double-check and make sure it compiles
-FILE(READ ${PROJECT_SOURCE_DIR}/${TESTKITDIR}/HAVE_FUSE_25.cc TESTSRC)
+FILE(READ ${PROJECT_SOURCE_DIR}/${TESTKITDIR}/HAVE_FUSE_30.cc TESTSRC)
 SET(CMAKE_REQUIRED_FLAGS "${ACNG_COMPFLAGS} ${acngfs_cflags}")
-CHECK_CXX_SOURCE_COMPILES("${TESTSRC}" HAVE_FUSE_25)
+CHECK_CXX_SOURCE_COMPILES("${TESTSRC}" HAVE_FUSE_30)
 
-if(fuse_FOUND AND HAVE_FUSE_25)
+if(fuse_FOUND AND HAVE_FUSE_30)
         # not linking acngstuff lib, too many dependencies, so building a custom variant with MINIBUILD flag
         list(APPEND fsSRCS httpfs.cc)
         include_directories("${CMAKE_SOURCE_DIR}/src")
@@ -24,8 +24,8 @@
         endif()
         TARGET_LINK_LIBRARIES(acngfs supacng ${fuse_LDFLAGS} ${BaseNetworkLibs} ${SSL_LIB_LIST} ${EXTRA_LIBS_ACNGFS} ${CMAKE_THREAD_LIBS_INIT})
 
-else(fuse_FOUND AND HAVE_FUSE_25)
+else(fuse_FOUND AND HAVE_FUSE_30)
         message("- FUSE not found or not compatible, not building acngfs")
-endif(fuse_FOUND AND HAVE_FUSE_25)
+endif(fuse_FOUND AND HAVE_FUSE_30)
 
 
diff -urN apt-cacher-ng-3.7.5.orig/fs/httpfs.cc apt-cacher-ng-3.7.5/fs/httpfs.cc
--- apt-cacher-ng-3.7.5.orig/fs/httpfs.cc	2024-07-22 15:32:18.000000000 +0000
+++ apt-cacher-ng-3.7.5/fs/httpfs.cc	2024-07-22 15:32:18.000000000 +0000
@@ -4,7 +4,7 @@
 // Description : Simple FUSE-based filesystem for HTTP access (apt-cacher NG)
 //============================================================================
 
-#define FUSE_USE_VERSION 26
+#define FUSE_USE_VERSION 30
 
 #include "debug.h"
 
@@ -32,7 +32,7 @@
 #include <sys/vfs.h>
 #endif
 
-#include <fuse.h>
+#include <fuse3/fuse.h>
 
 #ifdef HAVE_DLOPEN
 #include <dlfcn.h>
@@ -517,7 +517,7 @@
 
 
 /// If found as downloadable, present as a file, or become a directory otherwise.
-static int acngfs_getattr(const char *path, struct stat *stbuf)
+static int acngfs_getattr(const char *path, struct stat *stbuf, fuse_file_info*)
 {
 	if(!path)
 		return -1;
@@ -541,13 +541,6 @@
 	}
 }
 
-static int acngfs_fgetattr(const char *path, struct stat *stbuf,
-	  struct fuse_file_info *)
-{
-	// FIXME: reuse the con later? or better not, size might change during operation
-	return acngfs_getattr(path, stbuf);
-}
-
 static int acngfs_access(const char *, int mask)
 {
 	// non-zero (failure) when trying to write
@@ -561,8 +554,8 @@
 }
 
 static int acngfs_readdir(const char *, void *, fuse_fill_dir_t,
-	  off_t, struct fuse_file_info *)
-{   
+	  off_t, struct fuse_file_info *, fuse_readdir_flags)
+{
 	return -EPERM;
 }
 
@@ -667,7 +660,6 @@
 
 	memset(&acngfs_oper, 0, sizeof(acngfs_oper));
 	acngfs_oper.getattr	= acngfs_getattr;
-	acngfs_oper.fgetattr	= acngfs_fgetattr;
 	acngfs_oper.access	= acngfs_access;
 	acngfs_oper.opendir	= acngfs_opendir;
 	acngfs_oper.readdir	= acngfs_readdir;
@@ -757,31 +749,24 @@
 	evtimer_add(expTimer, &expTv);
 
 #ifdef HAVE_DLOPEN
-	auto pLib = dlopen("libfuse.so.2", RTLD_LAZY);
+	auto pLib = dlopen("libfuse.so.3", RTLD_LAZY);
 	if(!pLib)
 	{
-		cerr << "Couldn't find libfuse.so.2" <<endl;
+		cerr << "Couldn't find libfuse.so.3" <<endl;
 		return -1;
 	}
-	auto pFuseSetup = (decltype(&fuse_setup)) dlsym(pLib, "fuse_setup");
-	auto pFuseLoop = (decltype(&fuse_loop_mt)) dlsym(pLib, "fuse_loop_mt");
-	if(!pFuseSetup || !pFuseLoop)
+	auto pFuseMain = (decltype(&fuse_main_fn)) dlsym(pLib, "fuse_main_fn");
+	if(!pFuseMain)
 	{
-		cerr << "Error loading libfuse.so.2" <<endl;
+		cerr << "Error loading libfuse.so.3" <<endl;
 		return -2;
 	}
 #else
-	auto pFuseSetup = &fuse_setup;
-	auto pFuseLoop = &fuse_loop_mt;
+	auto pFuseMain = &fuse_main_fn;
 #endif
 
-	int mt = 1;
-	auto fs = (*pFuseSetup) (fuseArgs.size(), &fuseArgs[0],
-			&acngfs_oper, sizeof(acngfs_oper),
-			&argv[2], &mt, nullptr);
-	if (!fs)
-		return 2;
-	auto ret = (*pFuseLoop) (fs);
+	auto ret = pFuseMain(fuseArgs.size(), &fuseArgs[0],
+			&acngfs_oper, nullptr);
 	// shutdown agents in reliable fashion
 	spare_agents.clear();
 	return ret;
diff -urN apt-cacher-ng-3.7.5.orig/systemd/CMakeLists.txt apt-cacher-ng-3.7.5/systemd/CMakeLists.txt
--- apt-cacher-ng-3.7.5.orig/systemd/CMakeLists.txt	2024-07-22 15:32:18.000000000 +0000
+++ apt-cacher-ng-3.7.5/systemd/CMakeLists.txt	2024-07-22 15:32:18.000000000 +0000
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
 
 unset(SDTYPE)
 if(HAVE_SD_NOTIFY)
diff -urN apt-cacher-ng-3.7.5.orig/tests/build/HAVE_FUSE_25.cc apt-cacher-ng-3.7.5/tests/build/HAVE_FUSE_25.cc
--- apt-cacher-ng-3.7.5.orig/tests/build/HAVE_FUSE_25.cc	2024-07-22 16:19:22.000000000 +0000
+++ apt-cacher-ng-3.7.5/tests/build/HAVE_FUSE_25.cc	1970-01-01 00:00:00.000000000 +0000
@@ -1,7 +0,0 @@
-#define _FILE_OFFSET_BITS 64
-#define FUSE_USE_VERSION 25
-#include <fuse.h>
-int main() {
-   return 0;
-}
-
diff -urN apt-cacher-ng-3.7.5.orig/tests/build/HAVE_FUSE_30.cc apt-cacher-ng-3.7.5/tests/build/HAVE_FUSE_30.cc
--- apt-cacher-ng-3.7.5.orig/tests/build/HAVE_FUSE_30.cc	1970-01-01 00:00:00.000000000 +0000
+++ apt-cacher-ng-3.7.5/tests/build/HAVE_FUSE_30.cc	2025-11-16 18:23:03.495876428 +0000
@@ -0,0 +1,7 @@
+#define _FILE_OFFSET_BITS 64
+#define FUSE_USE_VERSION 30
+#include <fuse3/fuse.h>
+int main() {
+   return 0;
+}
+