commit - 05a7a31cc5fec292b1ca3e6298afb82029372a79
commit + 8908562dcaa8372dc94104ebc93e39f19c3f57a4
blob - bb6d62aaf04d48053d8c07f0eeab918d402677c8
blob + efcbac89ef7da443bdd82e95f010ffe016602ce2
--- gotd/Makefile
+++ gotd/Makefile
.PATH:${.CURDIR}/../lib
+SUBDIR = libexec
+
.include "../got-version.mk"
.if ${GOT_RELEASE} == "Yes"
blob - /dev/null
blob + 59c09c35e0b26fb30a138fc1dd52d8f994826c32 (mode 644)
--- /dev/null
+++ gotd/libexec/Makefile
+SUBDIR = got-notify-email
+
+.include <bsd.subdir.mk>
blob - /dev/null
blob + 1bc739e7aa3fede7385d957470cee88dd2460099 (mode 644)
--- /dev/null
+++ gotd/libexec/Makefile.inc
+.include "../../Makefile.inc"
+
+realinstall:
+ ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \
+ -m ${BINMODE} ${PROG} ${LIBEXECDIR}/${PROG}
+
+NOMAN = Yes
blob - /dev/null
blob + 3743222253927f8bd79e9d0cfb64171c39f6064b (mode 644)
--- /dev/null
+++ gotd/libexec/got-notify-email/Makefile
+.PATH:${.CURDIR}/../..
+.PATH:${.CURDIR}/../../../lib
+
+.include "../../../got-version.mk"
+
+PROG= got-notify-email
+SRCS= got-notify-email.c bloom.c buf.c date.c deflate.c delta.c \
+ delta_cache.c error.c gitconfig.c gotconfig.c hash.c \
+ inflate.c lockfile.c murmurhash2.c object.c object_cache.c \
+ object_create.c object_idset.c object_open_io.c \
+ object_parse.c object_qid.c opentemp.c pack.c path.c pollfd.c \
+ privsep_stub.c read_gitconfig.c read_gotconfig.c reference.c \
+ reference_parse.c repository.c sigs.c
+
+
+CPPFLAGS = -I${.CURDIR}/../../../include -I${.CURDIR}/../../../lib
+
+.if defined(PROFILE)
+LDADD = -lutil_p -lz_p -lm_p
+.else
+LDADD = -lutil -lz -lm
+.endif
+
+DPADD = ${LIBZ} ${LIBUTIL}
+
+.include <bsd.prog.mk>
blob - /dev/null
blob + df2b1210a04405ec7b27f39602e074769b7cff86 (mode 644)
--- /dev/null
+++ gotd/libexec/got-notify-email/got-notify-email.c
+/*
+ * Copyright (c) 2023 Stefan Sperling <stsp@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "got_error.h"
+#include "got_repository.h"
+
+
+__dead static void
+usage(void)
+{
+ fprintf(stderr, "usage: %s [repo-path]\n", getprogname());
+ exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+ const struct got_error *error;
+ char *repo_path;
+ struct got_repository *repo = NULL;
+ int *pack_fds = NULL;
+
+ if (argc != 2)
+ usage();
+
+ error = got_repo_pack_fds_open(&pack_fds);
+ if (error != NULL)
+ goto done;
+ error = got_repo_open(&repo, repo_path, NULL, pack_fds);
+ if (error)
+ goto done;
+done:
+ if (pack_fds) {
+ const struct got_error *pack_err =
+ got_repo_pack_fds_close(pack_fds);
+ if (error == NULL)
+ error = pack_err;
+ }
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
+ }
+ if (error) {
+ fflush(stdout);
+ fprintf(stderr, "%s: %s\n", getprogname(), error->msg);
+ return 1;
+ }
+ return 0;
+}