public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/mhddfs/files/, sys-fs/mhddfs/
@ 2019-01-14  9:46 Sergey Popov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Popov @ 2019-01-14  9:46 UTC (permalink / raw
  To: gentoo-commits

commit:     8c316845267e069a89eb6c273de1233abcaa4cb6
Author:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 14 09:43:33 2019 +0000
Commit:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Mon Jan 14 09:45:52 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c316845

sys-fs/mhddfs: revision bump

Bump EAPI to 7. Fix segfault, use slotted sys-fs/fuse dependency
Committed straight to stable

Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
Closes: https://bugs.gentoo.org/570992
Closes: https://bugs.gentoo.org/673644

Package-Manager: Portage-2.3.49, Repoman-2.3.10

 .../mhddfs/files/mhddfs-0.1.39-segfault-fix.patch  | 207 +++++++++++++++++++++
 .../files/mhddfs-respect-compiler-vars.patch       |   4 +-
 ...hddfs-0.1.39.ebuild => mhddfs-0.1.39-r1.ebuild} |  21 ++-
 3 files changed, 221 insertions(+), 11 deletions(-)

diff --git a/sys-fs/mhddfs/files/mhddfs-0.1.39-segfault-fix.patch b/sys-fs/mhddfs/files/mhddfs-0.1.39-segfault-fix.patch
new file mode 100644
index 00000000000..493a7839619
--- /dev/null
+++ b/sys-fs/mhddfs/files/mhddfs-0.1.39-segfault-fix.patch
@@ -0,0 +1,207 @@
+Patch backported from
+https://github.com/vdudouyt/mhddfs-nosegfault
+
+Thanks to Gabor Kovari <gabor.kovari@gmail.com>
+
+--- a/src/main.c	2012-06-17 16:09:56.000000000 +0200
++++ b/src/main.c	2015-12-21 16:32:29.000000000 +0100
+@@ -33,6 +33,13 @@
+ #include <sys/time.h>
+ #include <utime.h>
+ 
++#include <execinfo.h>
++#include <signal.h>
++#include <unistd.h>
++
++#include <glib.h>
++#include <sys/resource.h>
++
+ #ifndef WITHOUT_XATTR
+ #include <attr/xattr.h>
+ #endif
+@@ -42,7 +49,21 @@
+ 
+ #include "debug.h"
+ 
+-#include <uthash.h>
++void save_backtrace(int sig)
++{
++  void *array[10];
++  size_t size;
++
++  // get void*'s for all entries on the stack
++  size = backtrace(array, 10);
++
++  // print out all the frames to stderr
++  fprintf(stderr, "Error: signal %d\n", sig);
++  FILE *log = fopen("/tmp/mhddfs_backtrace.log", "w");
++  backtrace_symbols_fd(array, size, fileno(log));
++  fclose(log);
++  exit(1);
++}
+ 
+ // getattr
+ static int mhdd_stat(const char *file_name, struct stat *buf)
+@@ -161,16 +182,13 @@
+ 	mhdd_debug(MHDD_MSG, "mhdd_readdir: %s\n", dirname);
+ 	char **dirs = (char **) calloc(mhdd.cdirs+1, sizeof(char *));
+ 
++	struct stat st;
++
+ 	typedef struct dir_item {
+ 		char            *name;
+ 		struct stat     *st;
+-		UT_hash_handle   hh;
+ 	} dir_item;
+ 
+-	dir_item * items_ht = NULL;
+-
+-
+-	struct stat st;
+ 
+ 	// find all dirs
+ 	for(i = j = found = 0; i<mhdd.cdirs; i++) {
+@@ -194,6 +212,8 @@
+ 		return -errno;
+ 	}
+ 
++	GHashTable* hash = g_hash_table_new(g_str_hash, g_str_equal);
++
+ 	// read directories
+ 	for (i = 0; dirs[i]; i++) {
+ 		struct dirent *de;
+@@ -204,51 +224,43 @@
+ 		while((de = readdir(dh))) {
+ 			// find dups
+ 			
+-			struct dir_item *prev;
+-
+-			HASH_FIND_STR(items_ht, de->d_name, prev);
+-
+-			if (prev) {
++			if(g_hash_table_lookup(hash, de->d_name))
++			{
+ 				continue;
+ 			}
+ 
+ 			// add item
+ 			char *object_name = create_path(dirs[i], de->d_name);
+-			struct dir_item *new_item =
+-				calloc(1, sizeof(struct dir_item));
++			struct dir_item *new_item =	calloc(1, sizeof(struct dir_item));
+ 
+ 			new_item->name = strdup(de->d_name);
+ 			new_item->st = calloc(1, sizeof(struct stat));
+ 			lstat(object_name, new_item->st);
+ 
+-			HASH_ADD_KEYPTR(
+-				hh,
+-				items_ht,
+-				new_item->name,
+-				strlen(new_item->name),
+-				new_item
+-			);
++			g_hash_table_insert(hash, new_item->name, new_item);
+ 			free(object_name);
+ 		}
+ 
+ 		closedir(dh);
+ 	}
+ 
+-	dir_item *item, *tmp;
+-
+-	// fill list
+-	HASH_ITER(hh, items_ht, item, tmp) {
+-		if (filler(buf, item->name, item->st, 0))
+-			break;
+-	}
++	dir_item *item;
+ 
+-	// free memory
+-	HASH_ITER(hh, items_ht, item, tmp) {
++	gpointer key, value;	
++	GHashTableIter iter;
++	g_hash_table_iter_init(&iter, hash);
++
++	while(g_hash_table_iter_next (&iter, &key, &value))
++	{
++		item = (dir_item*) value;
++		int result = filler(buf, item->name, item->st, 0);
+ 		free(item->name);
+ 		free(item->st);
+ 		free(item);
++		if(result) break;
+ 	}
+-	HASH_CLEAR(hh, items_ht);
++
++	g_hash_table_destroy(hash);
+ 
+ 	for (i = 0; dirs[i]; i++)
+ 		free(dirs[i]);
+@@ -1008,6 +1020,19 @@
+ }
+ #endif
+ 
++static void limits_init()
++{
++   struct rlimit limit;
++   limit.rlim_cur = 512000;
++   limit.rlim_max = 512000;
++
++   if(setrlimit(RLIMIT_NOFILE, &limit) != 0)
++   {
++      perror("setrlimit() failed");
++      exit(-1);
++   }
++}
++
+ // functions links
+ static struct fuse_operations mhdd_oper = {
+ 	.getattr    	= mhdd_stat,
+@@ -1048,5 +1073,7 @@
+ 	mhdd_debug_init();
+ 	struct fuse_args *args = parse_options(argc, argv);
+ 	flist_init();
++	limits_init();
++	signal(SIGSEGV, save_backtrace);
+ 	return fuse_main(args->argc, args->argv, &mhdd_oper, 0);
+ }
+--- a/src/usage.c	2012-06-17 16:09:56.000000000 +0200
++++ b/src/usage.c	2015-12-21 16:32:29.000000000 +0100
+@@ -25,6 +25,7 @@
+ 		"\n"
+ 		"Multi-hdd FUSE filesystem\n"
+ 		" Copyright (C) 2008, Dmitry E. Oboukhov <dimka@avanto.org>\n"
++		" Copyright (C) 2015, Valentin Dudouyt <valentin.dudouyt@gmail.com>\n"		
+ 		"\n"
+ 		"Usage:\n"
+ 		" mhddfs dir1,dir2.. mountpoint [ -o OPTIONS ]\n"
+--- a/Makefile	2016-01-05 16:45:10.184105001 +0100
++++ b/Makefile	2015-12-21 16:32:29.000000000 +0100
+@@ -22,13 +22,13 @@
+ 
+ TARGET	=	mhddfs
+ 
+-CFLAGS	+=	-Wall $(shell pkg-config fuse --cflags) \
+-			-DFUSE_USE_VERSION=26 -MMD
++CFLAGS	=	-Wall $(shell pkg-config fuse glib-2.0 --cflags) \
++			-DFUSE_USE_VERSION=26 -MMD -g -rdynamic -O0
+ ifdef WITHOUT_XATTR
+ CFLAGS	+=	-DWITHOUT_XATTR
+ endif
+ 
+-LIBS		=	$(shell pkg-config fuse --libs)
++LDFLAGS	=	$(shell pkg-config fuse glib-2.0 --libs)
+ 
+ FORTAR	=	src COPYING LICENSE README Makefile \
+ 		README.ru.UTF-8 ChangeLog mhddfs.1 \
+@@ -53,7 +53,7 @@
+ ifeq ($(DEBVERSION), $(VERSION))
+ all: $(TARGET)
+ else
+-all: update_version $(TARGET)
++all: $(TARGET)
+ endif
+ 
+ update_version:
+ 

diff --git a/sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch b/sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch
index 331bb7c23f6..0c6f24f4d1a 100644
--- a/sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch
+++ b/sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch
@@ -1,5 +1,5 @@
---- Makefile.orig	2012-11-19 15:25:21.665692111 +0400
-+++ Makefile	2012-11-19 15:27:08.406691288 +0400
+--- a/Makefile	2012-11-19 15:25:21.665692111 +0400
++++ b/Makefile	2012-11-19 15:27:08.406691288 +0400
 @@ -22,13 +22,13 @@
  
  TARGET	=	mhddfs

diff --git a/sys-fs/mhddfs/mhddfs-0.1.39.ebuild b/sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild
similarity index 75%
rename from sys-fs/mhddfs/mhddfs-0.1.39.ebuild
rename to sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild
index 79fe6fb79f8..f161e79fa0f 100644
--- a/sys-fs/mhddfs/mhddfs-0.1.39.ebuild
+++ b/sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
+EAPI=7
 
-inherit base eutils toolchain-funcs
+inherit toolchain-funcs
 
 MY_P="${PN}_${PV}"
 
@@ -14,14 +14,17 @@ SRC_URI="http://mhddfs.uvw.ru/downloads/${MY_P}.tar.gz"
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="amd64"
+
 IUSE="l10n_ru suid"
 
-RDEPEND=">=sys-fs/fuse-2.7.0"
-DEPEND="${RDEPEND}
-	dev-libs/uthash"
+RDEPEND="sys-fs/fuse:0"
+DEPEND="${RDEPEND}"
 
-DOCS="ChangeLog README"
-PATCHES=( "${FILESDIR}/${PN}-respect-compiler-vars.patch" )
+DOCS=( ChangeLog README )
+PATCHES=(
+	"${FILESDIR}/${PN}-respect-compiler-vars.patch"
+	"${FILESDIR}/${P}-segfault-fix.patch"
+)
 
 src_compile() {
 	emake CC="$(tc-getCC)"
@@ -30,7 +33,7 @@ src_compile() {
 src_install() {
 	dobin mhddfs
 	doman mhddfs.1
-	dodoc ${DOCS}
+	einstalldocs
 	use l10n_ru && dodoc README.ru.UTF-8
 	use suid && fperms u+s /usr/bin/${PN}
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/mhddfs/files/, sys-fs/mhddfs/
@ 2019-04-25 12:45 Lars Wendler
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Wendler @ 2019-04-25 12:45 UTC (permalink / raw
  To: gentoo-commits

commit:     dd4f62cb40ad550728668716d708780ba5cf60b6
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 25 12:45:10 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Apr 25 12:45:44 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd4f62cb

sys-fs/mhddfs: Fixed build against >=sys-apps/attr-2.4.48

Permission kindly granted by Pinkbyte

Closes: https://bugs.gentoo.org/648670
Package-Manager: Portage-2.3.64, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-fs/mhddfs/files/mhddfs-0.1.39-xattr.patch | 26 ++++++++++++++++++++++++++
 sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild         |  3 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/sys-fs/mhddfs/files/mhddfs-0.1.39-xattr.patch b/sys-fs/mhddfs/files/mhddfs-0.1.39-xattr.patch
new file mode 100644
index 00000000000..57a64281d65
--- /dev/null
+++ b/sys-fs/mhddfs/files/mhddfs-0.1.39-xattr.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/648670
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+
+--- mhddfs-0.1.39/src/main.c
++++ mhddfs-0.1.39/src/main.c
+@@ -34,7 +34,7 @@
+ #include <utime.h>
+ 
+ #ifndef WITHOUT_XATTR
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #endif
+ 
+ #include "parse_options.h"
+--- mhddfs-0.1.39/src/tools.c
++++ mhddfs-0.1.39/src/tools.c
+@@ -32,7 +32,7 @@
+ #include <dirent.h>
+ 
+ #ifndef WITHOUT_XATTR
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #endif
+ 
+ #include "tools.h"

diff --git a/sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild b/sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild
index f161e79fa0f..1c4db46a0fa 100644
--- a/sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild
+++ b/sys-fs/mhddfs/mhddfs-0.1.39-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -24,6 +24,7 @@ DOCS=( ChangeLog README )
 PATCHES=(
 	"${FILESDIR}/${PN}-respect-compiler-vars.patch"
 	"${FILESDIR}/${P}-segfault-fix.patch"
+	"${FILESDIR}/${P}-xattr.patch"
 )
 
 src_compile() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/mhddfs/files/, sys-fs/mhddfs/
@ 2023-08-10  8:55 Sergey Popov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Popov @ 2023-08-10  8:55 UTC (permalink / raw
  To: gentoo-commits

commit:     7660b28a2f957a960bcdb17f55768fa5d93c5537
Author:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 10 08:52:36 2023 +0000
Commit:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Thu Aug 10 08:52:42 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7660b28a

sys-fs/mhddfs: fix parallel builds

Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
Reported-by: Toralf Förster <toralf <AT> gentoo.org>
Bug: https://bugs.gentoo.org/880051
Closes: https://bugs.gentoo.org/911984

 sys-fs/mhddfs/files/mhddfs-0.1.39-parallel-build.patch | 17 +++++++++++++++++
 sys-fs/mhddfs/mhddfs-0.1.39-r2.ebuild                  |  3 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/sys-fs/mhddfs/files/mhddfs-0.1.39-parallel-build.patch b/sys-fs/mhddfs/files/mhddfs-0.1.39-parallel-build.patch
new file mode 100644
index 000000000000..b9c2d19603fe
--- /dev/null
+++ b/sys-fs/mhddfs/files/mhddfs-0.1.39-parallel-build.patch
@@ -0,0 +1,17 @@
+Sometimes obj directory was not created during
+parallel builds
+
+Related bugreports:
+https://bugs.gentoo.org/880051
+https://bugs.gentoo.org/911984
+
+--- a/Makefile	2023-08-10 11:43:39.826589819 +0300
++++ b/Makefile	2023-08-10 11:43:50.121722774 +0300
+@@ -90,6 +90,7 @@
+ 	touch $@
+ 
+ obj/%.o: src/%.c
++	mkdir -p obj
+ 	$(CC) $(CFLAGS) -c $< -o $@
+ 
+ clean:

diff --git a/sys-fs/mhddfs/mhddfs-0.1.39-r2.ebuild b/sys-fs/mhddfs/mhddfs-0.1.39-r2.ebuild
index 201ecb8f7ae5..a8fc5266b8a3 100644
--- a/sys-fs/mhddfs/mhddfs-0.1.39-r2.ebuild
+++ b/sys-fs/mhddfs/mhddfs-0.1.39-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -29,6 +29,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-respect-compiler-vars.patch"
 	"${FILESDIR}/${P}-segfault-fix.patch"
 	"${FILESDIR}/${P}-xattr.patch"
+	"${FILESDIR}/${P}-parallel-build.patch"
 )
 
 src_compile() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-10  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-25 12:45 [gentoo-commits] repo/gentoo:master commit in: sys-fs/mhddfs/files/, sys-fs/mhddfs/ Lars Wendler
  -- strict thread matches above, loose matches on Subject: below --
2023-08-10  8:55 Sergey Popov
2019-01-14  9:46 Sergey Popov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox