Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user/duperemove: move from main and update to 0.15 #3555

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions user/duperemove/patches/atomic-globals.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/progress.c
+++ b/progress.c
@@ -66,7 +66,7 @@ static uint64_t files_scanned, bytes_scanned;
/*
* Used to track the status of our search extents from blocks
*/
-static uint64_t search_total, search_processed;
+static _Atomic uint64_t search_total, search_processed;

#define s_save_pos() if (tty) printf("\33[s");
#define s_restore_pos() if (tty) printf("\33[u");
15 changes: 15 additions & 0 deletions user/duperemove/patches/delete-duplicate-definition.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/results-tree.h
+++ b/results-tree.h
@@ -20,11 +20,7 @@
#include <glib.h>

#include "csum.h"
-
-// TODO: delete this
-struct list_head {
- struct list_head *next, *prev;
-};
+#include "list.h"

struct results_tree {
struct rb_root root;
29 changes: 29 additions & 0 deletions user/duperemove/patches/fix-cfi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/dbfile.c
+++ b/dbfile.c
@@ -561,6 +561,17 @@ void dbfile_close_handle(struct dbhandle *db)
}
}

+/*
+ * dbfile_close_handle takes struct dbhandle*.
+ * we need a function that takes void* so we
+ * can pass it to register_cleanup without
+ * causing UB.
+ */
+static void cleanup_dbhandle(void *db)
+{
+ dbfile_close_handle(db);
+}
+
struct dbhandle *dbfile_open_handle_thread(char *filename, struct threads_pool *pool)
{
struct dbhandle *db;
@@ -569,7 +580,7 @@ struct dbhandle *dbfile_open_handle_thread(char *filename, struct threads_pool *
dbfile_unlock();

if (db)
- register_cleanup(pool, (void*)&dbfile_close_handle, db);
+ register_cleanup(pool, (void*)&cleanup_dbhandle, db);
return db;
}

33 changes: 33 additions & 0 deletions user/duperemove/patches/remove-libbsd-dependency.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ DIST=duperemove-$(VERSION)
DIST_TARBALL=$(VERSION).tar.gz
TEMP_INSTALL_DIR:=$(shell mktemp -du -p .)

-EXTRA_CFLAGS=$(shell $(PKG_CONFIG) --cflags glib-2.0,sqlite3,blkid,mount,uuid,libbsd)
+EXTRA_CFLAGS=$(shell $(PKG_CONFIG) --cflags glib-2.0,sqlite3,blkid,mount,uuid)
EXTRA_LIBS=$(shell $(PKG_CONFIG) --libs glib-2.0,sqlite3,blkid,mount,uuid)

ifdef DEBUG
--- a/file_scan.c
+++ b/file_scan.c
@@ -41,7 +41,7 @@
#include <libmount/libmount.h>
#include <sys/sysmacros.h>
#include <uuid/uuid.h>
-#include <bsd/sys/queue.h>
+#include <sys/queue.h>

#include <glib.h>

--- a/filerec.h
+++ b/filerec.h
@@ -19,7 +19,7 @@
#include <stdint.h>
#include <time.h>
#include <glib.h>
-#include <bsd/sys/queue.h>
+#include <sys/queue.h>
#include "rbtree.h"
#include "results-tree.h"

21 changes: 11 additions & 10 deletions main/duperemove/template.py → user/duperemove/template.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
pkgname = "duperemove"
pkgver = "0.14.1"
pkgver = "0.15"
pkgrel = 0
build_style = "makefile"
make_build_env = {
"VERSION": f"v{pkgver}",
"IS_RELEASE": "1",
}
make_install_args = ["SBINDIR=/usr/bin"]
hostmakedepends = ["pkgconf"]
makedepends = ["glib-devel", "sqlite-devel", "linux-headers"]
makedepends = [
"glib-devel",
"musl-bsd-headers",
"sqlite-devel",
"xxhash-devel",
"linux-headers",
]
pkgdesc = "Tools for deduplicating extents in filesystems like Btrfs"
maintainer = "autumnontape <[email protected]>"
license = "GPL-2.0-only AND BSD-2-Clause"
license = "GPL-2.0-only"
url = "https://github.com/markfasheh/duperemove"
source = f"{url}/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "5970a68e37c1b509448f6d82278ca21403cc7722f6267f7da27723b0749088ea"
tool_flags = {"CFLAGS": ["-std=gnu2x"]}
sha256 = "1dacde51f12ead1da6b067d5520731a83adee3301fbc36eb282cf8362b93d773"
tool_flags = {"CFLAGS": ["-std=c23"]}
hardening = ["vis", "cfi"]
# no test suite exists
options = ["!check"]


def post_install(self):
self.install_license("LICENSE.xxhash")
Loading