Skip to content
Open
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
61 changes: 61 additions & 0 deletions srcpkgs/fsearch/INSTALL.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
NOTICE: fsearch 0.3.x configuration format changed.

The old configuration (0.2.x) used fsearch.conf in INI format.
This format is no longer valid. fsearch does NOT
automatically migrate your settings.
You must migrate your settings to the new JSON format BEFORE
launching the new version.

Before launching the new version:

1. Backup your old config (recommended)
mv ~/.config/fsearch/fsearch.conf \
~/.config/fsearch/fsearch.conf.bak 2>/dev/null

2. Remove legacy database index
rm -f ~/.local/share/fsearch/fsearch.db

3. Migrate your settings to the new JSON format.
See the mapping below for common settings.

Configuration migration (0.2.x -> 0.3.x):

Old format (fsearch.conf - INI):

[Database]
folders=/home/void;/media/storage;
exclude_paths=/home/void/.cache;/tmp;
exclude_patterns=*.tmp;*.bak;

[Interface]
dark_theme=true
show_hidden_files=false

New format (fsearch.conf - JSON):

{
"database": {
"indexed_locations": [
"/home/void",
"/media/storage"
],
"excluded_locations": [
"/home/void/.cache",
"/tmp"
],
"excluded_wildcards": [
"*.tmp",
"*.bak"
]
},
"ui": {
"show_hidden_files": false
}
}

Once the new configuration is in place:

1. Open FSearch.
2. Go to Database -> Update Database (or press Ctrl+R).
3. Ensure mounted partitions or secondary drives are listed
under Preferences -> Database -> Included Locations.
71 changes: 25 additions & 46 deletions srcpkgs/fsearch/patches/query.patch
Original file line number Diff line number Diff line change
@@ -1,46 +1,25 @@
--- a/src/fsearch_time_utils.c
+++ b/src/fsearch_time_utils.c
@@ -377,7 +377,7 @@ parse_implicit_date_time_constants(const
}

static bool
-parse_date_time_constants(const char *str, time_t *time_start_out, time_t *time_end_out) {
+parse_date_time_constants(const char *str, int64_t *time_start_out, int64_t *time_end_out) {
struct tm tm_start = {};
struct tm tm_end = {};

@@ -469,7 +469,7 @@ round_down_tm_to_reference_with_date_tim
}

bool
-fsearch_date_time_parse_interval(const char *str, time_t *time_start_out, time_t *time_end_out) {
+fsearch_date_time_parse_interval(const char *str, int64_t *time_start_out, int64_t *time_end_out) {
if (parse_date_time_constants(str, time_start_out, time_end_out)) {
return true;
}
--- a/src/fsearch_time_utils.h
+++ b/src/fsearch_time_utils.h
@@ -1,7 +1,7 @@
#pragma once

#include <stdbool.h>
-#include <time.h>
+#include <stdint.h>

bool
-fsearch_date_time_parse_interval(const char *str, time_t *time_start_out, time_t *time_end_out);
\ No newline at end of file
+fsearch_date_time_parse_interval(const char *str, int64_t *time_start_out, int64_t *time_end_out);
--- a/src/tests/test_time_utils.c
+++ b/src/tests/test_time_utils.c
@@ -49,8 +49,8 @@ test_parse_time_interval(void) {

for (gint i = 0; i < G_N_ELEMENTS(strings); ++i) {
FsearchTestTimeIntervalParseContext *ctx = &strings[i];
- time_t time_start = 0;
- time_t time_end = 0;
+ int64_t time_start = 0;
+ int64_t time_end = 0;

gboolean res = fsearch_date_time_parse_interval(ctx->string, &time_start, &time_end);
g_assert_true(res == ctx->expected_success);
diff --git a/src/fsearch_database_scan.c b/src/fsearch_database_scan.c
index 5f1628ef..f6343847 100644
--- a/src/fsearch_database_scan.c
+++ b/src/fsearch_database_scan.c
@@ -75,7 +75,7 @@ add_folder(DatabaseWalkContext *walk_context, const char *name, const char *path
parent,
DATABASE_ENTRY_TYPE_FOLDER,
DATABASE_INDEX_PROPERTY_MODIFICATION_TIME,
- mtime,
+ (int64_t)mtime,
DATABASE_INDEX_PROPERTY_NONE);
if (!folder_entry) {
return NULL;
@@ -101,9 +101,9 @@ add_file(DatabaseWalkContext *walk_context, const char *name, off_t size, time_t
parent,
DATABASE_ENTRY_TYPE_FILE,
DATABASE_INDEX_PROPERTY_SIZE,
- size,
+ (int64_t)size,
DATABASE_INDEX_PROPERTY_MODIFICATION_TIME,
- mtime,
+ (int64_t)mtime,
DATABASE_INDEX_PROPERTY_NONE);
if (!file_entry) {
return NULL;
22 changes: 17 additions & 5 deletions srcpkgs/fsearch/template
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Template file for 'fsearch'
pkgname=fsearch
version=0.2.3
version=0.3.1
revision=1
build_style=meson
hostmakedepends="gettext glib-devel pkg-config"
makedepends="gtk+3-devel pcre2-devel"
short_desc="Fast file search utility based on GTK+3"
build_helper="qemu"
hostmakedepends="gettext itstool glib-devel pkg-config"
makedepends="gtk+3-devel"
depends="desktop-file-utils hicolor-icon-theme"
short_desc="Fast file search utility inspired by Everything"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://cboxdoerfer.github.io/fsearch/"
changelog="https://github.com/cboxdoerfer/fsearch/releases#release-${version}"
distfiles="https://github.com/cboxdoerfer/fsearch/archive/${version}.tar.gz"
checksum=b3c576bf1230da7c374d00bb32d72686b940b4dee80d941495acfdd5437bf117
checksum=b16ab75556d841bf858633710d71c92f35d34362614b8584b0a5b71690a72c39

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
CFLAGS+=" -D_LARGEFILE64_SOURCE"
fi

post_extract() {
sed -i '/#include <linux\/fanotify.h>/d' \
src/fsearch_folder_monitor_fanotify.c
}