Anyone want to import this now (or give me an ok to do so)?
Reattached.
(Worked on by various people including me, Olivier Taïbi, and Enric Morales)
On 2020/04/19 22:32, Stuart Henderson wrote:
This is now OK sthen@ to import. As there has been a fair bit of
interest in this over time, I think it might be worth considering this
for commit before 6.7 if another committer agrees, but I would not like
to add the dependency to neomutt until after release (because then
notmuch build failures for any arches would knock out building neomutt
on those arches).
On 2020/04/19 23:14, Olivier Taïbi wrote:
> Oops, just realised that the addition of MODPY_VERSION as Stuart
> Henderson suggested means that sphinx-build-3 is installed as a
> dependency, instead of sphinx-build previously. The attached port
> reflects this (sphinx-build -> sphinx-build-3 in two files).
>
> On Thu, Apr 16, 2020 at 08:47:50PM +0200, Olivier Taïbi wrote:
> > On Fri, Apr 10, 2020 at 09:47:35PM +0100, Stuart Henderson wrote:
> > > for a standalone port, use "MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3}",
> > > the FLAVOR setup is for python modules (py-* ports).
> >
> > Thanks, I did that.
> >
> > > The update of the main copy in src/lib/libz has been done at least twice
> > > (though I don't think it happened for the other copies in
sys/lib/libz and
> > > src/gnu/usr.bin/cvs - amusingly the fourth copy, in perl, is already at
> > > 1.2.11) - but not made it into the tree. The thing I remember putting
> > > some people off was the "new" z_off64_t (10 years old today in the
> > > public api).
> > >
> > > But updating it is the only option that fixes the various pain / patching
> > > / workarounds / using bundled copies in various things in ports that
> > > has been a problem at least going back to 2012.
> >
> > Would incremental changes converging towards API compatibility with
> > newer zlib stand a better chance of being committed?
> >
> > In any case, I patched notmuch-dump.c (mostly) to replace zlib by stdio
> > and added crude error checking. Thanks to the notmuch tests I believe I
> > came across a bug in src/lib/libz/gzio.c, see
> > https://marc.info/?l=openbsd-bugs&m=158697346006702
> > With this patch to base, almost all tests now pass, except:
> > - in T350-crypto, the first decryption test fails with "Failed to
> > decrypt part: Decryption failed: No secret key". Oddly, the next ones
> > succeed, and if I permute them, then only the first one fails. I was
> > not able to reproduce this bug (even running the test on another
> > machine made it disappear, go figure...), and I would guess that it
> > comes from gmime30 (which is responsible for looking for said secret
> > key) rather than notmuch. Probably related to an environment variable
> > or something else particular to the chroot in which I build.
> > - In T455-emacs-charsets, two tests related to the Yen character fail,
> > but I think they shouldn't: the output is the "Yen sign" U+00A5, i.e.
> > 0xC2 0xA5, when the test expected the "Fullwidth Yen sign" U+FFE5,
> > i.e. 0xEF 0xBF 0xA5. What we get seems to be more correct.
> > - in T610-message-property, the "prefix" test fails, but this seems to
> > be because the test is incorrect (it expects a certain order that is
> > not guaranteed by the implementation: there is a key-multiple values
> > map in which the keys are sorted, but not the values). The test
> > itself should be fixed.
> > I also ran the tests in T530-upgrade, which require a file to be
> > downloaded separately (I did not see a way to achieve this automatically
> > using bsd.port.mk, so I just downloaded the file on the side and ran the
> > test manually), and the tests pass (after a small patch in
> > notmuch-new.c). It probably does not matter much anyway because these
> > tests concern upgrading from an old database.
> >
> > So I am now happy with the result of the tests.
> >
> > I did not touch the python bindings part of the port. In fact I did not
> > even look at it, but the test pass so hopefully they're ok. Grepping
> > for dump does not yield any match, so I guess that the removal of the
> > --gzip option makes no difference for them.
> >
> > Note that there are also ruby bindings, which are currently not built by
> > the port, and that are presumably required for the vim plugin. I do not
> > intend to look at them in the near future.
> >
> > I hope that this port can now be commited. I have been using notmuch on
> > OpenBSD for more than a year without issues now, but I have not tagged
> > anything (too lazy) and only used searching, and so I have never had any
> > use for the dump/restore feature. I hope that Enric, Andrea and others
> > can test tagging more extensively now.
> >
> > Next, there is a trivial patch for neomutt (notmuch is a configure
> > option), which I also have been happily using. Would that be better as
> > a flavor or is notmuch small enough to be a dependency of neomutt?
> >
> > PS: The three zlib-related bugs in notmuch mentioned in a previous email
> > are now fixed upstream, so they should vanish in the next version.
>
>
# $OpenBSD: Makefile.template,v 1.54 2008/01/13 16:43:57 espie Exp $
SUBDIR =
SUBDIR += notmuch
SUBDIR += py-notmuch
SUBDIR += py-notmuch,python3
.include <bsd.port.subdir.mk>
# $OpenBSD$
V = 0.29.3
DISTNAME = notmuch-$V
EXTRACT_SUFX = .tar.xz
CATEGORIES = mail databases
HOMEPAGE = https://notmuchmail.org/
MASTER_SITES = https://notmuchmail.org/releases/
# GPLv3+
PERMIT_PACKAGE = Yes
# $OpenBSD: Makefile.template,v 1.54 2008/01/13 16:43:57 espie Exp $
COMMENT-main = mail indexer, tagger and threader
COMMENT-emacs = Emacs bindings for notmuch
PKGNAME-main = notmuch-${V}
PKGNAME-emacs = notmuch-emacs-${V}
SHARED_LIBS += notmuch 0.0
MULTI_PACKAGES = -main -emacs
DEBUG_PACKAGES = -main
COMPILER= base-clang ports-gcc
WANTLIB-main += ${COMPILER_LIBCXX} c glib-2.0 gmime-3.0
WANTLIB-main += gobject-2.0 intl m talloc xapian z
LIB_DEPENDS = databases/xapian-core \
devel/libtalloc \
mail/gmime30
RUN_DEPENDS-emacs = devel/desktop-file-utils \
databases/xapian-core \
editors/emacs \
${FULLPKGNAME-main}:${FULLPKGPATH-main}
BUILD_DEPENDS = devel/doxygen \
editors/emacs,gtk3 \
shells/bash \
textproc/py-sphinx${MODPY_FLAVOR}
TEST_DEPENDS = archivers/gtar \
devel/gdb \
misc/dtach \
security/gnupg2 \
sysutils/coreutils \
${FULLPKGNAME-main}:${FULLPKGPATH-main}
MODULES = lang/python
MODPY_RUNDEP = No
MODPY_PYTEST = Yes
MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3}
USE_GMAKE = Yes
CONFIGURE_STYLE = simple
CONFIGURE_ARGS = --mandir=${PREFIX}/man \
--infodir=${PREFIX}/info \
--sysconfdir=${SYSCONFDIR} \
--bashcompletiondir=${PREFIX}/share/notmuch/bash_completion.d
CONFIGURE_ENV = PYTHON=${MODPY_BIN}
MAKE_FLAGS = V=1
LIBnotmuch_MAJOR = ${LIBnotmuch_VERSION:R}
LIBnotmuch_MINOR = ${LIBnotmuch_VERSION:E}
SUBST_VARS = LIBnotmuch_MAJOR LIBnotmuch_MINOR NOTMUCH_LIBV
# the --gzip option of notmuch dump is disabled so skip the relevant tests
TEST_FLAGS = V=1 \
NOTMUCH_TEST_SERIALIZE=1 \
NOTMUCH_SKIP_TESTS="dump-restore.14 dump-restore.15" \
TEST_CFLAGS="-O0 -g -I${LOCALBASE}/include -L${LOCALBASE}/lib"
TEST_TARGET = test
post-extract:
cd ${WRKSRC}/test; [ -r test-lib-OPENBSD.sh ] || \
cp test-lib-FREEBSD.sh test-lib-OPENBSD.sh
# Avoid conflict with C++20 <version>, also see patches
pre-configure:
cd ${WRKSRC}; mv version version.txt; \
${SUBST_CMD} lib/notmuch.h
post-install:
rm ${PREFIX}/man/man1/notmuch-setup.1.gz
gunzip ${PREFIX}/man/*/*gz
ln -s notmuch.1 ${PREFIX}/man/man1/notmuch-setup.1
.include <bsd.port.mk>
SHA256 (notmuch-0.29.3.tar.xz) = 1fcEuacjleQzA96bH02OFN0nvzZG/bs3S7Pbt9FQ3DU=
SIZE (notmuch-0.29.3.tar.xz) = 660536
$OpenBSD$
Index: Makefile.global
--- Makefile.global.orig
+++ Makefile.global
@@ -16,7 +16,7 @@ else
DATE:=$(shell date +%F)
endif
-VERSION:=$(shell cat ${srcdir}/version)
+VERSION:=$(shell cat ${srcdir}/version.txt)
ELPA_VERSION:=$(subst ~,_,$(VERSION))
ifeq ($(filter release release-message pre-release
update-versions,$(MAKECMDGOALS)),)
ifeq ($(IS_GIT),yes)
$OpenBSD$
Index: Makefile.local
--- Makefile.local.orig
+++ Makefile.local
@@ -19,7 +19,7 @@ endif
# Depend (also) on the file 'version'. In case of ifeq ($(IS_GIT),yes)
# this file may already have been updated.
-version.stamp: $(srcdir)/version
+version.stamp: $(srcdir)/version.txt
echo $(VERSION) > $@
$(TAR_FILE):
$OpenBSD$
Index: bindings/python/notmuch/globals.py
--- bindings/python/notmuch/globals.py.orig
+++ bindings/python/notmuch/globals.py
@@ -27,7 +27,7 @@ try:
if uname()[0] == 'Darwin':
nmlib = CDLL("libnotmuch.{0:s}.dylib".format(SOVERSION))
else:
- nmlib = CDLL("libnotmuch.so.{0:s}".format(SOVERSION))
+ nmlib = CDLL("libnotmuch.so")
except:
raise ImportError("Could not find shared 'notmuch' library.")
$OpenBSD$
Index: configure
--- configure.orig
+++ configure
@@ -588,9 +588,9 @@ if ! pkg-config --exists zlib; then
rm -f compat/gen_zlib_pc
fi
-printf "Checking for zlib (>= 1.2.5.2)... "
+printf "Checking for zlib (>= 1.2.3)... "
have_zlib=0
-if pkg-config --atleast-version=1.2.5.2 zlib; then
+if pkg-config --atleast-version=1.2.3 zlib; then
printf "Yes.\n"
have_zlib=1
zlib_cflags=$(pkg-config --cflags zlib)
@@ -713,7 +713,7 @@ have_makeinfo=0
have_install_info=0
if [ $WITH_DOCS = "1" ] ; then
printf "Checking if sphinx is available and supports nroff output... "
- if command -v sphinx-build > /dev/null && ${python} -m
sphinx.writers.manpage > /dev/null 2>&1 ; then
+ if command -v sphinx-build-3 > /dev/null && ${python} -m
sphinx.writers.manpage > /dev/null 2>&1 ; then
printf "Yes.\n"
have_sphinx=1
else
$OpenBSD$
Index: devel/RELEASING
--- devel/RELEASING.orig
+++ devel/RELEASING
@@ -62,7 +62,7 @@ repository. From here, there are just a few steps to r
be "1.0.1" and a subsequent bug-fix release would be "1.0.2"
etc.
- When you are happy with the file 'version', run
+ When you are happy with the file 'version.txt', run
make update-versions
$OpenBSD$
Index: devel/nmbug/doc/conf.py
--- devel/nmbug/doc/conf.py.orig
+++ devel/nmbug/doc/conf.py
@@ -17,7 +17,7 @@ location = os.path.dirname(__file__)
dirname = location
while True:
- version_file = os.path.join(dirname, 'version')
+ version_file = os.path.join(dirname, 'version.txt')
if os.path.exists(version_file):
with open(version_file,'r') as f:
version = f.read().strip()
$OpenBSD$
Index: doc/Makefile.local
--- doc/Makefile.local.orig
+++ doc/Makefile.local
@@ -4,7 +4,7 @@ dir := doc
# You can set these variables from the command line.
SPHINXOPTS := -q
-SPHINXBUILD = HAVE_EMACS=${HAVE_EMACS} WITH_EMACS=${WITH_EMACS} sphinx-build
+SPHINXBUILD = HAVE_EMACS=${HAVE_EMACS} WITH_EMACS=${WITH_EMACS}
sphinx-build-3
DOCBUILDDIR := $(dir)/_build
# Internal variables.
$OpenBSD$
Index: doc/conf.py
--- doc/conf.py.orig
+++ doc/conf.py
@@ -17,7 +17,7 @@ copyright = u'2009-2019, Carl Worth and many others'
location = os.path.dirname(__file__)
for pathdir in ['.', '..']:
- version_file = os.path.join(location,pathdir,'version')
+ version_file = os.path.join(location,pathdir,'version.txt')
if os.path.exists(version_file):
with open(version_file,'r') as infile:
version=infile.read().replace('\n','')
$OpenBSD$
no gzip option because OpenBSD's zlib does not have the "transparency"
(no compression) feature when writing to a file.
Index: doc/man1/notmuch-dump.rst
--- doc/man1/notmuch-dump.rst.orig
+++ doc/man1/notmuch-dump.rst
@@ -5,7 +5,7 @@ notmuch-dump
SYNOPSIS
========
-**notmuch** **dump** [--gzip] [--format=(batch-tag|sup)]
[--output=<*file*>] [--] [<*search-term*> ...]
+**notmuch** **dump** [--format=(batch-tag|sup)] [--output=<*file*>] [--]
[<*search-term*> ...]
DESCRIPTION
===========
@@ -26,8 +26,6 @@ the remaining arguments are search terms.
Supported options for **dump** include
-``--gzip``
- Compress the output in a format compatible with **gzip(1)**.
``--format=(sup|batch-tag)``
Notmuch restore supports two plain text dump formats, both with
$OpenBSD$
Index: emacs/Makefile.local
--- emacs/Makefile.local.orig
+++ emacs/Makefile.local
@@ -128,7 +128,6 @@ endif
ifeq ($(WITH_DESKTOP),1)
mkdir -p "$(DESTDIR)$(desktop_dir)"
desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)"
$(emacs_mua_desktop)
- -update-desktop-database "$(DESTDIR)$(desktop_dir)"
endif
CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el
$(dir)/notmuch-pkg.el \
$OpenBSD$
Index: lib/Makefile.local
--- lib/Makefile.local.orig
+++ lib/Makefile.local
@@ -16,9 +16,15 @@ LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIB
LIBRARY_LINK_FLAG = -dynamiclib -install_name $(libdir)/$(SONAME)
-compatibility_version
$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR) -current_version
$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
else
LIBRARY_SUFFIX = so
+ifeq ($(PLATFORM),OPENBSD)
+LINKER_NAME =
libnotmuch.$(LIBRARY_SUFFIX).$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR)
+SONAME = $(LINKER_NAME)
+LIBNAME = $(SONAME)
+else
LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
+endif
LIBRARY_LINK_FLAG = -shared
-Wl,--version-script=$(srcdir)/$(lib)/notmuch.sym,-soname=$(SONAME)
$(NO_UNDEFINED_LDFLAGS)
ifeq ($(PLATFORM),OPENBSD)
LIBRARY_LINK_FLAG += -lc
@@ -69,19 +75,23 @@ $(dir)/libnotmuch.a: $(libnotmuch_modules)
$(dir)/$(LIBNAME): $(libnotmuch_modules) util/libnotmuch_util.a
parse-time-string/libparse-time-string.a
$(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules)
$(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
util/libnotmuch_util.a parse-time-string/libparse-time-string.a
+ifneq ($(SONAME),$(LINKER_NAME))
$(dir)/$(SONAME): $(dir)/$(LIBNAME)
ln -sf $(LIBNAME) $@
$(dir)/$(LINKER_NAME): $(dir)/$(SONAME)
ln -sf $(LIBNAME) $@
+endif
install: install-$(dir)
install-$(dir): $(dir)/$(LIBNAME)
mkdir -p "$(DESTDIR)$(libdir)/"
install -m0644 "$(lib)/$(LIBNAME)" "$(DESTDIR)$(libdir)/"
+ifneq ($(SONAME),$(LINKER_NAME))
ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(SONAME)"
ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(LINKER_NAME)"
+endif
mkdir -p "$(DESTDIR)$(includedir)"
install -m0644 "$(srcdir)/$(lib)/notmuch.h" "$(DESTDIR)$(includedir)/"
$(LIBRARY_INSTALL_POST_COMMAND)
$OpenBSD$
Index: lib/notmuch.h
--- lib/notmuch.h.orig
+++ lib/notmuch.h
@@ -57,8 +57,8 @@ NOTMUCH_BEGIN_DECLS
* The library version number. This must agree with the soname
* version in Makefile.local.
*/
-#define LIBNOTMUCH_MAJOR_VERSION 5
-#define LIBNOTMUCH_MINOR_VERSION 2
+#define LIBNOTMUCH_MAJOR_VERSION ${LIBnotmuch_MAJOR}
+#define LIBNOTMUCH_MINOR_VERSION ${LIBnotmuch_MINOR}
#define LIBNOTMUCH_MICRO_VERSION 0
$OpenBSD$
For lack of transparent write mode in zlib, replace zlib by stdio in
notmuch dump (the --gzip option no longer exists).
Index: notmuch-dump.c
--- notmuch-dump.c.orig
+++ notmuch-dump.c
@@ -24,7 +24,7 @@
#include <zlib.h>
static int
-database_dump_config (notmuch_database_t *notmuch, gzFile output)
+database_dump_config (notmuch_database_t *notmuch, FILE *output)
{
notmuch_config_list_t *list;
int ret = EXIT_FAILURE;
@@ -42,7 +42,8 @@ database_dump_config (notmuch_database_t *notmuch, gzF
notmuch_config_list_key (list));
goto DONE;
}
- gzprintf (output, "#@ %s", buffer);
+ if (fprintf (output, "#@ %s", buffer) < 0)
+ exit (1);
if (hex_encode (notmuch, notmuch_config_list_value (list),
&buffer, &buffer_size) != HEX_SUCCESS) {
@@ -51,7 +52,8 @@ database_dump_config (notmuch_database_t *notmuch, gzF
goto DONE;
}
- gzprintf (output, " %s\n", buffer);
+ if (fprintf (output, " %s\n", buffer) < 0)
+ exit (1);
}
ret = EXIT_SUCCESS;
@@ -67,32 +69,37 @@ database_dump_config (notmuch_database_t *notmuch, gzF
}
static void
-print_dump_header (gzFile output, int output_format, int include)
+print_dump_header (FILE *output, int output_format, int include)
{
const char *sep = "";
- gzprintf (output, "#notmuch-dump %s:%d ",
- (output_format == DUMP_FORMAT_SUP) ? "sup" : "batch-tag",
- NOTMUCH_DUMP_VERSION);
+ if (fprintf (output, "#notmuch-dump %s:%d ",
+ (output_format == DUMP_FORMAT_SUP) ? "sup" : "batch-tag",
+ NOTMUCH_DUMP_VERSION) < 0)
+ exit (1);
if (include & DUMP_INCLUDE_CONFIG) {
- gzputs (output, "config");
+ if (fputs ("config", output) < 0)
+ exit (1);
sep = ",";
}
if (include & DUMP_INCLUDE_PROPERTIES) {
- gzprintf (output, "%sproperties", sep);
+ if (fprintf (output, "%sproperties", sep) < 0)
+ exit (1);
sep = ",";
}
if (include & DUMP_INCLUDE_TAGS) {
- gzprintf (output, "%stags", sep);
+ if (fprintf (output, "%stags", sep) < 0)
+ exit (1);
}
- gzputs (output, "\n");
+ if (fputs ("\n", output) < 0)
+ exit (1);
}
static int
dump_properties_message (void *ctx,
notmuch_message_t *message,
- gzFile output,
+ FILE *output,
char **buffer_p, size_t *size_p)
{
const char *message_id;
@@ -115,7 +122,8 @@ dump_properties_message (void *ctx,
fprintf (stderr, "Error: failed to hex-encode message-id %s\n",
message_id);
return 1;
}
- gzprintf (output, "#= %s", *buffer_p);
+ if (fprintf (output, "#= %s", *buffer_p) < 0)
+ exit (1);
first = false;
}
@@ -126,18 +134,21 @@ dump_properties_message (void *ctx,
fprintf (stderr, "Error: failed to hex-encode key %s\n", key);
return 1;
}
- gzprintf (output, " %s", *buffer_p);
+ if (fprintf (output, " %s", *buffer_p) < 0)
+ exit (1);
if (hex_encode (ctx, val, buffer_p, size_p) != HEX_SUCCESS) {
fprintf (stderr, "Error: failed to hex-encode value %s\n", val);
return 1;
}
- gzprintf (output, "=%s", *buffer_p);
+ if (fprintf (output, "=%s", *buffer_p) < 0)
+ exit (1);
}
notmuch_message_properties_destroy (list);
if (! first)
- gzprintf (output, "\n", *buffer_p);
+ if (fputs ("\n", output) < 0)
+ exit (1);
return 0;
}
@@ -145,7 +156,7 @@ dump_properties_message (void *ctx,
static int
dump_tags_message (void *ctx,
notmuch_message_t *message, int output_format,
- gzFile output,
+ FILE *output,
char **buffer_p, size_t *size_p)
{
int first = 1;
@@ -165,7 +176,8 @@ dump_tags_message (void *ctx,
}
if (output_format == DUMP_FORMAT_SUP) {
- gzprintf (output, "%s (", message_id);
+ if (fprintf (output, "%s (", message_id) < 0)
+ exit (1);
}
for (notmuch_tags_t *tags = notmuch_message_get_tags (message);
@@ -174,12 +186,14 @@ dump_tags_message (void *ctx,
const char *tag_str = notmuch_tags_get (tags);
if (! first)
- gzputs (output, " ");
+ if (fputs (" ", output) < 0)
+ exit (1);
first = 0;
if (output_format == DUMP_FORMAT_SUP) {
- gzputs (output, tag_str);
+ if (fputs (tag_str, output) < 0)
+ exit (1);
} else {
if (hex_encode (ctx, tag_str,
buffer_p, size_p) != HEX_SUCCESS) {
@@ -187,12 +201,14 @@ dump_tags_message (void *ctx,
tag_str);
return EXIT_FAILURE;
}
- gzprintf (output, "+%s", *buffer_p);
+ if (fprintf (output, "+%s", *buffer_p) < 0)
+ exit (1);
}
}
if (output_format == DUMP_FORMAT_SUP) {
- gzputs (output, ")\n");
+ if (fputs (")\n", output) < 0)
+ exit (1);
} else {
if (make_boolean_term (ctx, "id", message_id,
buffer_p, size_p)) {
@@ -200,13 +216,14 @@ dump_tags_message (void *ctx,
message_id, strerror (errno));
return EXIT_FAILURE;
}
- gzprintf (output, " -- %s\n", *buffer_p);
+ if (fprintf (output, " -- %s\n", *buffer_p) < 0)
+ exit (1);
}
return EXIT_SUCCESS;
}
static int
-database_dump_file (notmuch_database_t *notmuch, gzFile output,
+database_dump_file (notmuch_database_t *notmuch, FILE *output,
const char *query_str, int output_format, int include)
{
notmuch_query_t *query;
@@ -279,8 +296,7 @@ notmuch_database_dump (notmuch_database_t *notmuch,
dump_include_t include,
bool gzip_output)
{
- gzFile output = NULL;
- const char *mode = gzip_output ? "w9" : "wT";
+ FILE *output = NULL;
const char *name_for_error = output_file_name ? output_file_name :
"stdout";
char *tempname = NULL;
@@ -300,10 +316,10 @@ notmuch_database_dump (notmuch_database_t *notmuch,
goto DONE;
}
- output = gzdopen (outfd, mode);
+ output = fdopen (outfd, "w");
if (output == NULL) {
- fprintf (stderr, "Error opening %s for (gzip) writing: %s\n",
+ fprintf (stderr, "Error opening %s for writing: %s\n",
name_for_error, strerror (errno));
if (close (outfd))
fprintf (stderr, "Error closing %s during shutdown: %s\n",
@@ -314,9 +330,10 @@ notmuch_database_dump (notmuch_database_t *notmuch,
ret = database_dump_file (notmuch, output, query_str, output_format,
include);
if (ret) goto DONE;
- ret = gzflush (output, Z_FINISH);
+ ret = fflush (output);
if (ret) {
- fprintf (stderr, "Error flushing output: %s\n", gzerror (output, NULL));
+ fprintf (stderr, "Error flushing %s: %s\n",
+ name_for_error, strerror (errno));
goto DONE;
}
@@ -329,10 +346,10 @@ notmuch_database_dump (notmuch_database_t *notmuch,
}
}
- ret = gzclose_w (output);
+ ret = fclose (output);
if (ret) {
fprintf (stderr, "Error closing %s: %s\n", name_for_error,
- gzerror (output, NULL));
+ strerror (errno));
ret = EXIT_FAILURE;
output = NULL;
goto DONE;
@@ -350,7 +367,7 @@ notmuch_database_dump (notmuch_database_t *notmuch,
}
DONE:
if (ret != EXIT_SUCCESS && output)
- (void) gzclose_w (output);
+ (void) fclose (output);
if (ret != EXIT_SUCCESS && output_file_name)
(void) unlink (tempname);
@@ -388,7 +405,6 @@ notmuch_dump_command (notmuch_config_t *config, int ar
{ "properties", DUMP_INCLUDE_PROPERTIES },
{ "tags", DUMP_INCLUDE_TAGS} } },
{ .opt_string = &output_file_name, .name = "output" },
- { .opt_bool = &gzip_output, .name = "gzip" },
{ .opt_inherit = notmuch_shared_options },
{ }
};
$OpenBSD$
when upgrading database, back up the old db without compression since
--gzip is not supported in this port
Index: notmuch-new.c
--- notmuch-new.c.orig
+++ notmuch-new.c
@@ -1156,7 +1156,7 @@ notmuch_new_command (notmuch_config_t *config, int arg
* relatively small. */
const char *backup_name =
- talloc_asprintf (notmuch,
"%s/dump-%04d%02d%02dT%02d%02d%02d.gz",
+ talloc_asprintf (notmuch, "%s/dump-%04d%02d%02dT%02d%02d%02d",
dot_notmuch_path,
gm_time->tm_year + 1900,
gm_time->tm_mon + 1,
@@ -1168,11 +1168,11 @@ notmuch_new_command (notmuch_config_t *config, int arg
if (add_files_state.verbosity >= VERBOSITY_NORMAL) {
printf ("Welcome to a new version of notmuch! Your database will now be
upgraded.\n");
printf ("This process is safe to interrupt.\n");
- printf ("Backing up tags to %s...\n", backup_name);
+ printf ("Backing up tags to %s (uncompressed)...\n",
backup_name);
}
if (notmuch_database_dump (notmuch, backup_name, "",
- DUMP_FORMAT_BATCH_TAG,
DUMP_INCLUDE_DEFAULT, true)) {
+ DUMP_FORMAT_BATCH_TAG,
DUMP_INCLUDE_DEFAULT, false)) {
fprintf (stderr, "Backup failed. Aborting upgrade.");
return EXIT_FAILURE;
}
$OpenBSD$
Index: notmuch-restore.c
--- notmuch-restore.c.orig
+++ notmuch-restore.c
@@ -238,6 +238,7 @@ notmuch_restore_command (notmuch_config_t *config, int
int opt_index;
int include = 0;
int input_format = DUMP_FORMAT_AUTO;
+ int errnum;
if (notmuch_database_open (notmuch_config_get_database_path (config),
NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much))
@@ -449,10 +450,13 @@ notmuch_restore_command (notmuch_config_t *config, int
if (notmuch)
notmuch_database_destroy (notmuch);
- if (input && gzclose_r (input)) {
- fprintf (stderr, "Error closing %s: %s\n",
- name_for_error, gzerror (input, NULL));
- ret = EXIT_FAILURE;
+ if (input) {
+ errnum = gzclose (input);
+ if (errnum) {
+ fprintf (stderr, "Error closing %s: %d\n",
+ name_for_error, errnum);
+ ret = EXIT_FAILURE;
+ }
}
return ret ? EXIT_FAILURE : EXIT_SUCCESS;
$OpenBSD$
adapt tests
Index: test/T240-dump-restore.sh
--- test/T240-dump-restore.sh.orig
+++ test/T240-dump-restore.sh
@@ -95,14 +95,14 @@ gunzip dump-gzip-outfile.gz
test_expect_equal_file dump.expected dump-gzip-outfile
test_begin_subtest "restoring gzipped stdin"
-notmuch dump --gzip --output=backup.gz
+notmuch dump | gzip >backup.gz
notmuch tag +new_tag '*'
notmuch restore < backup.gz
notmuch dump --output=dump.actual
test_expect_equal_file dump.expected dump.actual
test_begin_subtest "restoring gzipped file"
-notmuch dump --gzip --output=backup.gz
+notmuch dump | gzip >backup.gz
notmuch tag +new_tag '*'
notmuch restore --input=backup.gz
notmuch dump --output=dump.actual
$OpenBSD$
OpenSSL has sha1 as default fingerprint algo
LibreSSL has md5 as default fingerprint algo
Index: test/T355-smime.sh
--- test/T355-smime.sh.orig
+++ test/T355-smime.sh
@@ -21,7 +21,7 @@ test_require_external_prereq gpgsm
cp $NOTMUCH_SRCDIR/test/smime/key+cert.pem test_suite.pem
-FINGERPRINT=$(openssl x509 -fingerprint -in test_suite.pem -noout | sed -e
's/^.*=//' -e s/://g)
+FINGERPRINT=$(openssl x509 -fingerprint -sha1 -in test_suite.pem -noout |
sed -e 's/^.*=//' -e s/://g)
add_gpgsm_home
$OpenBSD$
Index: test/T360-symbol-hiding.sh
--- test/T360-symbol-hiding.sh.orig
+++ test/T360-symbol-hiding.sh
@@ -26,7 +26,7 @@ test_begin_subtest 'checking output'
test_expect_equal "$result" "$output"
test_begin_subtest 'comparing existing to exported symbols'
-nm -P $NOTMUCH_BUILDDIR/lib/libnotmuch.so | awk '$2 == "T" && $1 ~
"^notmuch" {print $1}' | sort | uniq > ACTUAL
+nm -P $NOTMUCH_BUILDDIR/lib/libnotmuch.so* | awk '$2 == "T" && $1 ~
"^notmuch" {print $1}' | sort | uniq > ACTUAL
sed -n 's/^\(notmuch_[a-zA-Z0-9_]*\)[[:blank:]]*(.*/\1/p'
$NOTMUCH_SRCDIR/lib/notmuch.h | sort | uniq > EXPORTED
test_expect_equal_file EXPORTED ACTUAL
$OpenBSD$
modify test because we don't have notmuch dump --gzip
Index: test/T530-upgrade.sh
--- test/T530-upgrade.sh.orig
+++ test/T530-upgrade.sh
@@ -38,8 +38,8 @@ Your notmuch database has now been upgraded.
No new mail."
test_begin_subtest "tag backup matches pre-upgrade dump"
-gunzip -c ${MAIL_DIR}/.notmuch/dump-*.gz | sort > backup-dump
-test_expect_equal_file pre-upgrade-dump backup-dump
+<${MAIL_DIR}/.notmuch/dump-* sort > backup-dump
+test_expect_equal_file pre-upgrade-dump backup-dump
test_begin_subtest "folder: no longer matches in the middle of path"
output=$(notmuch search folder:baz)
$OpenBSD$
Index: test/test-lib-OPENBSD.sh
--- test/test-lib-OPENBSD.sh.orig
+++ test/test-lib-OPENBSD.sh
@@ -4,6 +4,10 @@ if command -v gdate >/dev/null
date () { gdate "$@"; }
base64 () { gbase64 "$@"; }
wc () { gwc "$@"; }
- sed () { gsed "$@"; }
+ seq () { gseq "$@"; }
+ stat () { gstat "$@"; }
sha256sum () { gsha256sum "$@"; }
fi
+gdb () { egdb "$@"; }
+gpg () { gpg2 "$@"; }
+tar () { gtar "$@"; }
$OpenBSD$
use gpg2 instead of gpg
Index: test/test-lib.sh
--- test/test-lib.sh.orig
+++ test/test-lib.sh
@@ -112,11 +112,11 @@ add_gnupg_home ()
_gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
at_exit_function _gnupg_exit
mkdir -m 0700 "$GNUPGHOME"
- gpg --no-tty --import <$NOTMUCH_SRCDIR/test/gnupg-secret-key.asc
>"$GNUPGHOME"/import.log 2>&1
+ gpg2 --no-tty --import <$NOTMUCH_SRCDIR/test/gnupg-secret-key.asc
>"$GNUPGHOME"/import.log 2>&1
test_debug "cat $GNUPGHOME/import.log"
- if (gpg --quick-random --version >/dev/null 2>&1) ; then
+ if (gpg2 --quick-random --version >/dev/null 2>&1) ; then
echo quick-random >> "$GNUPGHOME"/gpg.conf
- elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then
+ elif (gpg2 --debug-quick-random --version >/dev/null 2>&1) ; then
echo debug-quick-random >> "$GNUPGHOME"/gpg.conf
fi
echo no-emit-version >> "$GNUPGHOME"/gpg.conf
@@ -124,7 +124,7 @@ add_gnupg_home ()
# Change this if we ship a new test key
FINGERPRINT="5AEAB11F5E33DCE875DDB75B6D92612D94E46381"
SELF_USERID="Notmuch Test Suite <[email protected]> (INSECURE!)"
- printf '%s:6:\n' "$FINGERPRINT" | gpg --quiet --batch --no-tty
--import-ownertrust
+ printf '%s:6:\n' "$FINGERPRINT" | gpg2 --quiet --batch --no-tty
--import-ownertrust
}
# Each test should start with something like this, after copyright notices:
$OpenBSD$
Index: util/zlib-extra.c
--- util/zlib-extra.c.orig
+++ util/zlib-extra.c
@@ -47,6 +47,7 @@ gz_getline (void *talloc_ctx, char **bufptr, ssize_t *
int zlib_status = 0;
(void) gzerror (stream, &zlib_status);
switch (zlib_status) {
+ case Z_STREAM_END:
case Z_OK:
/* no data read before EOF */
if (offset == 0)
@@ -78,8 +79,9 @@ gz_getline (void *talloc_ctx, char **bufptr, ssize_t *
const char *gz_error_string (util_status_t status, gzFile file)
{
+ int errnum;
if (status == UTIL_GZERROR)
- return gzerror (file, NULL);
+ return gzerror (file, &errnum);
else
return util_error_string (status);
}
The necessary runtime to run notmuch inside Emacs.
Notmuch is a mail indexing program providing a fast tag-based email
reader with global search to use within a text editor.
"Notmuch is not much of an email program. It doesn't receive messages
(no POP or IMAP suport). It doesn't send messages (no mail composer,
no network code at all). And for what it does do (email search)
that work is provided by an external library, Xapian. So if Notmuch
provides no user interface and Xapian does all the heavy lifting,
then what's left here? Not much."
@comment $OpenBSD: PLIST-main,v$
bin/notmuch-emacs-mua
@info info/notmuch-emacs-mua.info
@info info/notmuch-emacs.info
@man man/man1/notmuch-emacs-mua.1
share/applications/notmuch-emacs-mua.desktop
share/emacs/site-lisp/coolj.el
share/emacs/site-lisp/coolj.elc
share/emacs/site-lisp/notmuch-address.el
share/emacs/site-lisp/notmuch-address.elc
share/emacs/site-lisp/notmuch-company.el
share/emacs/site-lisp/notmuch-company.elc
share/emacs/site-lisp/notmuch-compat.el
share/emacs/site-lisp/notmuch-compat.elc
share/emacs/site-lisp/notmuch-crypto.el
share/emacs/site-lisp/notmuch-crypto.elc
share/emacs/site-lisp/notmuch-draft.el
share/emacs/site-lisp/notmuch-draft.elc
share/emacs/site-lisp/notmuch-hello.el
share/emacs/site-lisp/notmuch-hello.elc
share/emacs/site-lisp/notmuch-jump.el
share/emacs/site-lisp/notmuch-jump.elc
share/emacs/site-lisp/notmuch-lib.el
share/emacs/site-lisp/notmuch-lib.elc
share/emacs/site-lisp/notmuch-logo.png
share/emacs/site-lisp/notmuch-maildir-fcc.el
share/emacs/site-lisp/notmuch-maildir-fcc.elc
share/emacs/site-lisp/notmuch-message.el
share/emacs/site-lisp/notmuch-message.elc
share/emacs/site-lisp/notmuch-mua.el
share/emacs/site-lisp/notmuch-mua.elc
share/emacs/site-lisp/notmuch-parser.el
share/emacs/site-lisp/notmuch-parser.elc
share/emacs/site-lisp/notmuch-print.el
share/emacs/site-lisp/notmuch-print.elc
share/emacs/site-lisp/notmuch-query.el
share/emacs/site-lisp/notmuch-query.elc
share/emacs/site-lisp/notmuch-show.el
share/emacs/site-lisp/notmuch-show.elc
share/emacs/site-lisp/notmuch-tag.el
share/emacs/site-lisp/notmuch-tag.elc
share/emacs/site-lisp/notmuch-tree.el
share/emacs/site-lisp/notmuch-tree.elc
share/emacs/site-lisp/notmuch-version.el
share/emacs/site-lisp/notmuch-version.elc
share/emacs/site-lisp/notmuch-wash.el
share/emacs/site-lisp/notmuch-wash.elc
share/emacs/site-lisp/notmuch.el
share/emacs/site-lisp/notmuch.elc
@tag update-desktop-database
@comment $OpenBSD: PLIST-main,v$
@bin bin/notmuch
include/notmuch.h
@info info/notmuch-address.info
@info info/notmuch-compact.info
@info info/notmuch-config.info
@info info/notmuch-count.info
@info info/notmuch-dump.info
@info info/notmuch-hooks.info
@info info/notmuch-insert.info
@info info/notmuch-new.info
@info info/notmuch-properties.info
@info info/notmuch-reindex.info
@info info/notmuch-reply.info
@info info/notmuch-restore.info
@info info/notmuch-search-terms.info
@info info/notmuch-search.info
@info info/notmuch-show.info
@info info/notmuch-tag.info
@info info/notmuch.info
@lib lib/libnotmuch.so.${LIBnotmuch_VERSION}
@man man/man1/notmuch-address.1
@man man/man1/notmuch-compact.1
@man man/man1/notmuch-config.1
@man man/man1/notmuch-count.1
@man man/man1/notmuch-dump.1
@man man/man1/notmuch-insert.1
@man man/man1/notmuch-new.1
@man man/man1/notmuch-reindex.1
@man man/man1/notmuch-reply.1
@man man/man1/notmuch-restore.1
@man man/man1/notmuch-search.1
@man man/man1/notmuch-setup.1
@man man/man1/notmuch-show.1
@man man/man1/notmuch-tag.1
@man man/man1/notmuch.1
@man man/man3/notmuch.3
@man man/man5/notmuch-hooks.5
@man man/man7/notmuch-properties.7
@man man/man7/notmuch-search-terms.7
share/zsh/
share/zsh/functions/
share/zsh/functions/Completion/
share/zsh/functions/Completion/Unix/
share/zsh/functions/Completion/Unix/_email-notmuch
share/zsh/functions/Completion/Unix/_notmuch
# $OpenBSD: Makefile.template,v 1.54 2008/01/13 16:43:57 espie Exp $
COMMENT = Python bindings for notmuch
PKGNAME = py-notmuch-${V}
MODULES = lang/python
MODPY_EGG_VERSION = ${V}
FLAVORS = python3
FLAVOR ?=
RUN_DEPENDS = mail/notmuch/notmuch
WRKSRC = ${WRKDIST}/bindings/python
.include <bsd.port.mk>
SHA256 (notmuch-0.29.3.tar.xz) = 1fcEuacjleQzA96bH02OFN0nvzZG/bs3S7Pbt9FQ3DU=
SIZE (notmuch-0.29.3.tar.xz) = 660536
$OpenBSD$
Index: bindings/python/notmuch/globals.py
--- bindings/python/notmuch/globals.py.orig
+++ bindings/python/notmuch/globals.py
@@ -27,7 +27,7 @@ try:
if uname()[0] == 'Darwin':
nmlib = CDLL("libnotmuch.{0:s}.dylib".format(SOVERSION))
else:
- nmlib = CDLL("libnotmuch.so.{0:s}".format(SOVERSION))
+ nmlib = CDLL("libnotmuch.so")
except:
raise ImportError("Could not find shared 'notmuch' library.")
The bindings necessary to interact with Notmuch from within Python.
@comment $OpenBSD: PLIST,v$
lib/python${MODPY_VERSION}/site-packages/notmuch/
lib/python${MODPY_VERSION}/site-packages/notmuch-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info
lib/python${MODPY_VERSION}/site-packages/notmuch/__init__.py
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}/
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}compat.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}database.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}directory.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}errors.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}filenames.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}globals.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}message.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}messages.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}query.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}tag.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}thread.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}threads.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/${MODPY_PYCACHE}version.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/notmuch/compat.py
lib/python${MODPY_VERSION}/site-packages/notmuch/database.py
lib/python${MODPY_VERSION}/site-packages/notmuch/directory.py
lib/python${MODPY_VERSION}/site-packages/notmuch/errors.py
lib/python${MODPY_VERSION}/site-packages/notmuch/filenames.py
lib/python${MODPY_VERSION}/site-packages/notmuch/globals.py
lib/python${MODPY_VERSION}/site-packages/notmuch/message.py
lib/python${MODPY_VERSION}/site-packages/notmuch/messages.py
lib/python${MODPY_VERSION}/site-packages/notmuch/query.py
lib/python${MODPY_VERSION}/site-packages/notmuch/tag.py
lib/python${MODPY_VERSION}/site-packages/notmuch/thread.py
lib/python${MODPY_VERSION}/site-packages/notmuch/threads.py
lib/python${MODPY_VERSION}/site-packages/notmuch/version.py